Good morning, good afternoon and good evening.
Lords could help me with a problem with dbms_schedule from oracle.
I need to create a JOB that starts every day at 10pm and stops at 4am in the morning, but it has to be run every 1 hour.
But I can not make end_date work, whenever I do the select in the table "USER_SCHEDULE_JOBS" it is as NULL.
Code:
/* Criação da Schedule para o programa */
BEGIN
DBMS_SCHEDULER.CREATE_SCHEDULE
(
schedule_name => 'a_cada_1_hora_a_partir_das_22',
start_date => systimestamp + 1/24*22,
repeat_interval => 'FREQ=HOURLY;INTERVAL=1',
end_date => systimestamp + 1/24*4,
comments => 'Executar a cada 1 hora à partir das 19 horas da noite até 22 horas'
);
END;
/
/* Criação da JOB para rodar o programa de acordo com a SCHEDULE criada */
BEGIN
DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'JOB_TESTE_1',
program_name => 'INSERT_TBL_JOB_TESTE',
schedule_name => 'a_cada_1_hora_a_partir_das_22',
enabled => TRUE,
auto_drop => FALSE,
comments => 'Executar o programa INSERT_TBL_JOB_TESTE entre 19hrs até 22hrs.'
);
END;
/
I could not understand very well what is in the Oracle documentation and I am having trouble scheduling this interval, could you help me?
Thank you in advance.