Oracle SQL Script to Find Out Active Sessions Details

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
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;

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer