2.1.1.3_2 Oracle数据字典 129-41 SYS.DBMS_SCHEDULER.disable


相关链接


一、Summary of DISABLE Procedure

Disables a program, job, chain, window, database destination, external destination, file watcher, or group
禁用程序、作业、链、窗口、数据库路径、外部路径、文件监视器或组。

二、DISABLE Procedure

This procedure disables a program, job, chain, window, database destination, external destination, file watcher, or group. When an object is disabled, its enabled attribute is set to FALSE.
此过程(dbms_scheduler.disable)可禁用程序(program),作业(job),链(chain job),时间窗口(window),数据库路径(database destination),外部路径(external destination),文件监视器( file watcher)。当一个对象的enabled属性被设置为FALSE,该对象被禁用。

三、DISABLE

3.1 Syntax 语法

参数有default值:可以不传参,使用默认值
参数无default值:必须传参才可调用

DBMS_SCHEDULER.DISABLE (
   name              IN VARCHAR2,
   force             IN BOOLEAN DEFAULT FALSE,
   commit_semantics  IN VARCHAR2 DEFAULT 'STOP_ON_FIRST_ERROR');

3.2 执行存储过程

1.如果是命令窗口就用exec 存储过程名,举个例子:

EXEC  procedure;--procedure是存储过程名

2.如果是PL/SQL窗口就用 begin 存储过程名 end; 举个例子:

begin
  procedure;--procedure是存储过程名
end;

3.如果是程序中调用就用 call 存储过程名 ,举个例子:

hibernateDao.excuteSqlUpdate("{Call proc_stuInfo()}");//存储过程proc_stuInfo
  • plsql测试语句
DECLARE
  -- BOOLEAN PARAMETERS ARE TRANSLATED FROM/TO INTEGERS: 
  -- 0/1/NULL <--> FALSE/TRUE/NULL 
  FORCE BOOLEAN := SYS.DIUTIL.INT_TO_BOOL(:FORCE);
BEGIN
  -- CALL THE PROCEDURE
  SYS.DBMS_SCHEDULER.DISABLE(NAME => :NAME,
                             FORCE => FORCE,
                             COMMIT_SEMANTICS => :COMMIT_SEMANTICS);
END;

3.3 Parameters 参数

Table 129-41 DISABLE Procedure Parameters

Ser
序号
Parameter
参数名称
Type
类型
DefaultIN / OUTNote
参数说明
Range
取值范围
1nameVARCHAR2INThe name of the object being disabled. Can be a comma-delimited list.
被禁用的对象的名称。可以是逗号分隔的列表。
If a job class name is specified, then all the jobs in the job class are disabled. The job class is not disabled.
如果指定了作业类名,则禁用该作业类(job class)中的所有作业(jobs),不禁用该类(job class)。
If a group name is specified, then the group is disabled, but the enabled state of the group members is unaffected.
如果指定了组名,则禁用该组,但组成员的启用状态不受影响。
[Any Name]
2forceBOOLEANYINIf TRUE, objects are disabled even if other objects depend on them. See the usage notes for more information.
如果“TRUE”,即使其他对象依赖于禁用对象,也将强制禁用该对象。
TRUE
FALSE[default]
3commit_semanticsVARCHAR2YINThe commit semantics. The following types are supported:
提交语义。支持以下类型:
 ● STOP_ON_FIRST_ERROR: The procedure returns on the first error and the previous disable operations that were successful are committed to disk.
当出现第一个错误时,该过程返回,并将之前成功的禁用操作提交到磁盘。
This is the default.
这是默认值。
 ● TRANSACTIONAL: The procedure returns on the first error and everything that happened before that error is rolled back.
该过程返回第一个错误,并回滚该错误之前发生的所有事情。
This type is only supported when disabling a job or a list of jobs. In addition, this type is not supported when force is set to TRUE.
仅在禁用作业或作业列表时才支持此类型。此外,当force设置为TRUE时,不支持此类型。
 ● ABSORB_ERRORS: The procedure tries to absorb any errors and disable the rest of the jobs and commits all the disable operations that were successful. If errors occur, you can query the view SCHEDULER_BATCH_ERRORS for details.
该过程尝试吸收所有错误并禁用其余作业,并提交所有成功的禁用操作。如果出现错误,可以查询视图SCHEDULER_BATCH_ERRORS以获得详细信息。
This type is only supported when disabling a job or a list of jobs.
仅在禁用作业或作业列表时才支持此类型。
STOP_ON_FIRST_ERROR[default]
TRANSACTIONAL
ABSORB_ERRORS

3.4 Usage Notes 使用方式

Windows must be preceded by SYS.
时间窗口必须由 SYS 用户驱动
Disabling an object that is already disabled does not generate an error.
禁用已经禁用的对象不会报错。
The purpose of the force option is to point out dependencies. No dependent objects are altered.
force选项的目的是指出依赖关系。不改变依赖对象。
To run DISABLE for a window or a group of type WINDOW, you must have the MANAGE SCHEDULER privilege.
若要对窗口或窗口类型的一组运行禁用,需要 MANAGE SCHEDULER 权限。
You can use DISABLE with any schema except the SYS schema.
除了SYS模式(schema),可以disable任意其他模式(schema)。

3.5 Jobs 作业

Disabling a job means that, although the metadata of the job is there, it should not run and the job coordinator will not pick up these jobs for processing. When a job is disabled, its state in the job queue is changed to disabled.
当一个作业被禁用时。作业的元数据还在。
If force is set to FALSE and the job is currently running, an error is returned.
如果参数 FORCE = FLASE ,且作业正在运行,则返回错误信息。
If force is set to TRUE, the job is disabled, but the currently running instance is allowed to finish.
如果参数 FORCE = TRUE,则禁用该作业,允许当前运行的实例完成。
For jobs with multiple destinations, you cannot disable a child job at a specific destination. Instead, you can disable the destination.
有多个终点的作业,不能禁用特定终点上的子作业。

3.6 Programs 程序

When a program is disabled, the status is changed to disabled. A disabled program implies that, although the metadata is still there, jobs that point to this program cannot run.
当一个程序被禁用时。元数据还在,但指向该程序的作业不能运行。
If force is set to FALSE, the program must not be referenced by any job, otherwise an error will occur.
如果参数 FORCE = FALSE,则任何作业都不能引用该程序, 引用则会报错。
If force is set to TRUE, those jobs that point to the program will not be disabled, however, they will fail at runtime because their program will not be valid.
如果参数 FORCE = TRUE,指向作业的程序不会禁用,但运行的话会失败,因为作业中的程序不能运行。
Running jobs that point to the program are not affected by the DISABLE call and are allowed to continue
当程序被禁用,指向该程序的作业也被禁用,但允许跑完当前正在执行的作业。
No arguments that pertain to the program are affected when the program is disabled.
当程序被禁用,程序相关的参数不会改变。

3.7 File Watchers 文件监视器

If force is set to FALSE, the file watcher must not be referenced by any job, otherwise an error will occur. If you force disabling a file watcher, jobs that depend on it become disabled.
如果参数 FALSE = TRUE,任何作业都不能引用文件监视程序,引用则会报错。如果强制禁用文件监视器,则依赖它的作业将被禁用。

3.8 Windows 时间窗口

This means that the window will not open, however, the metadata of the window is still there, so it can be reenabled.
窗口被禁用表示窗口不会打开。元数据还在,可以重新启用窗口。
If force is set to FALSE, the window must not be open or referenced by any job otherwise an error occurs.
如果参数 FORCE = FALSE,则任何作业都不能打开或引用该窗口,否则会报错。
If force is set to TRUE, disabling a window that is open will succeed but the window will not be closed. It will prevent the window from opening in the future until it is reenabled.
如果参数 FORCE = TRUE,正在打开的窗口会成功运行且不关闭。但会阻止将来窗口被打开,直到窗口被重新启用。
When the window is disabled, those jobs that have the window as their schedule will not be disabled.
当该窗口被禁用时,那些将该窗口作为其日程安排的作业将不会被禁用。

3.9 Window Groups 时间窗口组

When a group of type WINDOW is disabled, jobs (other than a running job) that have the window group as their schedule will not run when the member windows open. However, a job that has one of the window group members as its schedule still runs.
禁用一组窗口后,如果打开成员窗口,以窗口组(Window Groups)作为调度的作业(正在运行的会正常完成)将不会运行。但是,以其中一个窗口组成员(Window)作为调度的作业仍然运行。
The metadata of the window group is still there, so it can be reenabled. Note that the members of the window group will still open.
窗口组的元数据仍然存在,因此可以重新启用它。禁用窗口组并不改变其成员状态。
If force is set to FALSE, the window group must not have any members that are open or referenced by any job, otherwise an error will occur.
如果参数 FORCE = FALSE,则窗口组不能有任何打开或被任何作业引用的成员,否则会报错。
If force is set to TRUE:
如果参数 FORCE = TRUE:
  ● The window group is disabled and the open window will be not closed or disabled. It will be allowed to continue to its end.
    窗口组已禁用,已打开的窗口将不会关闭或禁用,直到此次窗口正常结束。
  ● The window group is disabled but those jobs that have the window group as their schedule will not be disabled.
    已禁用窗口组,但不会禁用那些将窗口组作为日程安排的作业。

3.10 Job Chains 作业链

When a chain is disabled, the metadata for the chain is still there, but jobs that point to it will not be able to be run. This allows changes to the chain to be made safely without the risk of having an incompletely specified chain run.If force is set to FALSE, the chain must not be referenced by any job, otherwise an error will occur.If force is set to TRUE, those jobs that point to the chain will not be disabled, however, they will fail at runtime.Running jobs that point to this chain are not affected by the DISABLE call and are allowed to complete.
禁用链,链的元数据仍然存在,但指向它的作业将无法运行。避免有运行半成品链的风险。
如果参数 FORCE = FALSE,则任何作业都不能引用该链,否则会报错。
如果参数 FORCE = TURE,链中的作业将不会被禁用,但是会运行失败。禁用时正在运行的作业将不受禁用影响并可以完成。

3.11 Database Destinations 数据库路径

When you disable a database destination:
当你禁用一个数据库路径:
  ● The destination is skipped when a multiple destination job runs.
    如果多个目标作业在运行,将跳过目标。
  ● If all destinations are disabled for a job, the Scheduler generates an error when it attempts to run the job.
    如果某个作业的所有目标都被禁用,调度器在尝试运行该作业时将产生错误。
  ● The REFS_ENABLED column in *_SCHEDULER_JOB_DESTS is set to FALSE for all jobs that reference the database destination.
    对于引用数据库目标的所有作业,*_SCHEDULER_JOB_DESTS中的REFS_ENABLED列被设置为FALSE

3.12 External Destinations 外部路径

When you disable an external destination:
当你禁用一个外部路径:
Dependent database destinations remain enabled, but the Scheduler generates an error when it attempts to run a job with a database destination that depends on the external destination.
依赖数据库路径还是启用状态,但调度器尝试使用依赖于外部路径的数据库路径运行作业时,会产生错误。
The REFS_ENABLED column in *_SCHEDULER_JOB_DESTS is set to FALSE for all external jobs that reference the external destination and for all database jobs with a database destination that depends on the external destination.
对于引用外部路径的所有外部作业,以及数据库路径依赖于外部目的地的所有数据库作业,’ *_SCHEDULER_JOB_DESTS ‘中的’ REFS_ENABLED ‘列被设置为’ FALSE '。

3.13 Groups 组

If you disable an external destination group or database destination group, the Scheduler generates an error when it attempts to run a job that names the group as its destination.
如果禁用外部路径组或数据库路径组,调度器在尝试运行将该组命名为其目标的作业时将产生错误。


20/12/08

M

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值