The following are sample entries of tnsnames.ora file.
here there are two databases, both named high9i. one is remote and one is local
configure the connect string as different.
eg:
for remote database= high9i
for localdatabase = local
HIGH9I =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.27)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = high9i)
)
)
LOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = high9i)
)
)
SQL> connect scott/tiger@high9i
Connected.
SQL> connect scott/tiger@local
Connected.
SQL>