Saya sarankan untuk menyimpan statistik Anda dalam tabel (misalnya my_log_table
), dalam hal ini jadwal akan terlihat seperti ini:
begin
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'keep_stats',
job_type => 'PLSQL_BLOCK',
job_action => 'begin insert into my_log_table (mUser,mCnt) (select osuser, count(osuser) as active_conn_count from v$session group by osuser order by active_conn_count desc);commit;end;',
start_date => timestamp '2016-11-07 19:00:00',
repeat_interval => 'FREQ=MINUTELY;INTERVAL=30;',
enabled => TRUE);
end;