Home » RDBMS Server » Server Administration » Job not running on defined schedule (Oracle 11gR2 on Linux)
Job not running on defined schedule [message #561566] Tue, 24 July 2012 01:08 Go to next message
zeeshan007
Messages: 20
Registered: July 2012
Location: Pakistan
Junior Member
Dear All,

I migrate schema with data from oracle 10gR2(Windows) to oracle RAC 11gR2 (Linux).
My JOBS are created but they are not running on defined schedule.

but they run manually successful.

----script of my job are as below --------
BEGIN
  SYS.DBMS_SCHEDULER.DROP_JOB
    (job_name  => 'JHON.TAX_IT);
END;
/

BEGIN
  SYS.DBMS_SCHEDULER.CREATE_JOB
    (
       job_name        => 'JHON.TAX_IT
      ,start_date      => TO_TIMESTAMP_TZ('2012/07/24 10:45:04.375000 Asia/Karachi','yyyy/mm/dd hh24:mi:ss.ff tzr')
      ,repeat_interval => 'FREQ=DAILY;BYHOUR=1;BYMINUTE=0;BYSECOND=0'
      ,end_date        => NULL
      ,job_class       => 'DEFAULT_JOB_CLASS'
      ,job_type        => 'PLSQL_BLOCK'
      ,job_action      => 'BEGIN
JHON.proc_miswkpi_it_taxpayers;
END;'
      ,comments        => NULL
    );
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'JHON.TAX_IT
     ,attribute => 'RESTARTABLE'
     ,value     => FALSE);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'JHON.TAX_IT
     ,attribute => 'LOGGING_LEVEL'
     ,value     => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'JHON.TAX_IT
     ,attribute => 'MAX_FAILURES');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'JHON.TAX_IT
     ,attribute => 'MAX_RUNS');
  BEGIN
    SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
      ( name      => 'JHON.TAX_IT
       ,attribute => 'STOP_ON_WINDOW_CLOSE'
       ,value     => FALSE);
  EXCEPTION
    -- could fail if program is of type EXECUTABLE...
    WHEN OTHERS THEN
      NULL;
  END;
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'JHON.TAX_IT
     ,attribute => 'JOB_PRIORITY'
     ,value     => 3);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'JHON.TAX_IT
     ,attribute => 'SCHEDULE_LIMIT');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'JHON.TAX_IT
     ,attribute => 'AUTO_DROP'
     ,value     => FALSE);

  SYS.DBMS_SCHEDULER.ENABLE
    (name                  => 'JHON.TAX_IT);
END;
/


regards,
Zeeshan Mehboob

[EDITED by LF: applied [code] tags]

[Updated on: Tue, 24 July 2012 01:27] by Moderator

Report message to a moderator

Re: Job not running on defined schedule [message #561567 is a reply to message #561566] Tue, 24 July 2012 01:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68617
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the defined schedule?
When are they running (if they run at another time)?

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Re: Job not running on defined schedule [message #561576 is a reply to message #561567] Tue, 24 July 2012 01:37 Go to previous messageGo to next message
zeeshan007
Messages: 20
Registered: July 2012
Location: Pakistan
Junior Member
Systme specs from where i want to run the job
ORACLE RAC 11gR2
Version 11.2.0.1.0
Linux 64 bit machine
------------------------
repeat schedule means that job run on repeat_interval => 'FREQ=DAILY;BYHOUR=1;BYMINUTE=0;BYSECOND=0

BEGIN
SYS.DBMS_SCHEDULER.DROP_JOB
(job_name => 'JHON.TAC_IT);
END;
/

BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'JHON.TAC_IT
,start_date => TO_TIMESTAMP_TZ('2012/07/24 10:45:04.375000 Asia/Karachi','yyyy/mm/dd hh24:mi:ss.ff tzr')
,repeat_interval => 'FREQ=DAILY;BYHOUR=1;BYMINUTE=0;BYSECOND=0'
,end_date => NULL
,job_class => 'DEFAULT_JOB_CLASS'
,job_type => 'PLSQL_BLOCK'
,job_action => 'BEGIN

JHON.proc_miswkpi_it_taxpayers;
END;'

,comments => NULL
);

SYS.DBMS_SCHEDULER.SET_ATTRIBUTE( name => 'JHON.TAC_IT,attribute => 'RESTARTABLE',value => FALSE);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE( name => 'JHON.TAC_IT,attribute => 'LOGGING_LEVEL',value => SYS.DBMS_SCHEDULER.LOGGING_RUNS);

BEGIN
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE( name => 'JHON.TAC_IT,attribute => 'STOP_ON_WINDOW_CLOSE',value=> FALSE);
EXCEPTION
-- could fail if program is of type EXECUTABLE...
WHEN OTHERS THEN
NULL;
END;

SYS.DBMS_SCHEDULER.SET_ATTRIBUTE (name => 'JHON.TAC_IT,attribute => 'JOB_PRIORITY',value => 3);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL (name => 'JHON.TAC_IT,attribute => 'SCHEDULE_LIMIT');
SYS.DBMS_SCHEDULER.ENABLE (name => 'JHON.TAC_IT);
END;
/
Re: Job not running on defined schedule [message #561582 is a reply to message #561576] Tue, 24 July 2012 01:54 Go to previous messageGo to next message
John Watson
Messages: 8919
Registered: January 2010
Location: Global Village
Senior Member
Your start_date and repeat_interval are such that it will not run until the morning of 25 July.

[Updated on: Tue, 24 July 2012 01:54]

Report message to a moderator

Re: Job not running on defined schedule [message #561585 is a reply to message #561582] Tue, 24 July 2012 02:04 Go to previous messageGo to next message
zeeshan007
Messages: 20
Registered: July 2012
Location: Pakistan
Junior Member
yes it should be like this , but unfortunately it will not run automatically on 25th July.
I checked it 23rd but it will not run on 24th July.
furthermore, i run manually then the job status is successful.

In short job run manually but not running automatically.

regards,
zeeshan
Re: Job not running on defined schedule [message #561586 is a reply to message #561576] Tue, 24 July 2012 02:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68617
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In addition, if I post the question it is for you to reply with WORDS and not with scheduler formula as I don't know if both match and John's answer proves it does not work as you think it will work and so your formula are wrong.

So give the specification with WORDS.

Regards
Michel

[Updated on: Tue, 24 July 2012 02:06]

Report message to a moderator

Re: Job not running on defined schedule [message #561589 is a reply to message #561585] Tue, 24 July 2012 02:08 Go to previous message
John Watson
Messages: 8919
Registered: January 2010
Location: Global Village
Senior Member
Quote:
but unfortunately it will not run automatically on 25th July.
How do you know? Can you do the time warp?
Previous Topic: Statement auditing
Next Topic: Mail whenever error registered in alert.log.
Goto Forum:
  


Current Time: Mon Mar 18 21:39:20 CDT 2024