Re: question on DBMS_SCHEDULER.

<snip>

What I meant here is, I want to know current DML statement processed by
ORACLE server when ORACLE scheduler kicks off the job? So let say I have 10
DML statements in procedure(which is kicked off by ORACLE scheduler) , so
far ORACLE server has processed first 4 statements and currently processing
5th one, is there any way I can find out ORACLE server is processing 5th one
by looking at the data dictionary views?
</snip>

Yes -- if you have access to the code you can use the package procedure
dbms_application_info.set_module to show where you are in the code --
setting the values to something like module="MyModule" Action="step5".  As
the code advances you make additional calls to update the action value to
reflect the current code location.  Module and Action values are visible in
the gv$session view.

If you don't have access to the code you can still see the current sql by
either using a tool that will show you the current sql statement being
executed or interrogating the underlying v$ views.

Here's a link to some sql that shows all active sql statements:

http://www.oracle.com/technology/oramag/code/tips2004/062104.html

It should be a simple matter to determine which one is in your procedure.

Other related posts: