From: Mark D Powell <markp7832@my-deja.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: which database i am using?
Date: Tue, 12 Dec 2000 15:06:40 GMT
Organization: Deja.com - Before you buy.
Lines: 42
Message-ID: <915etq$fce$1@nnrp1.deja.com>
References: <915ck8$d9o$1@nnrp1.deja.com>
NNTP-Posting-Host: 199.228.142.8
X-Article-Creation-Date: Tue Dec 12 15:06:40 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 199.228.142.8
X-MyDeja-Info: XMYDJUIDmarkp7832


In article <915ck8$d9o$1@nnrp1.deja.com>,
  senthil <rsenthilkumar@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.

