Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wr.sql - What SQL is running.

SQL Scripts

wr.sql - What SQL is running.

by  Michael42  Posted    (Edited  )
Code:
set echo off
-- wr.sql (whats running)
-- Purpose: Display active running SQL commands.
-- -----------------------------------------------------------------------------
column executions      format 9999
column username        format a10
column sid             format 999999
column serial#         format 999999
column users_executing format 9999
column sql_text        format a50

SELECT a.executions, b.username, b.sid, b.serial#,a.users_executing, a.sql_text
FROM v$sql a, v$session b
WHERE users_executing > 0 
AND a.address = b.sql_address 
AND a.hash_value = b.sql_hash_value 
ORDER BY address, child_number 
/
set echo on
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top