如何从 Oracle Job Scheduler 停止或删除作业
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1764177/
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
How do I stop or drop a job from the Oracle Job Scheduler
提问by Raggedtoad
Sounds easy, right? I have a job that is running that I'd like to stop (it's been running for way to long, and there is clearly a problem with it). Well, when I try to stop the job, I get this message:
听起来很容易,对吧?我有一项正在运行的工作,我想停止(它已经运行了很长时间,而且显然存在问题)。好吧,当我尝试停止工作时,我收到以下消息:
ORA-27366: job "string.string" is not running. Cause: An attempt was made to stop a job that was not running.
ORA-27366: 作业“string.string”未运行。原因:试图停止未运行的作业。
However, when I try to drop the job entirely, because I REALLY don't want it running anymore, I get this message:
但是,当我尝试完全放弃工作时,因为我真的不想再运行它,我收到以下消息:
ORA-27478: job "string.string" is running. Cause: An attempt was made to drop a job that is currently running.
ORA-27478: 作业“string.string”正在运行。原因:试图删除当前正在运行的作业。
Really, Oracle? Make up your mind! Has anyone seen this before? How do I stop this rogue job without restarting the server?!?!
真的吗,甲骨文?下定决心!有没有人见过这个?如何在不重新启动服务器的情况下停止这个流氓作业?!?!
采纳答案by ajdams
This has happened to us before and we had to bounce the server, very annoying.
我们以前也发生过这种情况,我们不得不退回服务器,非常烦人。
回答by Tunde
You could try this:
你可以试试这个:
DBMS_SCHEDULER.DROP_JOB(JOB_NAME => 'my_jobname');
DBMS_SCHEDULER.DROP_JOB(JOB_NAME => 'my_jobname');
OR
或者
try desc the job name as well. Oracle creates a table for a job immediately its created. Try desc jobname; bear in mind the schema that created the job and append it to the jobname in the desc statement.
尝试描述作业名称。Oracle 会立即为作业创建一个表。试试 desc 作业名;请记住创建作业的模式并将其附加到 desc 语句中的作业名称。
then you can drop it with the drop table statement.
然后你可以用 drop table 语句删除它。