Skip to content
August 3, 2011 / doganay

ALL SCHEDULER JOBS REMOVE

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
 
Hi,
You may create a procedure like this to remove all sched. jobs:

create or replace
procedure sys.sched_jobs_remove is
begin
 for i in (select job,log_user from dba_jobs)
 loop
   begin
     sys.dbms_ijob.remove(i.job);
     commit;
   exception
    when others then
         null;
   end;
 end loop;
 for j in (select 'BEGIN DBMS_SCHEDULER.DISABLE('''||owner||'.'||job_name||''',true,''ABSORB_ERRORS''); END;' command1
           from DBA_SCHEDULER_JOBS where owner not in ('SYS','ORACLE_OCM')
          )
 loop
   begin
       execute immediate j.command1;
     commit;
   exception
    when others then
         null;
   end;
 end loop;
 commit;
end;
/

--!! and execute it to remove all sched. jobs:
execute  sys.sched_jobs_remove;
commit;

try and pray :)

Leave a comment