Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to retrieve the Connect String in UNIX script?
> If I want to remove the hard-code of the logon information, would you
> mind to share your experience how to handle this change? How to set
> up the UNIX User environment based on the job so that the script can
retrieve the Connect String
> easily?
Set TWO_TASK environment variable in Unix to required connect string (LOCAL in Windows). That way your client connects to connect string specified in env variable if you don't ask for an excplicit string.
Also, in your scripts you can check the connect string using sqlplus "_connect_identifier" variable or query v$instance...
SQL> select host_name, instance_name, '&_connect_identifier' conn, user from
v$instance;
old 1: select host_name, instance_name, '&_connect_identifier' conn, user
from v$instance
new 1: select host_name, instance_name, 'test.world' conn, user from
v$instance
HOST_NAME INSTANCE_NAME CONN USER
---------- ---------------- ---------- ---------- PORGAND test test.world ADMIN
Tanel.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Sun Aug 15 2004 - 03:42:40 CDT
![]() |
![]() |