Monday, January 10, 2011
The following queries will allow you to find the sessions currently logged into the database that have accumulated the most time on CPU or for certain wait events. Use them to identify potential sessions to trace using 10046.
Run following sqls in the order
@sess_waits <-- shows sid on clock
@sql_text <-- show the sql for sid
@sqlplan <-- show sqlplan for sql_id
@wait_sess <-- list all the waits in db
@wait <-- waits for sid