SQL 如何使用作业 ID 启用/禁用 oracle 作业

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14148375/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 12:56:51  来源:igfitidea点击:

How to enable/disable oracle job using job id

sqloracle

提问by swapnil chorghe

I am using following query to enable the oracle job:

我正在使用以下查询来启用 oracle 作业:

exec dbms_scheduler.disable('23');

where '23' is my Job id. But this seems to be not working for id. I read that, job name should be given in place of '23'. But my job does not have name. It has only Id. So how to enable it using job Id? any other command to execute?

其中“23”是我的工作 ID。但这似乎不适用于 id。我读到,应该给出工作名称来代替“23”。但我的工作没有名字。它只有 Id。那么如何使用作业 ID 启用它呢?要执行的任何其他命令?

回答by DazzaL

older DBMS_JOBS had IDs, not scheduler ones. ie you may want this(if your seeing your job in DBA_JOBS view):

较旧的 DBMS_JOBS 有 ID,而不是调度程序 ID。即你可能想要这个(如果你在 DBA_JOBS 视图中看到你的工作):

begin
  dbms_job.broken(23, true);
  commit;
end;
/