I'm a newbie to using Oracle. I wanted to connect two database servers using Oracle 9i (running on Windows XP) with two different host strings. Can you give me a clue as to how to do it?
You need to configure your TNSNAMES.ORA file to point to each of your Oracle instances you want to connect to. This file is typically in your ORACLE_HOME/network/admin directory. For each database that you want to connect to, add an entry similar to the following:
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1526)) ) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )
You'll need to change your host, port, and service name (ORACLE_SID) to match the database that you want to connect to. This TNS alias is identified by the first line. Typically, the TNS alias is the same as the SERVICE_NAME, but that is not a hard and fast rule, especially if you want to connect to two databases that have the same ORACLE_SID. The TNS alias only has meaning to you.
So let's assume that you have created the TNS alias above. To connect to this database, fire up SQL*Plus as follows:
sqlplus /nolog connect scott/tiger@orcl
The "@orcl" tells SQL*Plus to connect to the database identified by that TNS alias. To connect to a different database, use a different TNS alias.