by http://webgeektutorials.blogspot.com

Thursday, June 28, 2012

Oracle DBA script: Monitor user activity on the DB

Code :


set linesize 80
set verify off message off echo off pause off timing off time off
set feedback off
column o format a8 heading 'O/S|User'
column u format a10 heading 'Oracle|Userid'
column s format a12 heading 'R-S|Name'
column txt format a45 heading 'Current Statement' word


spool monrbs
select osuser o,
username u,
segment_name s,
sa.sql_text txt
from v$session s,
v$transaction t,
dba_rollback_segs r,
v$sqlarea sa
where s.taddr = t.addr
and t.xidusn = r.segment_id(+)
and s.sql_address = sa.address(+)
/

spool off

1 comment:

Andi Anderson said...

I truly like to reading your post. Thank you so much for taking the time to share such a nice information.
Webgrid

Post a Comment