What happens if a maintenance window closes before a job that collects optimizer statistics completes?

What happens if a maintenance window closes before a job that collects optimizer statistics
completes?

What happens if a maintenance window closes before a job that collects optimizer statistics
completes?

A.
The job is terminated and the gathered statistics are not saved.

B.
The job is terminated but the gathered statistics are not published.

C.
The job continues to run until all statistics are gathered.

D.
The job is terminated and statistics for the remaining objects are collected the next time the
maintenance window opens.

Explanation:
Explanation/Reference:



Leave a Reply 21

Your email address will not be published. Required fields are marked *


Leon

Leon

C

A job that is running will not close when the window it is running in closes unless the attribute stop_on_window_close was set to TRUE when the job was created. However, the resources allocated to the job may change because the resource plan may change.

Kai

Kai

@Leon: a ‘maintenance window’ is a time frame, not an object on your screen. I think you misunderstood the question.

Thomaz

Thomaz

I think that D is correct

Fedo

Fedo

D is correct.

James

James

C is correct one. The GATHER_STATS_JOB continues until it finishes, even if it exceeds the allocated time for the maintenance window. The default behavior of the maintenance window can be changed

James

James

So finnaly i think D is right. The stop_on_window_close attribute controls whether the GATHER_STATS_JOB continues when the maintenance window closes. The default setting for the stop_on_window_close attribute is TRUE, causing Scheduler to terminate GATHER_STATS_JOB when the maintenance window closes. The remaining objects are then processed in the next maintenance window.

abhishek

abhishek

Above considerations and option C is correct when stats collection is scheduled through DBMS_SCHEDULER.
STOP_ON_WINDOW attribute is set at job level in DBA_SCHEDULER_JOBS.

But from 11g onwards stats collection is being taken cared by AUTOTASK admin, where there is no such clause. So option D in correct if we consider 11g and 12c.

gaieba

gaieba

I think D is correct

https://docs.oracle.com/cd/B19306_01/server.102/b14211/stats.htm

This job is created automatically at database creation time and is managed by the Scheduler. The Scheduler runs this job when the maintenance window is opened. By default, the maintenance window opens every night from 10 P.M. to 6 A.M. and all day on weekends.
The stop_on_window_close attribute controls whether the GATHER_STATS_JOB continues when the maintenance window closes. The default setting for the stop_on_window_close attribute is TRUE, causing Scheduler to terminate GATHER_STATS_JOB when the maintenance window closes. The remaining objects are then processed in the next maintenance window.

vkj

vkj

Hi gaieba,

The link shared is of 10g, in 11g & 12C the default value of the parameter stop_on_window_close is false and hence C should be correct considering 1z0-062.

gaieba

gaieba

Hi Vkj,
can you share the link 12c, which states that if the window closes, the job continues to run?

thanks

Tom

Tom

But if you look into source code of jobs, you will see, that job responsible for statistics collecting is running with parameter stop_on_window_close=TRUE.

Shoulian

Shoulian

C is correct. Please see below from Oracle web site:
stop_on_window_close
This attribute only applies if the schedule of a job is a window or a window group.
Setting this attribute to TRUE implies that the job should stop once the associated window is closed.
The job is stopped using the stop_job procedure with force set to FALSE.
By default, stop_on_window_close is set to FALSE.
Therefore, if you do not set this attribute, the job continues after the window closes.
Note that, although the job is allowed to continue, its resource allocation will probably change because closing a window generally also implies a change in resource plans.

From

DBA Junior

DBA Junior

If the job belong a some window or windows group, by default the job continue , however the resource plan is changed.
C is correct!

humberto

humberto

C

stop_on_window_close

This attribute only applies if the schedule of a job is a window or a window group. Setting this attribute to TRUE implies that the job should stop once the associated window is closed. The job is stopped using the stop_job procedure with force set to FALSE.

By default, stop_on_window_close is set to FALSE. Therefore, if you do not set this attribute, the job continues after the window closes.

Note that, although the job is allowed to continue, its resource allocation will probably change because closing a window generally also implies a change in resource plans.

https://docs.oracle.com/database/121/ARPLS/d_sched.htm#ARPLS72362

Luca

Luca

D is the right answer.

http://docs.oracle.com/cd/B19306_01/server.102/b14211/stats.htm#i41282

The stop_on_window_close attribute controls whether the GATHER_STATS_JOB continues when the maintenance window closes. The default setting for the stop_on_window_close attribute is TRUE, causing Scheduler to terminate GATHER_STATS_JOB when the maintenance window closes. The remaining objects are then processed in the next maintenance window.

bogussteve

bogussteve

stop_on_window_close IN BOOLEAN DEFAULT FALSE,
By default, stop_on_window_close is set to FALSE. Therefore, if you do not set this attribute, the job continues after the window closes

12c Release 1 (12.1) / Database Administration