Oracle SQL Script to Find Out Active Sessions Details

SET LINESIZE 500
SET PAGESIZE 1000

COLUMN username FORMAT A15
COLUMN machine FORMAT A25
COLUMN logon_time FORMAT A20

SELECT NVL(sess.username, '(ora BGproc)') AS username,
       sess.osuser,
       sess.sid,
       sess.serial#,
       proc.spid,
       sess.lockwait,
       sess.status,
       sess.module,
       sess.machine,
       sess.program,
       TO_CHAR(sess.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time
FROM   v$session sess,
       v$process proc
WHERE  sess.paddr  = proc.addr
AND    sess.status = 'ACTIVE'
ORDER BY sess.username, sess.osuser;
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google