Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Chris Saxon

Thanks for the question, oracle.

Asked: September 13, 2017 - 6:31 am UTC

Last updated: September 13, 2017 - 9:41 am UTC

Version: 12.1.0

Viewed 1000+ times

You Asked

Hi team,

There was an issue with db running very slow so i generated the ASH report after to become normal And i get the blocking session over there.

I want to find the sql statement for that blocking session but it is showing no records found i checked in -

V$SESSION and
DBA_HIST_ACTIVE_SESS_HISTORY.

How to get the details with sql query which blocking session.

and Chris said...

There is no general way to find the SQL that's blocking another:

https://asktom.oracle.com/pls/apex/f?p=100:11:::NO:RP:P11_QUESTION_ID:9533884200346533769

You can find the blocking session to kill it or look at its ASH history to see what it did. But there's no guarantee you'll find the exact SQL that holding the locks.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library