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: Mark D Powell <markp7832_at_my-deja.com>
Date: Tue, 12 Dec 2000 15:06:40 GMT
Message-ID: <915etq$fce$1@nnrp1.deja.com>

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.
Received on Tue Dec 12 2000 - 09:06:40 CST

Original text of this message

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