❖ Oracle
This page describes how to integrate with your Oracle database.
Supported database variants: Oracle Database 23ai, 21c, 19c, 18c, 12c, and 11gR2.
❖ SDV Enterprise Bundle. This feature is available as part of the AI Connectors Bundle, an optional add-on to SDV Enterprise. For more information, please visit the AI Connectors Bundle page.
Installation
To use this feature, please make sure you have installed the bundle with the optional db-oracle dependency. For more information, see the SDV Enterprise Installation docs.
pip install sdv-installer --upgrade
sdv-installer install --package bundle-ai-connectors --options db-oracleConnector
Use this connector to create a connection to your Oracle database.
from sdv.io.database import OracleConnector
connector = OracleConnector()Parameters (None)
Output A connector object that you can use to import data and metadata
Config File
Create a YAML file that corresponds to the database to connect to. You will need separate config files for your source dataset (for importing training data) and a destination dataset (for exporting synthetic data).
The config file has the following structure:
Parameters:
connection: This section defines the database tables you want to connect to. It is common to all traditional, self-managed databases that are not managed by a Cloud vendor.
(required)
host: The network address of the system running the database service. Based on your db setup, this can be a hostname (eg. db.example.com) or an IP address (eg. 10.0.0.1)(required)
port: The network endpoint on the host where the database service listens for client connections. This is a numeric identifier but please provide it as a string.(required)
database_name: A top-level logical container for data and database objects within a database system.(required)
schema_name: A named logical grouping of database objects within a database, used for organization and access control.
auth: This section provides information about your identity, which is required to connect to the database. It is common to all traditional, self-managed databases that are not managed by a Cloud vendor.
(required)
username: The identifier of who is authenticating the connection.(required)
password: A secret credential associated with the username, used to verify its identity during authentication
runtime: This section contains other parameters that come into play during runtime, either when establishing the connection or running additional queries. It is common to all traditional, self-managed databases that are not managed by a Cloud vendor.
connection_timeout: The maximum amount of time a client will wait while attempting to establish a connection to the database before stopping the attempt. This applies when first establishing the connection, not for any subsequent queries or timeouts.(default) Driver and environment dependent, typically between ~10-30 seconds, but potentially unbounded.
Oracle terminology may be different from the above parameters names, which are generic for databases.
Oracle typically refers to the
database_nameas theservice_name. This is the same concept.Oracle typically refers to the
hostasserver. This is the same concept.If you have not set up a
schema_nameexplicitly, use the one that Oracle assigns by default. This is usually your username.
Setting Your Config File
Use the set_import_config and set_export_config functions to add your config YAML file to your connector.
Use the connector to create metadata, import a subset of training data, and export synthetic data. For more information, see the Usage API.
FAQ
Which permissions are needed for importing and exporting?
Importing data requires read access. For importing data, you'll need access for running the following commands: CREATE SESSION, SELECT, and SELECT ON SYS.DBA_USERS.
Exporting data requires write access. For exporting data, you'll need the same access as importing plus access for following commands: INSERT ANY, ALTER ANY, DROP ANY, and RESOURCE.
For more information, see the Oracle SQL reference guide.
Last updated