Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2002
    Posts
    25

    Question Unanswered: 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?


  2. #2
    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

  3. #3
    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.

  4. #4
    Join Date
    Feb 2003
    Location
    @ home
    Posts
    163
    can you ping the server in order to resolv the ip address?

    ex:
    ping <servername>

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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

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

    ex:
    ping <servername>

  6. #6
    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.

  7. #7
    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/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •