Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Santhosh.

Asked: April 13, 2018 - 9:11 am UTC

Last updated: April 15, 2018 - 3:45 am UTC

Version: 11g

Viewed 10K+ times! This question is

You Asked

Hi,

I would like to know IP Address of DB Server.
So i executed below Query found on Google.

SELECT A.HOST_NAME,A.INSTANCE_NAME,UTL_INADDR.GET_HOST_ADDRESS FROM V$INSTANCE A;

I got one IP Address but its not matching with the IP address in TNS?

So i would like to know why i got different IP Address and how to know IP address by SQL?

and Connor said...

A server does not need to have a single IP address, and once you get into things like the Clusterware there can be many IP addresses of interest.

You might have a scan listener, which has scan IP addresses, which are what people will see in their tnsnames.ora entries (via DNS resolution), and those may then map to individual listeners on each node in a RAC configuration, which can have virtual IP addresses (not the true physical ones).

You could query V$LISTENER_NETWORK to get the local listener details, which will give you the name of the host that the *local* listener is on, but that still is no guarantee that this is the IP address that you would see/use in a remote tnsnames.ora file.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database