Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Session Ip Address
> Michel Cadot wrote:
> > select sid, machine, utl_inaddr.get_host_address(machine) ip
didn't know about UTL_INADDR -- much easier!
DA Morgan wrote:
> Unfortunately, on Windows machines you are likely to see this:
> ERROR at line 1:
> ORA-29257: host WORKGROUP\PERRITO2 unknown
A simple extension to Michel's query (which does the tricky part) will snip the windows domain/workgroup and try just the host name part;
select sid, machine,
utl_inaddr.get_host_address( decode(instr(machine, '\'), 0, machine, substr(machine, instr(machine, '\'))) ) AS ip
of course there is no guarantee that the Windows machine name is also registered in DNS, but this is the case case at most of my installations.
FYI if the session table is really big these host name resolutions can start to take a really LONG time as they are contacting an external networked service ...
HTH,
JH
Received on Thu Jan 04 2007 - 11:15:29 CST
![]() |
![]() |