-
How to find IP Address of Clients
Hi,
I am useing oracle 8i on sun solaris and clients are of windows
when quering v$session it gives many details but does not gives the IP_Address of the clients.
How to get the IP_Address of the clients.
Regards
Arun Tayal
-
Hi
SELECT sys_context('USERENV', 'OS_USER') FROM dual;
If the client uses a middle tier then the ip address of the middle tier is returned.
regards
Hrishy
-
Hi,
SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') "My IP Address" from dual;
For more details refer to Metalink Note: 120797.1
Regards.
Anyone can hold the helm when the sea is calm.
-
TRY THIS. IT WILL GIVE YOU THE ENTIRE LIST OF IP'S FOR ALL LOGONS
select AU.userid ,
substr(AU.comment$text, 68,21) as "Host / IP_ADDRESS"
from sys.aud$ AU
where to_char(AU.timestamp#, 'DD-MON-YY') IN ('24-APR-06')
-
This one may be better:
select /*+ ROWID (sys.user_audit_session) */
SU.OS_USERNAME,
substr(AU.comment$text, 68,21) as "Host / IP_ADDRESS",
ua.TIMESTAMP,AU.entryid,AU.timestamp#,AU.userid,AU.action#,UA.action_name,
from sys.aud$ AU, sys.DBA_AUDIT_TRAIL UA,
sys.DBA_audit_session SU
where AU.action# = '100' and
to_char(AU.timestamp#, 'DD-MON-YY') IN ('24-APR-06')
and AU.sessionid = UA.sessionid
and SU.sessionid=UA.sessionid
order by timestamp DESC
-
Hi,
Thanks for your replies.
But I am not able to find any records in table sys.aus$.
I had logged in as sys also but still shows "no records found"
Also SYS_CONTEXT('USERENV','IP_ADDRESS') will give the IP_Address of the current user not all the users connected.
Please help.
Arun Tayal
-
Hi
You can try simply
select sys_context('username' ,'ip_address')
from v$session
where username='Your-friends-name'
for the sys.aud$ queries to work you shoud
audit_trail=DB in the init.ora and then bounce the database
regards
Hrishy
Last edited by hrishy; 04-25-2006 at 04:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|