Created
November 7, 2017 07:54
-
-
Save sheeplogh/be99bf29375b5b77cb66bbb136ec78df to your computer and use it in GitHub Desktop.
[long_delete-update-merge_query_with_qc_info.sql] Display DELETE / UPDATE / MERGE running for more than 30 minutes (with SID / serial of parallel coordinator process) #Oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select sql_exec_start,username,machine,module,program, | |
(select px.QCSID||','||px.QCSERIAL# ||',@'||px.QCINST_ID from gv$px_session px where px.sid=vs.sid and px.serial#=vs.serial#) as QC_info, | |
(select substr(sql_text,1,80) from gv$sql vsql where vsql.sql_id = vs.sql_id and rownum = 1) as SQLTEXT | |
from v$session vs | |
where | |
vs.sql_exec_start < SYSDATE - 1 / 48 | |
and | |
EXISTS ( | |
SELECT | |
1 | |
FROM | |
gv$sql vsql | |
WHERE | |
vsql.sql_id = vs.sql_id | |
AND | |
vsql.command_type IN ( | |
6,7,189 | |
) | |
) | |
ORDER BY (select px.QCSID||','||px.QCSERIAL# ||',@'||px.QCINST_ID from gv$px_session px where px.sid=vs.sid and px.serial#=vs.serial#) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment