Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get hostname in PL/SQL

Re: How to get hostname in PL/SQL

From: Jarek Palka <jarek_at_kamsoft.com.pl>
Date: Fri, 05 Jan 2001 09:14:26 +0100
Message-ID: <3A558262.23C85BA5@kamsoft.com.pl>

Gennady wrote:
> Try this:
> SELECT HOST_NAME FROM v$instance;

  This is SERVER hostname, not client.

> Olivier Bercovitz wrote in message <9308ok$qeq$1_at_front5.grolier.fr>...
> >Is there a way to know the hostname (or the IP adress) in a PL/SQL

  If you want client hostname for current session use this :

  SELECT machine,terminal FROM v$session   WHERE audsid=userenv('SESSIONID')

  Machine is full name with domain (ie. WORK\TEST_COMPUTER), TERMINAL is 8-characters width computer name (ie. TEST_COM).

  You can use CLIENT_INFO field in V$SESSION to fill it with client IP address for current session.

-- 
____________________________________________________________
Jaroslaw Palka <jarek_at_kamsoft.com.pl> P.I.KAMSOFT, Katowice
tel. (+48 32) 209-07-05, fax 209-07-15    POLAND
Received on Fri Jan 05 2001 - 02:14:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US