Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: running instantclient sqlplus without tnsnames.ora file?
Mark Harrison wrote:
> newbie alert, apologies in advance...
>
> I have a connection string that looks like this:
> //oracle-rac-1:1521/racdb.pixar.com
>
> Is there a way to use this string with sqlplus, instead of using
> the tns name? I want to run some things on a large rendering
> cluster and it would be nice if I didn't have to prep the
> machines with tnsnames.ora, set the environment, etc.
Unsure if that specific string can be used for an OCI connections. You can however use the TNS string directly with SQL*Plus (or any OCI connection), instead of defining an alias for it (in TNSNAMES) and then refering to the alias.
E.g
/home/billy> tnsping dev
TNS Ping Utility for Linux: Version 9.2.0.5.0 - Production on 09-SEP-2005 08:54:42 Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/vilk/app/products/oracle/9.2.0/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
(PROTOCOL=TCP)(HOST=xxxxxxxxxx)(PORT=1521))) (CONNECT_DATA = (SID=dev)
(SERVER=shared)))
OK (10 msec)
/home/billy> sqlplus
billy@"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxx)(PORT=1521)))(CONNECT_DATA=(SID=dev)(SERVER=shared)))"
SQL*Plus: Release 9.2.0.5.0 - Production on Fri Sep 9 08:54:46 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter password:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning and Oracle Label Security options
JServer Release 9.2.0.4.0 - Production
PL/SQL procedure successfully completed.
SQL>
-- BillyReceived on Fri Sep 09 2005 - 01:57:35 CDT