# Oracle

Use the Oracle database connector to connect to your Oracle database. This connector supports Oracle Database versions 10.2 and later.

## Managing Connector : Add, Edit, or Delete

Follow the [steps in the link](https://docs.novacura.com/flow-connect/working-with-connect/connect-to-systems/managing-connector) as a guideline for connector actions: Add, Edit, and Delete.

## Configuration values

| Configuration                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Agent Group**                | Agent group where the connector should be executed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Hostname**                   | IP address or host name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Port**                       | Port number. The standard port is 1521                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Username**                   | Username of the Global database user                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Password**                   | Password for the Global database user                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Service Name Type Selector** | <p>Choose which type of name is given.</p><p></p><p><strong>Service Name</strong>: Service name is the TNS alias that you give when you remotely connect to your database and this Service name is recorded in Tnsnames.</p><p></p><p><strong>SID</strong>: Oracle Service ID is the unique name that uniquely identifies your instance/database.</p>                                                                                                                                                                                                |
| **Service Name / SID**         | Value for service name or the SID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Connection Timeout**         | Connection timeout, in seconds, to use when executing a script or a query. If not set, the default value of 90 seconds will be used                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Schema/AppOwner**            | Database schema name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Initialization Command**     | <p>Optional command to execute immediately after successful login. The initialization command is executed before each machine step that uses the specified connector configuration.<br>Note: The user executing the Flow Connect app is available in the initialization command through <code>:FlowUser\_\_email</code> (and <code>:username</code> for backward compatibility). For automations, where no user is driving the execution, both variables are set to an empty string. In Oracle, an empty string is treated as <code>NULL</code>.</p> |
| **Cleanup Command**            | <p>An optional command to execute on the database after the operation has been completed.<br>Note: The user executing the Flow Connect app is available in the cleanup command through <code>:FlowUser\_\_email</code> (and <code>:username</code> for backward compatibility). For automations, where no user is driving the execution, both variables are set to an empty string. In Oracle, an empty string is treated as <code>NULL</code>.</p>                                                                                                  |
| **Command Timeout**            | Command timeout, in seconds, to use when executing a script or a query. If not set, the default value of 90 seconds will be used                                                                                                                                                                                                                                                                                                                                                                                                                     |

## User Impersonation in IFS

{% hint style="danger" %}
For impersonation to work, each IFS user must be granted access to **Fnd\_Session\_Util.API.Reset\_Fnd\_User\_** as part of their assigned permission set.

![](/files/Wf2GkXvMdWP3Hp11o2oh)
{% endhint %}

### Flow Classic

In the context of IFS database connections, it is a known pattern in Flow Classic to impersonate users programmatically. The `Fnd_Session_Util_API.Impersonate_Fnd_User_` procedure, provided by IFS Applications, allows for impersonation of a user session at the database level. This impersonation is typically achieved using the **Initialization Command**, which runs before each machine step for the associated connector.&#x20;

{% hint style="danger" %}
For this mechanism to work correctly, the  **:userId**(Flow Classic user) must exactly match the `DIRECTORY_ID` of the IFS user being impersonated.  Additionally, the schema owner cannot be specified using an environment variable—for example, you cannot use `{AppOwner}` syntax in place of IFSAPP
{% endhint %}

```plsql
BEGIN 
    IFSAPP.Fnd_Session_Util_API.Reset_Fnd_User_;
    -- :userId - userid of the flow user executing the workflow
    IFSAPP.Fnd_Session_Util_API.Impersonate_Fnd_User_(upper(:userId));
END;
```

### Flow Connect

To achieve similar behavior in Flow Connect, you can use the **:username** bind variable, which contains the email address of the Flow Connect user.

1. If **:username** matches the `DIRECTORY_ID` of the IFS user being impersonated.

```plsql
DECLARE  
    userId_ VARCHAR2(10); 
BEGIN
    --Retrieve identity of the IFS user for the given Directory ID
    SELECT IDENTITY INTO userId_ FROM IFSAPP.FND_USER WHERE web_user = UPPER(:username);
      
    IFSAPP.Fnd_Session_Util_API.Reset_Fnd_User_; 
    IFSAPP.Fnd_Session_Util_API.Impersonate_Fnd_User_(upper(userId_));  
END;
```

2. If the mapping between Flow users and IFS users is maintained in a custom table, view, or PL/SQL package, you can simply adjust the logic used to retrieve the IFS user accordingly.

```plsql
DECLARE  
    userId_ VARCHAR2(10); 
BEGIN
    --in this example the Flow user to IFS user mapping is kept on a custom table FLOW_IFS_MAPPING
    SELECT ifs_user INTO userId_ FROM IFSAPP.FLOW_IFS_MAPPING WHERE flow_user = UPPER(:username);
      
    IFSAPP.Fnd_Session_Util_API.Reset_Fnd_User_; 
    IFSAPP.Fnd_Session_Util_API.Impersonate_Fnd_User_(upper(userId_));  
END;
```

{% hint style="warning" %}
It’s important to note that if you perform user impersonation in the Initialization Command, you should also reset the session in the Cleanup Command to ensure the session context is cleared properly.

```plsql
BEGIN
    IFSAPP.Fnd_Session_Util_API.Reset_Fnd_User_; 
END;
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novacura.com/flow-connect/working-with-connect/connect-to-systems/connectors/oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
