Steve Lloyd
Steve Lloyd

Reputation: 949

Using dbms_application_info.set_module before running a long query in Oracle

I am trying to figure out how to set the module name in v$session before running a long query so that I can track its progress. Is something like this possible? This does not quite work. How would I change it so it will?

BEGIN
dbms_session.set_identifier(client_id=>'ABC');
dbms_application_info.set_client_info(client_info=>'ABC TEST');
--
dbms_application_info.set_module(module_name=>'SOME NAME', action_name=>'SOME ACTION');
--
SELECT * from tablename where .....
--
dbms_application_info.set_module(module_name=>'',action_name=>'');
END;

Upvotes: 1

Views: 4168

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59557

It must be like this:

BEGIN
DBMS_APPLICATION_INFO.SET_MODULE('My procedure', 'starting');

DBMS_APPLICATION_INFO.SET_ACTION('running');
SELECT * from tablename where .....

DBMS_APPLICATION_INFO.SET_MODULE(NULL, NULL);
END;

While the query is executing you can select (at another session of course) from v$session

Upvotes: 1

Related Questions