473,499 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 87008
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1956
by: Gmanuel | last post by:
I want from VBA, be able to read what the host name of a text file is. For example, if the file passed to the function is on a particular server, I want to retrieve the name of the server it...
5
1697
by: David Bear | last post by:
Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? alist = range(10) def afunction(list): listName = list.__name__ (fails for a list object)
15
2103
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
3
7056
by: Jack-2 | last post by:
Hi! Three days ago I wrote in this group for ask help in the use of "GetDetailsOf". I want show the name of a file without the extension, and for this, a member of this group suggestion me that...
2
1373
by: asad | last post by:
Hello friends, i need some help in getting uploaded file name, i am uploading 2 files and i want to get only the filename of these 2 file not a full path so pls tell me which function or technique...
5
2043
by: Ron L | last post by:
I have an application I am developing which is using remoting to have a smart client connect to a remote database via IIS. There are certain functions that we only want the user to be able to...
1
3027
by: Jacand4321 | last post by:
I'm trying to audit all the database activities using Server-side trace in SQL Server 2000. Basically I need to get the login information (login Id, Login time etc) along with the name of the...
3
1734
by: Adam Tibi | last post by:
Hi, Is there a way of getting the domain name of tghe currently executing site, I tried using this silly code: public static string GetDomainName() { string serverName =...
4
610
by: Richard Gjerde | last post by:
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
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.