Hi!
I a job created with this code:
dbms_scheduler.create_job (
job_name => 'SYSMKT_ATUALIZAR_FLUXO_112_617',
job_type => 'STORED_PROCEDURE',
job_action => 'sysmkt_rotinas.job_atualizar_fluxo',
start_date => (sysdate + 10/86440),
repeat_interval => null,
enabled => false,
number_of_arguments => 2,
comments => 'Atualização do Fluxo do Job no SYSMKT');
dbms_scheduler.set_job_argument_value('SYSMKT_ATUALIZAR_FLUXO_112_617', 1, trim(to_char(pprj_id)));
dbms_scheduler.set_job_argument_value('SYSMKT_ATUALIZAR_FLUXO_112_617', 2, trim(to_char(ptbl_id)));
dbms_scheduler.set_attribute('SYSMKT_ATUALIZAR_FLUXO_112_617', 'max_runs', 1);
dbms_scheduler.enable('SYSMKT_ATUALIZAR_FLUXO_112_617');
It was scheduled correctly.
select job_name, schedule_type, start_date, repeat_interval, max_runs, run_count, failure_count, auto_drop from user_scheduler_jobs where job_name='SYSMKT_ATUALIZAR_FLUXO_112_617';
Returns:
job_name = SYSMKT_ATUALIZAR_FLUXO_112_617
schedule_type = ONCE
start_date = 14/03/2016 12:39:29 -03:00
repeat_interval = NULL
max_runs = 1
run_count = 0
failure_count = 0
auto_drop = TRUE
In my development environment, the schedule/job queue is set to not run automatically. So i run it by executing:
DBMS_SCHEDULER.run_job (job_name => 'SYSMKT_ATUALIZAR_FLUXO_112_617', use_current_session => TRUE);
If i set use_current_session to false i get the error ORA-27492, but that is not why i´m writing this post.
After i run the job, i have this:
select log_id, job_name, status, req_start_date, actual_start_date from DBA_SCHEDULER_JOB_RUN_DETAILS where job_name='SYSMKT_ATUALIZAR_FLUXO_112_617';
Returns:
job_name = SYSMKT_ATUALIZAR_FLUXO_112_617
status = SUCCEEDED
req_start_date = 14/03/2016 12:39:41 -03:00
actual_start_date = 14/03/2016 12:39:41 -03:00
The problem is that auto_drop is set to TRUE, but it remains in queue.
(see the first select, that was performed after i run the job with DBMS_SCHEDULER.run_job).
Does anyone has any idea why it is not been dropped from queue?