|
|
Re: Cursor: Pin S Wait on X [message #627644 is a reply to message #627642] |
Thu, 13 November 2014 10:31   |
 |
ecivgamer
Messages: 147 Registered: May 2011 Location: Ukraine
|
Senior Member |
|
|
Please find below how do I get list of queries that caused "Cursor: Pin S Wait on X" on database.
Now how do I get list of only the top wait for these queries?
select distinct j1.sql_id, j1.sql_text from v$sql j1,
(
select distinct t1.sql_id
from V$ACTIVE_SESSION_HISTORY t1,
(
select distinct mutex_identifier
from V$MUTEX_SLEEP_HISTORY where trunc(sleep_timestamp) = trunc(sysdate)
) t2
where t1.p1 = t2.mutex_identifier
) j2
where j1.sql_id = j2.sql_id
[Updated on: Thu, 13 November 2014 10:32] Report message to a moderator
|
|
|
Re: Cursor: Pin S Wait on X [message #627649 is a reply to message #627644] |
Thu, 13 November 2014 12:12   |
 |
ecivgamer
Messages: 147 Registered: May 2011 Location: Ukraine
|
Senior Member |
|
|
Couldn't wait, so asked also on other discussion boards, this is the result:
select r.* from
(
select distinct to_char(j2.sleep_timestamp, 'DD.MM.YYYY HH24:MI:SS') AS date_and_time, j1.user_io_wait_time, j1.sql_id, j1.sql_text
from v$sql j1,
(
select t1.sql_id, t2.sleep_timestamp
from V$ACTIVE_SESSION_HISTORY t1,
(
select mutex_identifier, sleep_timestamp
from V$MUTEX_SLEEP_HISTORY where trunc(sleep_timestamp) = trunc(sysdate)
) t2
where t1.p1 = t2.mutex_identifier
) j2,
(
select sql_id, count(*) as cnt
from v$active_session_history
where event = 'cursor: pin S wait on X'
group by sql_id
) j3
where j1.sql_id = j2.sql_id
and j1.sql_id = j3.sql_id
order by j1.user_io_wait_time desc
) r
where rownum <= 10
Thanks for attention.
|
|
|
|