When we do not want a job to run, it can be disabled and completed by calling Dbms_job.broken.
The syntax for the Dbms_job.broken procedure is:
Dbms_job.broken (
Job in Binary_integer,
Broken in Boolen,
Next_date in date default sysdate);
Therefore, when calling procedure broken, you need to provide at least two parameters: the job and broken,next_date usually default to defaults. When the broken value is true, indicates that the job is enabled when Job;false is disabled. The following command disables job 341:
sql> exec Dbms_job.broken (341,true);
Pl/sql procedure successfully completed.
Note that when you perform the Dbms_job.broken process, the logged-on user needs to be the job owner. Otherwise, the following error occurs:
$ Sqlplus '/as sysdba '
sql> exec Dbms_job.broken (287,true);
BEGIN Dbms_job.broken (287,true); End;
ERROR at line 1:
Ora-23421:job number 287 The not a job in the job queue
Ora-06512:at "SYS. Dbms_sys_error ", line 86
Ora-06512:at "SYS. Dbms_ijob ", line 529
Ora-06512:at "SYS. Dbms_job ", line 245
Ora-06512:at Line 1
Enable a job that has been disabled by using the following command:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.