1
Good morning, good afternoon and good night.
You could help me with a problem regarding the oracle dbms_schedule.
I need to create a JOB that starts every day at 22hrs and stops at 4hrs in the morning, but it has to be run every 1 hour.
But I can’t make the end_date work, whenever I select it in the table "USER_SCHEDULE_JOBS" it is like 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’m having difficulties in programming this interval, could help me?
Thank you, from now on.