Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL/SID question
if you are on a unix platform, you could also use "!" to run a unix command from sqlplus, such as "!set | grep ORACLE_SID"
John P. Higgins wrote:
>
> Why not try this:
>
> select instance from v$thread;
>
> It works on my 7.2 system. I don't know if it would return multiple rows
> on OPS.
>
> Michael Abbey wrote:
> >
> > Haresh Assumal wrote:
> > >
> > > How do I find what my current SID is when I'm in SQLplus?
> > > -Haresh
> >
> > There is no way to find the ORACLE_SID from the data dictionary. Most
> > DBAs name their database the same as the ORACLE_SID for just that
> > reason. Relying on V$DATABASE only works if one has ensured the name and
> > the SID are the same.
> >
> > Michael
> >
> > +---------------------------------------------
> > + Michael Abbey Author of 5 works in the
> > + Ottawa Canada Oracle Press Series
> > +---------------------------------------------
>
> --
> John P. Higgins Voice: (309)765-7868
> Deere & Company Fax: (309)765-7800
> John Deere Road Internet: jh33378nospam_at_deere.com
> Moline, IL 61265 Opinions: My Own
Received on Mon Oct 06 1997 - 00:00:00 CDT