Here’s a handy bit of SQL which will find blocked sessions in your Oracle database:
1 2 3 |
|
This returns some useful info about the blocked sessions, including how long its been blocked for and the wait class event. Wait class events will give you an indication about the root cause of the hung session i.e. what it is waiting for. Burleson has a nice intro article on Oracle wait class events here - http://www.dba-oracle.com/concepts/query_wait_events.htm
Once you have the sql_id from the above SQL you can view the problematic SQL query like this:
1
|
|
If you decide you need to kill the problematic session use the sid and serial# like this :
1
|
|