| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: getting server name and db name
"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 Fri Jul 23 2004 - 19:13:19 CDT
![]() |
![]() |