Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to get database server IP address?

WestDraytonJun 1 2011 — edited Jun 1 2011
I have Php backend website, where i have a text area to run sql queries against underlying Oracle 10g/solaris database.
I have ca 10 such Backend web sites, and 10 underlying Oracle databases for each website. Each Backend website lives different computer than Backend Php webserver.
I have problems to understand what is the database IP of the Backend website.
Can i query it?

My example wrong queries:
I know that underlying database in this example is with IP "192.168.2.165", but i canät manage to query that out, see:
This is not the database IP:

select UTL_INADDR.GET_HOST_ADDRESS from dual--127.0.0.1 

This is some mysterical computer name that i cant ping:

select UTL_INADDR.GET_HOST_NAME from dual;--tar_071_z

This is wrong IP:
select UTL_INADDR.GET_HOST_ADDRESS('tar_071_z') from dual;--127.0.0.1

Wrong:
select UTL_INADDR.GET_HOST_ADDRESS( UTL_INADDR.GET_HOST_NAME ) from dual;--127.0.0.1

I don't know what IP is that:

select sys_context('USERENV','IP_ADDRESS') from dual;--192.168.2.160 

My php-website i run queries in this example:

C:\Users\charlesr>ping myphpbackend.com

Pinging admin.live.casino.playtech.com [192.168.2.160] with 32 bytes of data:
Reply from 192.168.2.160: bytes=32 time=17ms TTL=252
Reply from 192.168.2.160: bytes=32 time=9ms TTL=252
Reply from 192.168.2.160: bytes=32 time=6ms TTL=252
Reply from 192.168.2.160: bytes=32 time=7ms TTL=252

Ping statistics for 192.168.2.160:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 6ms, Maximum = 17ms, Average = 9ms

C:\Users\charlesr>

---

C:\Users\charlesr>ping tar_071_z
Ping request could not find host tar_071_z. Please check the name and try again.

---

If i type Into my Windows 7 File Explorer address "\\tar_071_z" then it says it doesn't find the computer.

---


C:\Users\charlesr>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : videobet.corp
   Link-local IPv6 Address . . . . . : fe80::702d:f154:fb5e:5c20%11
   IPv4 Address. . . . . . . . . . . : 192.168.15.105
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.15.1

Tunnel adapter isatap.videobet.corp:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : videobet.corp

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Users\charlesr>
Edited by: CharlesRoos on 1.06.2011 10:59
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2011
Added on Jun 1 2011
2 comments
15,165 views