删除oracle Job
1.删除所有用户的JOB begin for v in(select job from user_jobs) loop
dbms_job.remove(v.job); end loop; commit;
end;
2.删除指定用户的JOB define USER=&1
begin for v in(select job from user_jobs where log_user=‘&USER‘) loop dbms_job.remove(v.job); end loop; commit; end;
3.删除特定内容的JOB begin for v in(select job from user_jobs where what in( ‘the_what_name;‘, ) ) loop dbms_job.remove(v.job); end loop; commit; end; /
补充: dba_jobs: LOG_USER 提交任务的用户 PRIV_USER 赋予任务权限的用户 SCHEMA_USER 对任务作语法分析的用户模式
http://blog.chinaunix.net/u1/40226/showart_2269864.html
JOB始终没有运行问题
1.首先确认当前的Job Queue Processes的数目
SQL> select name,value from v$parameter where name =‘job_queue_processes‘;
2.如果值为0 然后将Job Queue Processes的数目修改为大于0的数
SQL> ALTER SYSTEM SET job_queue_processes = 10;
2.删除指定用户的JOB define USER=&1
begin for v in(select job from user_jobs where log_user=‘&USER‘) loop dbms_job.remove(v.job); end loop; commit; end;
3.删除特定内容的JOB begin for v in(select job from user_jobs where what in( ‘the_what_name;‘, ) ) loop dbms_job.remove(v.job); end loop; commit; end; /
补充: dba_jobs: LOG_USER 提交任务的用户 PRIV_USER 赋予任务权限的用户 SCHEMA_USER 对任务作语法分析的用户模式
http://blog.chinaunix.net/u1/40226/showart_2269864.html
JOB始终没有运行问题
1.首先确认当前的Job Queue Processes的数目
SQL> select name,value from v$parameter where name =‘job_queue_processes‘;
2.如果值为0 然后将Job Queue Processes的数目修改为大于0的数
SQL> ALTER SYSTEM SET job_queue_processes = 10;
如何停止删除oracle中正在执行的job?
--查看所有job; select * from dba_jobs;
--查看正在运行的job; select * from dba_jobs_running;
--根据sid查出对应的session;
select SID,SERIAL# from V$Session where SID=‘&SID‘;
--kill对应的session;
alter system kill session ‘&SID,&SERIAL‘;
--将job置为broken; exec dbms_job.broken(‘&JOB‘,true);
--sysdba用户权限删除job;
delete from dba_jobs where JOB=‘&JOB‘;