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

Home -> Community -> Usenet -> c.d.o.server -> Re: which database i am using?

Re: which database i am using?

From: David Fitzjarrell <oratune_at_aol.com>
Date: Tue, 12 Dec 2000 15:25:50 GMT
Message-ID: <915g1k$gf7$1@nnrp1.deja.com>

In our last gripping episode denevge_at_my-deja.com wrote:
> If global_name has been set :
>
> select global_name from global_name
>
> Hope this helps
> Gert
>
> In article <915etq$fce$1_at_nnrp1.deja.com>,
> Mark D Powell <markp7832_at_my-deja.com> wrote:
> > In article <915ck8$d9o$1_at_nnrp1.deja.com>,
> > senthil <rsenthilkumar_at_my-deja.com> wrote:
> > > hi,
> > >
> > > i am an user without dba priveleges and would like to query a
> > > table/view that gives the database name. anybody knows the
 table/view
> > > name???
> > >
> > > thanks,
> > > senthil.
> > >
> > The only tables/views I can think of that provide the database and
> > instance name are all v$ views which require special privilege to
> > select against. The DBA can grant anyone select on these views
 using
> > the sys id, and probably would be willing to do this for a limited
> > number of them. Also the Oracle provided role select_catalog_role
 and
> > select any table privilege will provide access to these views.
> >
> > The views of interest are v$database and v$instance.
> >
> > From UNIX you can do a ps -ef | grep pmon to see the Oracle
 databases
> > that are up and running on a box.
> >
> > You can do a print $TWO_TASK to see the Oracle Net default connect
> > string Net8 alias. (Print is ksh use echo for borne shell)
> >
> > Also you can print the $ORACLE_SID to see the default instance, but
 the
> > TWO_TASK parameter, if set, overrides the SID.
> >
> > If the DBA does not wish to grant the roles, privileges, or
 individual
> > access mentioned above (and there are legitimate reasons not to give
> > access to these views) then ask him if he would create a procedure
 you
> > could call that gives this information. Many sites have such a
 routine
> > to give this type of information.
> >
> > --
> > Mark D. Powell -- The only advice that counts is the advice that
> > you follow so follow your own advice --
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

That will provide the global TNS name for the instance, which may not be the instance name.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Dec 12 2000 - 09:25:50 CST

Original text of this message

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