Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Get IP address Or computer Name in ODBC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-03, 05:10
kennypoon kennypoon is offline
Registered User
 
Join Date: Mar 2002
Posts: 25
Question Get IP address Or computer Name in ODBC

How can I retrive the IP address or Computer Name of the Database Server in the ODBC DSN Connection. If I add an ODBC DSN Connection, it need me to input the DSN, Server name, and user name. But the Server name is just some alias, it may not be the computer name. So how can i do?

Reply With Quote
  #2 (permalink)  
Old 02-12-03, 05:17
pal19 pal19 is offline
Registered User
 
Join Date: Feb 2003
Location: @ home
Posts: 163
Re: Get IP address Or computer Name in ODBC

Have you already tried to indicate only the IP address?
ex: \\<ip address>

______________
Paulo Gonçalves
Reply With Quote
  #3 (permalink)  
Old 02-12-03, 05:19
kennypoon kennypoon is offline
Registered User
 
Join Date: Mar 2002
Posts: 25
Because I don't know what's the actual IP address of that Database Server? I just know the Server name specified in the ODBC.
Reply With Quote
  #4 (permalink)  
Old 02-12-03, 06:12
pal19 pal19 is offline
Registered User
 
Join Date: Feb 2003
Location: @ home
Posts: 163
can you ping the server in order to resolv the ip address?

ex:
ping <servername>
Reply With Quote
  #5 (permalink)  
Old 02-12-03, 08:15
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 3,641
or nslookup
to know th ipaddress ...

Best is to contact your network team to know the ip address .. They will be able to provide you more details as to whether it is a static ip address or DHCP is used etc.


Cheers

Sathyaram

Quote:
Originally posted by pal19
can you ping the server in order to resolv the ip address?

ex:
ping <servername>
Reply With Quote
  #6 (permalink)  
Old 02-12-03, 10:25
kennypoon kennypoon is offline
Registered User
 
Join Date: Mar 2002
Posts: 25
My problem is my program is I need connect different database server in different sites. I need to know the IP address or computer name of the database server thorugh the ODBC connection. As the server name in the ODBC connection can be alias, it is not the computer name, so I can not ping the computer name, and then resolve the IP address. So how can I do if the ODBC connection used the alias to be the server name.
Reply With Quote
  #7 (permalink)  
Old 02-12-03, 11:10
remivisser remivisser is offline
Registered User
 
Join Date: Dec 2002
Location: Netherlands
Posts: 118
Hi

Whenever you have got an ODBC connection set up you can write a procedure or do a simple select host_name from v$instance;

This will return the hostname (not the ipaddress).

This will off course require a connection, but you mentioned " thorugh the ODBC connection" so that should not be a problem.

Good luck!

Remi
__________________
Remi Visser

Oracle Database Administrator
(OCP certified 8i)

Homepage: http://home.remidian.com/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On