CoderZone.org

Category: >> Oracle PL/SQL >> Active Processes (DBA) Bookmark and Share

<< lastnext >>

Snippet Name: Active Processes (DBA)

Description: Show the currently active processes.

Also see:
» Add PSOUG Search to SQL Developer
» Converting Rows to Columns
» Database Links: CURRENT_USER
» Instant Test Database with DCBA
» Show info on current context
» Lookup Oracle error messages
» Display and release DBMS_LOCK locks
» Display locks and latches
» Show rollback segment stats
» Show active transactions
» List supported INIT.ORA parameters
» Display database SGA statistics
» Measure the Buffer Cache Hit Ratio
» List security related profile info...
» Find users with deadly privileges
» Audit User Logins (User Login Trig...
» Block TOAD and other tools
» Kill Session
» Extents
» DBA Users
» DBA Tablespaces
» DBA triggers
» DBA Sessions
» DBA Roles
» DBA Objects
» DBA Links
» DBA Jobs
» Job Queue
» DBA Free Space
» Data Files

Comment: (none)

Author: CoderZone
Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 03rd, 2009

SET pagesize 55;
SET linesize 170;
col SQL format a80;
col SERVER heading 'SVR' format a3;
col EVENT heading 'WAITING' format a30 fold_after;
col OSUSER heading 'OSUSER' format a8;
col USERNAME heading 'USERNAME' format a8;
col PID heading 'OSPID' format 99999;
col DISK_READS heading 'DISK I/O' format 99999999;
col BUFFER_GETS heading 'BUFFER|GETS' format 99999999;
 
SELECT  SUBSTR(V$SESSION.USERNAME,1,8) USERNAME,
     V$SESSION.OSUSER OSUSER,
--        DECODE(V$SESSION.SERVER,'DEDICATED','D','SHARED','S','O') SERVER,
     V$SQLAREA.DISK_READS DISK_READS,
     V$SQLAREA.BUFFER_GETS BUFFER_GETS,
        SUBSTR(V$SESSION.LOCKWAIT,1,10) LOCKWAIT,
     V$SESSION.PROCESS PID,
     V$SESSION_WAIT.EVENT EVENT,
        V$SQLAREA.SQL_TEXT SQL
FROM    V$SESSION_WAIT, V$SQLAREA, V$SESSION
WHERE   V$SESSION.SQL_ADDRESS = V$SQLAREA.ADDRESS AND
     V$SESSION.SQL_HASH_VALUE = V$SQLAREA.HASH_VALUE AND
        V$SESSION.SID = V$SESSION_WAIT.SID (+) AND
     V$SESSION.STATUS = 'ACTIVE' AND
     V$SESSION_WAIT.EVENT != 'client message'
ORDER BY V$SESSION.LOCKWAIT ASC, V$SESSION.USERNAME;
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 8