Create Or Replace Force View Sys.Av_db_cur_sess_wait_activity (Sid,
Username,
Wait_class,
Total_waits,
Time_waited_secs,
Killstmt
)
As
Select A.Sid, B.Username, A.Wait_class, A.Total_waits,
Round ((A.Time_waited / 100), 2) Time_waited_secs,
'Alter SYSTEM Kill Session '
|| ''''
|| B.Sid
|| ','
|| B.Serial#
|| ''' '
|| 'IMMEDIATE;' Killstmt
From Sys.V_$session_wait_class A, Sys.V_$session B
Where B.Sid = A.Sid
And B.Username Is Not Null
And A.Wait_class != 'Idle'
Order By 5 Desc;
No comments:
Post a Comment