Oracle Job的批量删除与重建脚本
Posted fubinhnust
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle Job的批量删除与重建脚本相关的知识,希望对你有一定的参考价值。
-- 批量删除job declare v_exist number(2); -- job是否存在 begin for x in 1..8 LOOP select count(1) into v_exist from user_scheduler_jobs WHERE job_name = ‘PROCESS_BILL_DATA_‘ || x ; if v_exist > 0 then dbms_scheduler.drop_job(job_name => ‘PROCESS_BILL_DATA_‘ || x,force => TRUE); dbms_output.put_line(‘drop job :‘ || x ); end if; end loop; end; / -- 查看pl/sql output页签输出,显示日志,删除job的个数 -- 批量创建job 8个 declare begin for x in 1..8 LOOP sys.dbms_scheduler.create_job(job_name => ‘PROCESS_BILL_DATA_‘ || x, job_type => ‘PLSQL_BLOCK‘, job_action => ‘begin process_bill_data(8,‘||(x-1)||‘,10000,500); end;‘, start_date => to_date(‘06-08-2013 16:26:05‘, ‘dd-mm-yyyy hh24:mi:ss‘), repeat_interval => ‘FREQ=MINUTELY;INTERVAL=1;‘, end_date => to_date(null), job_class => ‘DEFAULT_JOB_CLASS‘, enabled => true, auto_drop => true, comments => ‘清单数据处理_‘||x); dbms_output.put_line(‘create job :‘ || x ); end loop; end; /
以上是关于Oracle Job的批量删除与重建脚本的主要内容,如果未能解决你的问题,请参考以下文章