Something really kool that Oracle provides is the Oracle Instant Client on the Oracle.com download page (we mention this later in the OCI programming section). Optionally you can also download and install a SQL*Plus client to go with it. Whats so kool is that you can use SQL*Plus on a client without installing the full Oracle Client (300MB+ install). I've installed both of these packages on my Linux workstation and put the tnsnames.ora file listed in the last section in my home directory as a test (note, this is not the same machine the database is on):
[benr@nexus benr]$ vi .tnsnames.ora [benr@nexus benr]$ sqlplus ben/passwd@testdb SQL*Plus: Release 10.1.0.2.0 - Production on Mon Oct 11 14:37:46 2004 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 With the Partitioning, OLAP and Data Mining options SQL> select count(*) from sys_log_tbl; COUNT(*) ---------- 903 SQL> quit [benr@nexus benr]$
If you had a full client installed you would need to make sure your $ORACLE_HOME was set before starting SQL*Plus but it'd work the same way. As mentioned before, $HOME/.tnsnames.ora is just one of several places you can put it. Something to be aware of is that if the client can find a sqlnet.ora, it won't look for the tnsnames.ora file!
For more details on net services, please check out the Oracle Database Net Services Administrator's Guide: