Create Or Replace Force View Sys.Av_db_active_process (Username,
Osuser,
Disk_reads,
Buffer_gets,
Lockwait,
Pid,
Event,
Sql
)
As
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;
Osuser,
Disk_reads,
Buffer_gets,
Lockwait,
Pid,
Event,
Sql
)
As
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;
No comments:
Post a Comment