Hi all,
In ORACLE
The
DBMS_APPLICATION_INFO package allows programs to add information to the
V$SESSION and
V$SESSION_LONGOPS views to make tracking of session activities more accurate.
Check it out,
Code:
DECLARE
v_rindex PLS_INTEGER;
v_slno PLS_INTEGER;
v_totalwork NUMBER;
v_sofar NUMBER;
v_obj PLS_INTEGER;
BEGIN
v_rindex := DBMS_APPLICATION_INFO.set_session_longops_nohint;
v_sofar := 0;
v_totalwork := 10;
WHILE v_sofar < 10 LOOP
-- Do some work
DBMS_LOCK.sleep(5);
v_sofar := v_sofar + 1;
DBMS_APPLICATION_INFO.set_session_longops(rindex => v_rindex,
slno => v_slno,
op_name => 'Batch Load',
target => v_obj,
context => 0,
sofar => v_sofar,
totalwork => v_totalwork,
target_desc => 'BATCH_LOAD_TABLE',
units => 'rows processed');
END LOOP;
END; /
PL/SQL procedure successfully completed