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: SID on sqlplus prompt?

RE: SID on sqlplus prompt?

From: Burton, Laura L. <BurtonL_at_prismplus.com>
Date: Mon, 11 Jun 2001 12:26:23 -0700
Message-ID: <F001.0032473E.20010611120623@fatcity.com>

I use this as well but it only works going through Sqlplus.  If you want to change connections while you are in sqlplus by entering sql> Connect username_at_dbname, then the sid/username will not change on the sql> prompt.  To make the connection change show, add a member in the Bin directory called Connect.sql and add the following code:

connect &1

set termout off pause off arraysize 1
rem
rem Store username
rem
col user_id   new_value user_id
col user_name new_value user_name
select user_id, lower(username) user_name from user_users
   where username = user;

rem
rem Store database name
rem
col db_name new_value db_name
select lower(substr(global_name,1,(instr(global_name,'.',1,1)-1)))
   db_name from global_name;

set sqlprompt "&db_name:&user_name> "

Then in sqlplus enter sql> @Connect username_at_dbname and the sid/username should change to the new connection.  The glogin and connect members are very helpful when wanting to see what database you are connected too.  They originated from someone on this list, but I don't remember who. 

Laura

-----Original Message-----
From: Gene Sais [mailto:Gsais_at_co.palm-beach.fl.us] Sent: Friday, June 08, 2001 5:36 PM
To: Multiple recipients of list ORACLE-L Subject: Re: SID on sqlplus prompt?

I use this: glogin.sql file found in $OH/sqlplus/admin on the db server.  hth.

gene

<snip> Received on Mon Jun 11 2001 - 14:26:23 CDT

Original text of this message

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