Using the tnsnames Naming Method to Connect
TimesTen supports tnsnames
syntax. You can use a TimesTen tnsnames.ora
entry in the same way you would use an Oracle tnsnames.ora
entry.
The syntax of a TimesTen entry in the tnsnames.ora
file is as follows:
tns_entry = (DESCRIPTION =
(CONNECT_DATA =
(SERVICE_NAME = dsn)
(SERVER = timesten_client)))
Where tns_entry
is an arbitrary TNS name you assign to the entry. Note the following:
-
DESCRIPTION
andCONNECT_DATA
are required as shown. -
For
SERVICE_NAME
,dsn
must be a TimesTen data source name (DSN) that is defined in the ODBC Data Source Administrator and is visible to the user running the ODP.NET application. -
For
SERVER
,timesten_client
specifies a client/server connection. TheSERVICE_NAME dsn
value must be a TimesTen client DSN.
The following is a sample tnsnames.ora
entry for a direct connection to the TimesTen database referenced by the DSN my_client_dsn
:
my_tnsname = (DESCRIPTION =
(CONNECT_DATA =
(SERVICE_NAME = my_client_dsn)
(SERVER = timesten_client)))
To connect as user scott
with password tiger
to the my_client_dsn
TimesTen database that is referenced by the my_tnsname
entry in the tnsnames.ora
file, specify the following connection string in your ODP.NET application:
"User Id=scott;Password=tiger;Data Source=my_tnsname"
To connect as the current operating system user to my_client_dsn
that is referenced by the my_tnsname
entry in the tnsnames.ora
file, specify the following connection string in your ODP.NET application. The current operating system user must be either the TimesTen instance administrator or a defined TimesTen external user.
"User Id=/;Data Source=my_tnsname"
Note:
For TimesTen Classic, you can use the ttInstanceCreate
-tnsadmin
option or the ttInstanceModify
-tnsadmin
option (in addition to the TNS_ADMIN
environment variable) to set the tnsnames
location.