Re: getting server name and db name
Date: 23 Jul 2004 17:13:19 -0700
Message-ID: <2687bb95.0407231613.3858eb15_at_posting.google.com>
"Soeren Degn Jahns" <nospam_at_nospam.dk> wrote in message news:<A58Mc.27059$Vf.1476075_at_news000.worldonline.dk>...
> > This is probably a very elementary question. I would like to have an sql
> > which returns the name of the Oracle server and the current database.
> Could
> > anybody help me out?
>
> Server name etc.:
> http://www.orafaq.com/scripts/sql/ver.txt
>
> Current database.:
> http://www.orafaq.com/scripts/sql/whoami.txt
>
>
> // Soeren
Richard, you can find the database name in v$database while the machine name for both the front-end and Oracle session background processes can be found in v$session. The dynamic performance views, v$..., are documented in the Oracle version# Reference Manual.
The sys_context function is a handy source of information about the current session including Oracle username, Os user, Proxy user, IP address, .... See the SQL Manual.
HTH -- Mark D Powell -- Received on Sat Jul 24 2004 - 02:13:19 CEST