Re: get other session's ip

From: Mark D Powell <>
Date: Sat, 1 Aug 2009 07:03:16 -0700 (PDT)
Message-ID: <>

On Aug 1, 4:25 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "kevin" <> a écrit dans le message de news:
> |I can get my current session's ip with 'select sys_context
> | ('USERENV','IP_ADDRESS') FROM DUAL; '. How can I get other session's
> | ip?
> select sid, machine, utl_inaddr.get_host_address(machine) ip
> from v$session
> where type='USER' and username is not null
> /
> Regards
> Michel

On my systems the above query sometimes results in an ORA-29257 on INACTIVE sessions. I believe that the front-end client is no longer connected. Some filtering may be necessary if you are not seeking the information for a specific active session.

Also on some platforms you may need to filter out a leading domain name:
utl_inaddr.get_host_address(substr(machine,instr(machine,'\')+1)) ip

HTH -- Mark D Powell -- Received on Sat Aug 01 2009 - 09:03:16 CDT

Original text of this message