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