Tuesday, June 8, 2010

To Check the active sql scripts

select chha.sid,
2 chha.username,
3 chha.osuser,
4 to_char(chha.LOGON_TIME,'MM-DD-YY HH:MI AM') login_time,
5 chhb.sql_text "SQL Statement"
6 from v$session chha, v$sqltext chhb, V$SQL_CURSOR chhc
7 where chha.username is not null
8 AND chhc.parent_handle (+) = chhb.address
9 AND chhB.SQL_TEXT NOT LIKE '%chh%'
10 AND chhB.SQL_TEXT NOT LIKE '%V$SESSION%'
11 AND chhB.SQL_TEXT NOT LIKE '%v$session%'
12 and chha.status = 'ACTIVE'
13 and chha.sql_address = chhb.address
14 --and chha.osuser = 'dwloder'
15* order by 1,2, 3,chhb.piece

No comments:

Post a Comment

How to Trouble shoot Logfile_sync wait event

   First  Identify and break down LGWR wait events. Query wait events for LGWR. In this instance LGWR sid is 3 (and usually it is). select s...