SQL>
SQL> declare
2 l_nohint number default dbms_application_info.set_session_longops_nohint;
3 l_rindex number default l_nohint;
4 l_slno number;
5 begin
6 for i in 1 .. 25
7 loop
8 dbms_lock.sleep(2);
9 dbms_application_info.set_session_longops
10 ( rindex => l_rindex,
11 slno => l_slno,
12 op_name => 'my long running operation',
13 target => 9999,
14 target_desc => 'my target',
15 context => 0,
16 sofar => i,
17 totalwork => 25,
18 units => 'loops'
19 );
20 end loop;
21 end;
22 /
PL/SQL procedure successfully completed.