Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to retrieve the Connect String in UNIX script?

Re: How to retrieve the Connect String in UNIX script?

From: Tanel Põder <tanel.poder.003_at_mail.ee>
Date: Sun, 15 Aug 2004 11:46:52 +0300
Message-ID: <087d01c482a4$6be1bce0$71849fd9@porgand>


> 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.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US