Client connection info in oracle

Check the client connection info in oracle

Following commands give you the detail of client connection:

Check Session connect info:

select * from V$session_connect_info;

Check number of session active and inactive

select * from v$sessions;

Check session with module

column username format a15 word_wrapped
column module format a15 word_wrapped
column action format a15 word_wrapped
column client_info format a30 word_wrapped

select username||'('||sid||','||serial#||')' username,
module,
action,
client_info
from v$session
where module||action||client_info is not null;

Check user session status

select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,5) username,
-- b.server,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program,
substr(b.status,1,10) status
from v$session b, v$process a
where
b.paddr = a.addr
and type='USER'
order by spid;

Find SQL query running from session by client

set pagesize 100 linesize 132
col username format a10
col sql_text format a60
SELECT USERname,terminal,SID,a.module,
SERIAL#,SQL_TEXT
FROM V$SESSION a, V$SQL b
WHERE a.SQL_ADDRESS = b.ADDRESS and UPPER(program) LIKE '%W3%'
--AND a.STATUS = 'ACTIVE'
--AND SQL_TEXT not like '%USERname%'
AND username IS NOT NULL;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.