Solution
1. Changing the Gather_Stats_Job, you will need to change the Schedule that it is assigned to.
At the moment it is set to the Weeknight_window which is 7 days a week.
You will need to assign it to another schedule.
2. Create the new schedule.
BEGIN
DBMS_SCHEDULER.create_schedule (
schedule_name => '<NEW_SCHEDULE>',
start_date => SYSTIMESTAMP,
repeat_interval => 'freq=daily;byday=MON, TUE, WED, THU, FRI;byhour=0;byminute=0;bysecond=0',
end_date => NULL,
comments => 'Repeats daily for ever');
END;
3. Then assign the job to the schedule:
SQL> exec sys.dbms_scheduler.disable( '"SYS"."GATHER_STATS_JOB"' );
SQL> exec sys.dbms_scheduler.set_attribute( name => '"SYS"."GATHER_STATS_JOB"', attribute =>
'schedule_name', value => '<NEW_SCHEDULE>');
SQL> exec sys.dbms_scheduler.enable( '"SYS"."GATHER_STATS_JOB"' );
This should reschedule the job run_time to only M to F.
Note: Repeat_Interval parameter (byday) can be assigned any order of days.
4. To check the schedule details:
SELECT schedule_name,start_date FROM user_scheduler_schedules;
SCHEDULE_NAME START_DATE
-------------------------- --------------------------
TEST_SCHEDULE 27-APR-04 11.32.33.604343 AM -05:00
5. To check job details:
SELECT job_name, enabled FROM user_scheduler_jobs;
JOB_NAME ENABL
------------------------------ -----
TEST_PROGRAM_SCHEDULE_JOB TRUE
TEST_SELF_CONTAINED_JOB TRUE
6. Other useful views:
Data Dictionary Views
================
[DBA | ALL | USER ] _Scheduler_jobs
[DBA | ALL | USER ] _scheduler_jobs_args
[DBA | ALL | USER ] _scheduler_running_jobs
[DBA | ALL ] _scheduler_job_classes
[DBA | ALL | USER ] _scheduler_job_log
[DBA | ALL | USER ] _scheduler_job_run_details
[DBA | ALL | USER ] _scheduler _programs
[DBA | ALL | USER ] _scheduler_program_args