Oracle Environment Configuration
To use Oracle in DBLink, you must install and configure Oracle Instant Client, set connection information, set Oracle Database environment variables, and set gateway.
Install Oracle Instant Client ODBC
Download ODBC Package and Basic Package from the Oracle Instant Client download site and extract them to the same directory.
Oracle Instant Client Download Site: https://www.oracle.com/database/technologies/instant-client/downloads.html
Oracle Instant Client Environment Variable Settings
Set connection information for connection to Oracle Database
In order to connect to Oracle Database, the tnsnames.ora file containing connection information must be modified.
Connection information should be written in these three items: HOST, PORT, and SERVICE_NAME in the basic format below.
For the tnsnames.ora file in which connection information is created, the directory path must be set in the TNS_ADMIN environment variable.
For how to set TNS_ADMIN, refer to “Setting TNS_ADMIN Environment Variable”.
Default format of the tnsnames.ora file
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521)
net_service_name: The name of the net service for database connection, and the name used for the db_name of the connection url.
HOST: IP address or server name to connect to the database.
PORT: Port required for connection. In most cases, the default port is 1521.
SERVICE_NAME: The name of the database to connect to.
For reference, no error occurs even if net_service_name is duplicated. However, since it may be connected to a different server than the intended one, net_service_name must be set so that it does not overlap.
Oracle Database Environment Variable Settings
The following environment variables must be set in the Oracle database server.
ORACLE_SID is the system identifier.
ORACLE_BASE is the Oracle base directory.
ORACLE_HOME is the path where the Oracle database is installed.
TNS_ADMIN environment variable setting
TNS_ADMIN points to the directory path where the tnsnames.ora file is located.
If there is a tnsnames.ora file in /home/user/myconfigs, you can settings it as follows.
Configuring cubrid_gataway.conf for Oracle
In order to connect to Oracle from the gateway, several settings are required as follows.
For details, refer to Gateway configuration file.
Because the gateway uses the information in tnsnames.ora to connect to oracle, it is not necessary to write CGW_LINK_SERVER_IP and CGW_LINK_SERVER_PORT. Even if the corresponding information is written, the gateway does not refer to it.
CGW_LINK_ODBC_DRIVER_NAME =Oracle 12c ODBC driver