470,815 Members | 1,051 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

getting server name and db name

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?

Regards,
Richard
Jul 19 '05 #1
4 86574
> 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
Jul 19 '05 #2
Thanks, Soeren. I found the last link helpful, but I don't see that the
first one really tells you how to obtain the name of the server?

"Soeren Degn Jahns" <no****@nospam.dk> wrote in message
news:A5********************@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

Jul 19 '05 #3
> Thanks, Soeren. I found the last link helpful, but I don't see that the
first one really tells you how to obtain the name of the server?


Hi Richard. Yeah, you're right. I was a bit too fast there, sorry. Would,
what you are looking for, be the global_name then:
SELECT global_name FROM global_name ;

This would be equivialent to:
SELECT ora_database_name FROM dual;

Hope this helps?

// Soeren

Jul 19 '05 #4
"Soeren Degn Jahns" <no****@nospam.dk> wrote in message news:<A5********************@news000.worldonline.d k>...
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 --
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by David Bear | last post: by
15 posts views Thread by middletree | last post: by
2 posts views Thread by asad | last post: by
3 posts views Thread by Adam Tibi | last post: by
4 posts views Thread by Richard Gjerde | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.