Task 1: Set the Net Service Name for the Oracle Database in the tnsnames.ora File
In order to connect to the Oracle database, an Oracle net service name
needs to be added to the tnsnames.ora
file.
databasename_tp
databasename_low
You can either create a new timesten_home/conf/tnsnames.ora
file or copy the sample tnsnames.ora
file from the timesten_home/install/network/admin/samples/
directory to the timesten_home/conf
directory.
-
Ensure that the main daemon is stopped before you modify the
tnsnames.ora
file.ttDaemonAdmin -stop
-
Set the
TNS_ADMIN
location for the cache agent with thettInstanceModify -tnsadmin
option to set the path to thetnsnames.ora
file. In our example, thetimesten_home
variable points to/TimesTen
directory. Specify the full path to the directory where the file is located, which in this case is/TimesTen/conf
.ttInstanceModify -tnsadmin /TimesTen/conf
-
For cache in TimesTen Classic, set the
TNS_ADMIN
environment variable to indicate the full path to the directory where thetnsnames.ora
file is located. Set this variable in the user's profile script so that it persists.export TNS_ADMIN=/TimesTen/conf
-
Restart the main daemon to capture this setting.
ttDaemonAdmin -start
-
Within an editor, add the net service name for the non-autonomous Oracle Database to the
tnsnames.ora
file. The following is an example of definingorcl
in atnsnames.ora
file. Save this name as you will set this net service name in the DSN.orcl = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = myhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = myhost.example.com)))
For Autonomous Transaction Processing, the following is an example of defining
orcl_low
in atnsnames.ora
file:orcl_low = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = adb.us-phoenix-1.oraclecloud.com) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl_low.adb.oraclecloud.com)))
Note:
TimesTen supports both TCP and mTLS-based connections for Oracle Autonomous Database on Dedicated Exadata Infrastructure and only mTLS-based connections for Oracle Autonomous Database Serverless.