luyan
asked on
How to force a job do not run on schedule?
How to force a job do not run on schedule?
Thanks!
Thanks!
ASKER
How to find job name? I would like to use the command:
exec dbms_scheduler.disable('my jobname');
exec dbms_scheduler.disable('my
select job_name,program_name,job_ action,ena bled from dba_scheduler_jobs;
ASKER
I knew the job number, but not job_name. Which table or view has job number and job_name? Then I can get the right job_name, and can run exec dbms_scheduler.disable('my jobname')
The new scheduler does not use job numbers. If the job does not appear in the dba_scheduler_jobs view, then you are using the old scheduler and can view the job in the dba_jobs view. In that case you must use the dbms_job.broken method to halt job execution.
ASKER
sqlplus / as sysdba
SQL> execute dbms_job.broken(333, true)
BEGIN dbms_job.broken(333, true); END;
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation
ORA-06512: at "SYS.DBMS_IJOB", line 525
ORA-06512: at "SYS.DBMS_JOB", line 245
ORA-06512: at line 1
What's wrong?
SQL> execute dbms_job.broken(333, true)
BEGIN dbms_job.broken(333, true); END;
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation
ORA-06512: at "SYS.DBMS_IJOB", line 525
ORA-06512: at "SYS.DBMS_JOB", line 245
ORA-06512: at line 1
What's wrong?
ASKER
Please ignore the previous one. Please take a look the following:
sqlplus / as sysdba
SQL> execute dbms_job.broken(333, true)
BEGIN dbms_job.broken(333, true); END;
*
ERROR at line 1:
ORA-23421: job number 333 is 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
Job #333 is a job defined in system. Why I couldn't use - execute dbms_job.broken(333, true)?
sqlplus / as sysdba
SQL> execute dbms_job.broken(333, true)
BEGIN dbms_job.broken(333, true); END;
*
ERROR at line 1:
ORA-23421: job number 333 is 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
Job #333 is a job defined in system. Why I couldn't use - execute dbms_job.broken(333, true)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your help!
old:
exec dbms_job.broken(myjobnumbe
new:
exec dbms_scheduler.disable('my