Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_SCHEDULER (Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production)
DBMS_SCHEDULER [message #672464] Tue, 16 October 2018 05:46 Go to next message
chat2raj.s
Messages: 135
Registered: October 2010
Location: Chennai, India
Senior Member
Am trying oracle scheduled jobs for the first time and I can see my scheduled job state as RUNNING from user_scheduler_jobs. It is taking more than a day now and which should not be. How can i know why there is a delay of so much time.
Also i need to stop this job now, but system says the job is not running.

EXEC DBMS_SCHEDULER.STOP_JOB('JOB01', FORCE=>TRUE);
Re: DBMS_SCHEDULER [message #672467 is a reply to message #672464] Tue, 16 October 2018 05:55 Go to previous messageGo to next message
John Watson
Messages: 8318
Registered: January 2010
Location: Global Village
Senior Member
Come on, man. What do you see in user_scheduler_jobs? What happens when you run that STOP_JOB procedure?
Re: DBMS_SCHEDULER [message #672479 is a reply to message #672467] Tue, 16 October 2018 06:43 Go to previous messageGo to next message
chat2raj.s
Messages: 135
Registered: October 2010
Location: Chennai, India
Senior Member
SQL> SELECT job_name,enabled,state,restartable,start_date, end_date, Nvl(end_date,SYSDATE)-start_date Running_time FROM user_scheduler_jobs;
 
JOB_NAME  ,ENABLED   ,STATE     ,RESTARTABL,START_DATE          ,END_DATE            ,RUNNING_TIME
----------,----------,----------,----------,--------------------,--------------------,------------
JOB01     ,TRUE      ,RUNNING   ,FALSE     ,15-OCT-18 02.18.33  ,                    ,23:11:05

SQL> EXEC DBMS_SCHEDULER.STOP_JOB('JOB01', FORCE=>TRUE);
BEGIN DBMS_SCHEDULER.STOP_JOB('JOB01', FORCE=>TRUE); END;

*
ERROR at line 1:
ORA-27366: job "CTCORG.JOB01" is not running
ORA-06512: at "SYS.DBMS_ISCHED", line 210
ORA-06512: at "SYS.DBMS_SCHEDULER", line 557
ORA-06512: at line 1
Re: DBMS_SCHEDULER [message #672484 is a reply to message #672479] Tue, 16 October 2018 07:15 Go to previous messageGo to next message
Bill B
Messages: 1968
Registered: December 2004
Senior Member
use of the force option, which kills the job slave, requires the MANAGE SCHEDULAR priviledge and can't be issued by run of the mill users. Using the

EXEC DBMS_SCHEDULER.STOP_JOB('JOB01');

will do the equivalent of issuing a ctrl-c to the job and will not do a hard abort.
Re: DBMS_SCHEDULER [message #672485 is a reply to message #672479] Tue, 16 October 2018 07:23 Go to previous messageGo to next message
John Watson
Messages: 8318
Registered: January 2010
Location: Global Village
Senior Member
You may have a zombie job. You can't kill it because it is already dead. I think there are a few bugs that can cause this, better look on Metalink or raise a TAR.
Re: DBMS_SCHEDULER [message #673623 is a reply to message #672485] Tue, 27 November 2018 23:21 Go to previous message
chat2raj.s
Messages: 135
Registered: October 2010
Location: Chennai, India
Senior Member
Yes that was a zombie job and my dba helped to kill it. Thank you John and Bill. Apology for being late to reply.
Previous Topic: How to get apps view DDL statement from non-apps schema
Next Topic: Writing Arabic Text using UTL_FILE
Goto Forum:
  


Current Time: Fri Aug 07 23:07:13 CDT 2020