Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: IP of the current instance/DB
robert <rchin_at_nietspampanix.com> wrote in message news:<cnljup$ifu$1_at_reader1.panix.com>...
> Sybrand Bakker wrote:
> >
> > You read the manual under SYS_CONTEXT
> > and/or check out the v$instance view.
> > I'm not sure why you want to know this, in a well-configured
> > environment you definitely don't have instances and databases with
> > identical names living of different hosts. I have the strange feeling
> > your situation doesn't adhere to that standard.
>
> no, no instance + DB all on one box, just being anal when it come to
> references to "instance" and "database".
>
> SYS_CONTEXT('USERENV','IP_ADDRESS') --> Client IP
> v$instance --> Just host name
select utl_inaddr.get_host_address -- (IP Address) from dual;
select utl_inaddr.get_host_name -- (Host name) from dual;
Note: For this function call to work in 8.1.7.x, you need to have ORACLE_HOME/plsql/jlib/plsql.jar installed in the database.
Regards
/Rauf
Received on Sat Nov 20 2004 - 17:27:03 CST