Setting
up a Test Environment Using Oracle
dbms_application_info
This database procedure uses
the Oracle dbms_system package
and the
Oracle dbms_application_info packages
to write a user defined string to the alert
log at the start and end of the job. The
body of the procedure loops 100 times with a
sleep of one second in each loop. It uses
the Oracle
dbms_application_info package to
write information to the v$session
and v$session_longops views.
Explanations of the
dbms_application_info and dbms_system
packages are included as they can simplify
the identification and monitoring of
sessions related to scheduled jobs.

DBMS_APPLICATION_INFO.set_module(
module_name => 'my_job_proc',
action_name => p_text || ': Start.');
l_rindex :=
Dbms_Application_Info.Set_Session_Longops_Nohint;
l_total := 100;
FOR i IN 1 .. l_total LOOP
DBMS_APPLICATION_INFO.set_action(
action_name => p_text || ': Sleep ' || i ||
' of ' || l_total || '.');
DBMS_APPLICATION_INFO.set_session_longops(
rindex => l_rindex,
slno => l_slno,
 |
|