oracle中禁用Scheduler_job

How to disable the scheduler using SCHEDULER_DISABLED attribute in 10g (文档 ID 1491941.1)

Applies to:

Oracle Server - Enterprise Edition - Version 10.1.0.2 and later
适用于任何平台,oracle 10.1.0.2及以后
Information in this document applies to any platform.

Goal

Is it possible to disable the Scheduler, for maintenance work by executing the following statement:
我们是否能通过下面的DBMS包来禁用scheduler_job?
DBMS_SCHEDULER.set_scheduler_attribute('SCHEDULER_DISABLED', 'TRUE');

as after running the above command, the jobs are still running at the planned time.

执行了上面的DBMS包,scheduler_job依旧在计划的时间运行..

Fix--修复

It is not possible to disable the scheduler in version 10.2

在10.2上停止scheduler是不可能的

This has been added as a new feature starting Oracle 11gR2.

在11gR2才能停止


Oracle documentation allows us to use the dbms_scheduler.set_scheduler_attribute procedure only for these following attributes: default_timezone, max_job_slave_processes, and log_history.
Please refer to the Oracle® Database PL/SQL Packages and Types Reference.

ORACLE 文档告诉我们,dbms_scheduler.set_scheduler_attribute包只能用于default_timezone, max_job_slave_processes, and log_history,请参阅Oracle®数据库PL / SQL软件包和类型参考。


The SCHEDULER_DISABLED is unsupported for this package. This is not guaranteed to work, so we can not predict an expected behavior.

In some cases it might work if you allow the coordinator and slaves to exit after using SCHEDULER_DISABLED.
If dbms_scheduler.run_job is executed the job will still run.


From 11gR2 and above:

Starting from this version, by setting job_queue_processes to 0 all job processes are stopped, which means that DBMS_SCHEDULER jobs, autotask jobs and DBMS_JOB jobs cannot run.

从11.2以后,设置job_queue_processes=0,所有的job都将被禁用,这意味着DBMS_SCHEDULER,autotask,和DBMS_JOB都不会被运行
When using previous versions only DBMS_JOB jobs were disabled after changing job_queue_processes to 0.

Hence, in order to stop the scheduler jobs in 11gR2 and above, setting the parameter job_queue_processes to 0 is enough.


在11gR2及以上,直接设置 job_queue_processes能够禁用schedulerjob和job




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值