Re: Sqlprompt and Oracle Sid

From: David Stark <stark_at_greenwich.com>
Date: 1996/04/22
Message-ID: <1996Apr22.200734.1251_at_greenwich.com>#1/1


In article <dewing.61.000E2FAF_at_gasou.edu> dewing_at_gasou.edu (David Ewing) writes:
>I would like to set the sqlprompt to reflect the
>oracle sid if possible. For example, if a dba
>was in PROD, the sqlprompt might be
>something like SQL(PROD)>. How do you
>pass the oracle sid to the set sqlprompt in
>sql? I would like to put this in the overall
>login.sql script.
>
>Oracle 7.1.4 AIX 3.2.5 Rs6000-59H

include the following in your glogin.sql


	column usid noprint new_value usid
	select name||':SQL>  ' usid from v$database;
	set sqlprompt &usid

***************************************************************************


you then need to run the following grant as sys to allow all users to read from the v$database view.


grant select on v_$database to public;


 

this will produce the sqlprompt $ORACLE_SID:SQL>.

-- 
David Stark          	  * Opinions expressed in this post are those of
stark_at_greenwich.com 	  * the author and do not in any way represent
Greenwich Associates      * an official statement by Greenwich Associates.
Greenwich CT  06831-5195  *
Received on Mon Apr 22 1996 - 00:00:00 CEST

Original text of this message