# Configuring Oracle workspace data connections

In the workspace configuration, select **Oracle** as the connection type.

## Connecting to the source database <a href="#oracle-source-database-connection" id="oracle-source-database-connection"></a>

In the **Source Settings** section, provide the details about the source database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Service Name** field, provide the name of the service for the source database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
6. In the **Schema** field, provide the schema for the source database.
7. To use TCPS instead of TCP:
   1. Toggle **Enable TCPS** to the on position.
   2. Select the Oracle Wallet file to use.
8. To test the connection to the source database, click **Test Source Connection**.\
   \
   If the connection test is successful, then Structural also tests and reports on the connection speed.

## Indicating whether to use source database file preferences in the destination database <a href="#oracle-data-connection-destination-file-preferences" id="oracle-data-connection-destination-file-preferences"></a>

By default, the database file preferences such as tablespaces and filegroups for the destination database are configured and stored in the destination database.

To instead use database file preferences from the source database, toggle **Preserve source database disk storage preferences in destination database** to the on position.

## Connecting to the intermediate database for upsert <a href="#oracle-data-connection-intermediate" id="oracle-data-connection-intermediate"></a>

Oracle supports the upsert process. When you enable upsert for the workspace, the data generation process initially writes the transformed data to an intermediate database.

After the initial data generation is complete, the upsert job writes new records to the destination database, and updates existing records in the destination database. It does not touch any other records that are in the destination database.

In the **Upsert** section, when you enable upsert, you are prompted to [configure the upsert processing](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/workspace-config-upsert) and to provide the connection information for the intermediate database.

If the intermediate database is in the same location as the source database, then you can copy the connection and authentication details from the source database.

### Copying the connection and authentication details from the source database <a href="#oracle-data-connection-intermediate-copy-source" id="oracle-data-connection-intermediate-copy-source"></a>

To copy the connection and authentication details from the source database:

1. Click **Copy Settings from Source**.
2. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
3. To test the connection to the destination database, click **Test Intermediate Connection**.\
   \
   If the connection test is successful, then Structural also tests and reports on the connection speed.

### Providing the connection details <a href="#oracle-data-connection-intermediate-connection-details" id="oracle-data-connection-intermediate-connection-details"></a>

To provide the connection details for the intermediate database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Service Name** field, provide the name of the service for the source database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
6. In the **Schema** field, provide the schema for the source database.
7. To use TCPS instead of TCP:
   1. Toggle **Enable TCPS** to the on position.
   2. Select the Oracle Wallet file to use.
8. To test the connection to the intermediate database, click **Test Intermediate Connection**.\
   \
   If the connection test is successful, then Structural also tests and reports on the connection speed.

## Connecting to the destination database <a href="#oracle-destination-database-connection" id="oracle-destination-database-connection"></a>

In the **Destination Settings** section, provide the connection details for the destination database.

### Copying the connection details from the source database <a href="#oracle-data-connection-destination-copy-source" id="oracle-data-connection-destination-copy-source"></a>

To copy the connection details from the source database:

1. Click **Copy Settings from Source**.
2. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
3. To test the connection to the destination database, click **Test Destination Connection**.\
   \
   If the connection test is successful, then Structural also tests and reports on the connection speed.

### Providing destination database connection details <a href="#oracle-data-connection-destination-provide-details" id="oracle-data-connection-destination-provide-details"></a>

If you do not copy the source connection details, then to specify the connection information for the destination database:

1. In the **Server** field, provide the server where the database is located.\
   \
   Note that if you are using an Oracle Wallet, then this value must be a hostname. It cannot be an IP address.
2. In the **Service name** field, provide the name of the service for the destination database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
6. In the **Schema** field, provide the schema for the destination database.
7. To use TCPS instead of TCP:
   1. Toggle **Enable TCPS** to the on position.
   2. Select the Oracle Wallet file to use.
8. To test the connection to the destination database, click **Test Destination Connection**.\
   \
   If the connection test is successful, then Structural also tests and reports on the connection speed.

## How Tonic Structural uses the connection details to populate the connection string <a href="#oracle-connection-details-in-connection-string" id="oracle-connection-details-in-connection-string"></a>

When connecting to the source or destination database, Structural uses the connection details to populate the connection string as follows:

{% code overflow="wrap" %}

```
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<SERVER>)(PORT=<PORT>)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<SERVICE NAME>)))
```

{% endcode %}

Where:

* `<SERVER>` is the value from the **Server** field.
* `<PORT>` is the value from the **Port** field.
* `<SERVICE NAME>` is the value from the **Service name** field.
