Discussion:
Oracle job restarts everytime it is broken and unbroken
(too old to reply)
Massa Batheli
2008-02-02 20:21:20 UTC
Permalink
BEGIN
SYS.DBMS_JOB.REMOVE(7777);
COMMIT;
END;
/
The propose of the job is to run only on Fridays at 9 .
All jobs have to be broken at one time or the other for routine
maintainance .
Surprisingly once the jobs are re enabled job 777 which brings
the system to its knees kicks off .Your help will be greatly
appreciated in this
--
-- JOB7777 (Job)
--
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'PurchaseAPI.TruckAvailability;'
,next_date => to_date('01/01/4000 00:00:00','dd/mm/yyyy
hh24:mi:ss')
,interval => 'trunc(next_day(sysdate, ''FRI'')) + 21/24'
,no_parse => FALSE
);
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
SYS.DBMS_JOB.BROKEN
(job => X,
broken => TRUE);
COMMIT;
END;
/

Massa
Anurag Varma
2008-02-04 16:39:01 UTC
Permalink
Post by Massa Batheli
BEGIN
SYS.DBMS_JOB.REMOVE(7777);
COMMIT;
END;
/
The propose of the job is to run only on Fridays at 9 .
All jobs have to be broken at one time or the other for routine
maintainance .
Surprisingly once the jobs are re enabled job 777 which brings
the system to its knees kicks off .Your help will be greatly
appreciated in this
--
-- JOB7777 (Job)
--
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'PurchaseAPI.TruckAvailability;'
,next_date => to_date('01/01/4000 00:00:00','dd/mm/yyyy
hh24:mi:ss')
,interval => 'trunc(next_day(sysdate, ''FRI'')) + 21/24'
,no_parse => FALSE
);
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
SYS.DBMS_JOB.BROKEN
(job => X,
broken => TRUE);
COMMIT;
END;
/
Massa
If 10G and above .. use job scheduler.
You can write the logic on when the underlying procedure is to be run
in a wrapper.
That wrapper procedure can have the code where it will only run during
spcified
time / date interval. The dbms_job can then call that wrapper.

Anurag

Loading...