> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Oracle DB

> Power internal tools, in-app experiences, and more

## Supported syncing

| Sync Type | Description | Supported Sync Modes |
| - | - | - |
| Any data set | Sync data from any source to an Oracle DB table | Upsert |

## Connect to Oracle DB

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination** button. Select **Oracle DB** and click **Continue**. If you're not using a [tunnel](#ssh-tunneling), you can then authenticate Hightouch to Oracle DB by entering the following fields:

* **Host**: The hostname or IP address of your Oracle server.
* **Port**: The port number of your Oracle server. The default port number is 1521, but yours may be different.
* **Database**: This specifies the database to use when Hightouch executes queries in Oracle DB. This is different than the host, but your host address might contain your database name.
* **Username**: The user that has access through Hightouch to the database and tables you want to sync to. It's best to [create a new user](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CREATE-USER.html) specifically for Hightouch access. *Do not use the root user.*
* **Password**: The password for the specified user.

To ensure your [credentials](#required-permissions) are correct, click **Test connection**. This confirms if Hightouch can connect to your database by running a basic `SELECT` query.

### Required permissions

The user you use to authenticate must have the following permissions:

* Add, update, and delete ([if applicable](#delete-behavior)) rows in your sync's table.
* Create tables in your database, which are kept only temporarily and used to perform `MERGE` operations. These tables are cleaned up at the end of each sync.
* View the following tables which are used for gathering metadata to set up the sync:
  * `USER_CONSTRAINTS`
  * `USER_CONS_COLUMNS`
  * `USER_CATALOG`
  * `USER_TAB_COLUMNS`

### SSH tunneling

Hightouch can connect directly to Oracle DB over the public internet or via an SSH tunnel. Since data is encrypted in transit via TLS, a direct connection is suitable for most use cases. You may need to set up a tunnel if your Oracle DB instance is on a private network or virtual private cloud (VPC).

Hightouch supports both standard and reverse SSH tunnels. To learn more about SSH tunneling, refer to Hightouch's [tunneling documentation](https://docs.hightouch.com/security/ssh-tunneling.md).

## Sync configuration

Once you've set up your Oracle DB destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and the Oracle DB destination you want to sync to.

Hightouch supports **Upsert** mode, with the option to [delete removed rows](#delete-behavior).

### Record matching

Hightouch requires you select a unique identifier in the table you are syncing to. The model column you select must match a `UNIQUE`, `PRIMARY KEY` column within Oracle DB.

You can see columns that fit this criteria as available options in records matching section.

![Sync configuration in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-oracle-id-mapping.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=a18c8a7a31b6d0d214853c37bbf787e1)

If there are no fields in the dropdown, you must add a unique type column to your Oracle DB table. Then, click the refresh icon to access the newly created column.

### Column types

Hightouch works out of the box with most standard column types, including:

* `VARCHAR2`
* `NUMBER`
* `TIMESTAMP`
* `DATE`
* `BINARY_FLOAT`
* `BINARY_DOUBLE`

If you see type errors, it may be because your model is producing the wrong format. If so, use [typecasting](https://docs.hightouch.com/models/data-types-casting.md) to resolve the issue.

### Field mapping

Select which model columns you want to sync to your Oracle DB table columns. Hightouch automatically pulls the columns from your table to make them available for you to map.

### Batch size

You can tune the number of rows that Hightouch upserts per query based on your needs and database threshold. The default is 1000 rows per batch.

### Delete behavior

The [delete behavior](https://docs.hightouch.com/syncs/overview.md#delete-behavior) you select dictates what to do when a row no longer appears in your model's query results. You have the following options:

| Behavior | Description |
| - | - |
| **Do nothing** | Keep the row in Oracle DB |
| **Delete row** | Remove the row from Oracle DB entirely |

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

### Compatible versions

The supported Oracle DB version is `19c`. Other versions aren't officially supported but may work regardless.

### Unsupported data types

Hightouch does not support `INTERVAL` types for Oracle.
