dbTalk Databases Forums  

getting server name and db name

comp.databases.oracle comp.databases.oracle


Discuss getting server name and db name in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Richard Gjerde
 
Posts: n/a

Default getting server name and db name - 07-23-2004 , 07:20 AM






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



Reply With Quote
  #2  
Old   
Soeren Degn Jahns
 
Posts: n/a

Default Re: getting server name and db name - 07-23-2004 , 08:08 AM






Quote:
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




Reply With Quote
  #3  
Old   
Richard Gjerde
 
Posts: n/a

Default not quite enough? - 07-23-2004 , 08:57 AM



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" <nospam (AT) nospam (DOT) dk> wrote

Quote:
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





Reply With Quote
  #4  
Old   
Soeren Degn Jahns
 
Posts: n/a

Default Re: not quite enough? - 07-23-2004 , 02:21 PM



Quote:
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





Reply With Quote
  #5  
Old   
Mark D Powell
 
Posts: n/a

Default Re: getting server name and db name - 07-23-2004 , 07:13 PM



"Soeren Degn Jahns" <nospam (AT) nospam (DOT) dk> wrote

Quote:
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 --


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.