Wednesday 18 February 2009

Long running Operations in Oracle

From time to time you want to monitor long running queries in oracle. I have recently given a task of purging dehydration database and wanted to find out how far much of the work has been done. I came across dynamic performance view v$session_longops. For me a simple query something like :javascript:void(0)

select round( SOFAR/TOTALWORK * 100,2) ||'% completed' from v$session_longops where sid = 487

produced the result I needed. But there is much more you can do with this view. TIME_REMAINING is very interesting column as it will give you an estimated time remaining for the query to be completed.

No comments:

Post a Comment