Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get hostname in PL/SQL
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 POLANDReceived on Fri Jan 05 2001 - 02:14:26 CST
![]() |
![]() |