Criando Job
Oracle 9i
SQL> VARIABLE jobno number;
SQL> BEGIN
2 DBMS_JOB.SUBMIT(:jobno,
3 'SERGIO.JOB_LIMPEZA;',
4 trunc(add_months(trunc(sysdate),0),'mon') + 29 + (23/24), 'trunc(add_months(trunc(sysdate),1),''mon'') + 29 + (23/24)');
5 COMMIT;
6 END;
7 /
Oracle 10
begin
sys.dbms_scheduler.create_job(
job_name => 'SERGIO.JOB_LPZ',
job_type => 'STORED_PROCEDURE',
job_action => 'JOB_LIMPEZA',
start_date => to_date('14-01-2011 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
repeat_interval => 'Freq=Weekly;ByDay=Fri;ByHour=15;ByMinute=00;BySecond=00',
end_date => to_date(null),
job_class => 'DEFAULT_JOB_CLASS',
enabled => true,
auto_drop => false,
comments => 'JOB para a limpeza das tabelas CRITICA_367_SAP e CRITICA_367_GIS');
end;
Nenhum comentário :
Postar um comentário