Home » SQL & PL/SQL » SQL & PL/SQL » IP of Oracle server (9i)
IP of Oracle server [message #318292] Tue, 06 May 2008 07:03 Go to next message
me_arindam
Messages: 26
Registered: March 2008
Location: India
Junior Member
Hi,

Please let me know is there any way to know the IP address of the Oracle database server?

I am using client and I dont have access to the tnsname.ora file.

How can I get to know the IP of the server?

SYSCONTEXT gives the client IP. I need the server IP.

Thanks,
Arindam
Re: IP of Oracle server [message #318297 is a reply to message #318292] Tue, 06 May 2008 07:23 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Don't know about 9i, but in 10g you can use:

sys_context('userenv','server_host') server_host,

Which, along with ping, might help.

You can also check your local tnsnames file.

Or you can ask your DBA.
Re: IP of Oracle server [message #318298 is a reply to message #318292] Tue, 06 May 2008 07:24 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
One way would be use UTL_INADDR to get the IP of the machine where the background processes are running on:

SELECT DISTINCT UTL_INADDR.get_host_address(machine) 
  FROM V$SESSION 
 WHERE TYPE='BACKGROUND';
Re: IP of Oracle server [message #318302 is a reply to message #318292] Tue, 06 May 2008 07:41 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Can't you use server name instead? If this is a clustered environment, good chance that IP address will change when there is a failover.
Re: IP of Oracle server [message #318498 is a reply to message #318298] Wed, 07 May 2008 00:58 Go to previous message
me_arindam
Messages: 26
Registered: March 2008
Location: India
Junior Member
Thanks Thomas... It really helps me........ Thanks a lot..
Previous Topic: Unique Constraint size limit
Next Topic: Prolem in executing the code.
Goto Forum:
  


Current Time: Tue Dec 03 21:26:58 CST 2024