Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I identify a specific row in V$SESSION_LONGOPS?

APCMar 6 2013 — edited Mar 6 2013
I'm using [url http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_appinf.htm#i996999 ] dbms_application_info.set_session_longops to monitor some long running sessions.

I am interested in the variation of {font:courier new}TIME_REMAINING{font} over the course of the run. At the moment I can run occasional queries against {font:courier new}V$SESSION_LONGOPS{font} but I want to leave things running overnight so eyeballing it is not practical (I'm dedicated but not that dedicated).

Logging is the obvious answer, but how to get the row in question? I can query
  select time_remaining
  from V$SESSION_LONGOPS
  where opname = 'WHATEVER'
  and sofar = :X
  and time_remaining > 0;
but that is not bulletproof.

Now this is a problem which Oracle has solved; {font:courier new}dbms_application_info.set_session_longops {font} employs a parameter, {font:courier new}rindex{font} for this very purpose. My question is, does anybody know how I can use {font:courier new}rindex{font} to identify my row of interest in the view?

Cheers, APC
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2013
Added on Mar 6 2013
7 comments
477 views