Solved

Disable Oracle JOB

Posted on 2013-05-22
4
701 Views
Last Modified: 2013-05-26
Hi,
I need disable the Oracle statistic SYS.GATHER_STATS_JOB for only these days: 27 - 28 and 29 MAY 2013

If I run:
EXECUTE DBMS_SCHEDULER.DISABLE (name => 'SYS.GATHER_STATS_JOB');

Open in new window

I disable the JOB but I'd like disable this job only for 27 - 28 and 29 MAY 2013

can I disable the job only for a few days?

if so, can you tell me what step I should do?

Thanks in advance!
0
Comment
Question by:ralph_rea
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Ivo Stoykov earned 500 total points
ID: 39187013
one approach is to schedule this
EXECUTE DBMS_SCHEDULER.DISABLE (name => 'SYS.GATHER_STATS_JOB');
for  27 MAY 2013 00:00:00 and the opposite
EXECUTE DBMS_SCHEDULER.ENABLE (name => 'SYS.GATHER_STATS_JOB');
for 30 MAY 2013 00:00:00.

Both jobs will be executed once.

HTH

Ivo Stoykov
0
 

Author Comment

by:ralph_rea
ID: 39187015
I Know that I can create a new named schedule:


dbms_scheduler.create_schedule( schedule_name => 'may_exclude',
repeat_interval => 'freq=monthly;bymonth=5;bymonthday=27,28,29;byhour=0;byminute=0;bysecond=0',
comments => 'named schedule to exclude 27,28,29 may');

Open in new window

but I don't know How can I associate this named schedule "may_exclude" to my job SYS.GATHER_STATS_JOB with EXCLUDE clause

Have you any idea?
0
 

Author Comment

by:ralph_rea
ID: 39187491
SELECT a.job_name, a.enabled, c.window_name, c.repeat_interval
FROM dba_scheduler_jobs a, dba_scheduler_wingroup_members b, dba_scheduler_windows c
WHERE job_name='GATHER_STATS_JOB'
And a.schedule_name=b.window_group_name
And b.window_name=c.window_name;

JOB_NAME                       ENABL WINDOW_NAME                    REPEAT_INTERVAL
------------------------------ ----- ------------------------------ --------------------------------------------------
GATHER_STATS_JOB               TRUE  WEEKEND_WINDOW                 freq=daily;byday=SAT;byhour=0;byminute=0;bysecond=
                                                                    0

GATHER_STATS_JOB               TRUE  WEEKNIGHT_WINDOW               freq=daily;byday=MON, TUE, WED, THU, FRI;byhour=14
                                                                    ; byminute=0; bysecond=0

Open in new window

0
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 39189972
depends how you;ve created the job, but you could state a schedule name
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
   job_name            =>  'my_new_job3', 
   program_name        =>  'my_saved_program1', 
   schedule_name       =>  'my_saved_schedule1'); -- <-- 
END;
/

Open in new window

for more look here

HTH

Ivo Stoykov
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now