Re: How to find SID?
Date: 1996/07/17
Message-ID: <31ED553C.167EB0E7_at_sugarland.unocal.com>#1/1
Chuck Hamilton wrote:
>
> Che <cdiggens_at_banda.NTU.EDU.AU> wrote:
>
> >How can you find the oracle database you are connected to once you are
> >connected? I've got the userid but need to the database to later perform
> >an OP$ login back into oracle.
> > - Che
> >
>
> SELECT * FROM v$database;
> --
> Chuck Hamilton
> chuckh_at_dvol.com
>
> Never share a foxhole with anyone braver than yourself!
There is a way to always know which database your connected to by inserting the following lines to the glogin.sql file located in the $ORACLE_HOME/sqlplus/admin directory:
column sid new_value osid noprint
set termout off
select upper(substr(global_name,1,(instr(global_name,'.')-1))) sid
from global_name;
set termout on
set sqlprompt'&osid> '
This will make your sqlplus prompt look like this:
"YOUR SID"> Example: