Thanks for the question, Tony.
Asked: October 12, 2018 - 2:48 pm UTC
Last updated: October 15, 2018 - 3:58 am UTC
Version: 11g
Viewed 1000+ times
SQL> create or replace 2 function sched return sys.odcivarchar2list pipelined is 3 l_start_date TIMESTAMP; 4 l_next_date TIMESTAMP; 5 l_return_date TIMESTAMP; 6 begin 7 for i in ( 8 select job_name, repeat_interval, next_run_date 9 from dba_scheduler_jobs 10 ) 11 loop 12 13 if i.repeat_interval like 'FREQ%' then 14 l_start_date := i.next_run_date; 15 l_return_date := l_start_date; 16 17 18 for ctr in 1..10 loop 19 dbms_scheduler.evaluate_calendar_string( 20 i.repeat_interval, 21 l_start_date, l_return_date, l_next_date 22 ); 23 24 pipe row ( to_char(l_next_date,'yyyy-mm-dd hh24:mi:ss')||' '||i.job_name); 25 l_return_date := l_next_date; 26 end loop; 27 end if; 28 end loop; 29 return; 30 end; 31 / Function created. SQL> SQL> select * from sched() 2 order by 1; COLUMN_VALUE ------------------------------------------------------------------------------------------------------- ---------------- 2018-10-14 23:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-14 23:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 00:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 00:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 01:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 01:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 02:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 02:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 03:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 03:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 04:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 04:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 05:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 05:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 05:18:06 ATE_MAINT_EVERY_1_HOUR 2018-10-15 06:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 06:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 06:18:06 ATE_MAINT_EVERY_1_HOUR 2018-10-15 07:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 07:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 07:18:06 ATE_MAINT_EVERY_1_HOUR 2018-10-15 08:17:33 CLEANUP_ONLINE_IND_BUILD 2018-10-15 08:17:43 CLEANUP_TAB_IOT_PMO 2018-10-15 08:18:06 ATE_MAINT_EVERY_1_HOUR 2018-10-15 08:18:06 ATE_MAINT_EVERY_4_HOUR 2018-10-15 09:18:06 ATE_MAINT_EVERY_1_HOUR 2018-10-15 10:18:06 ATE_MAINT_EVERY_1_HOUR ... ...
A reader, October 15, 2018 - 8:37 am UTC
Need more information on Administration? Check out the Administrators guide for the Oracle Database