Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Is the database server on the local machine?
<rs_arwar_at_hotmail.com> wrote in message
news:1101982692.106489.36970_at_f14g2000cwb.googlegroups.com...
| SYS_CONTEXT and V$SESSION as mentioned in the other posts will give
| you information about the client PC that is connected to the database.
| If you want the database server (where the database is running)
| IP/Hostname then you can call
| select UTL_INADDR.Get_Host_Name from dual;
| or
| select UTL_INADDR.Get_Host_Address from dual;
| I believe this is only available in 8i and above.
|
| Regards
| /Rauf
|
works as well as the other suggestions, which also both worked
v$session gives client and server machine information depending on the session -- the post regarding that suggested getting the machine for SID 1, which is one of the server background process
sys_context('USERENV','HOST') also provides the DBMS server machine name -- returns the same value as "select UTL_INADDR.Get_Host_Name from dual"; tested on my 8.1.7 laptop and on 10g at htmldb.oracle.com
additionally, SELECT HOSTNAME FROM V$INSTANCE gives the DBMS server machine name
++mcs Received on Thu Dec 02 2004 - 05:51:33 CST