Specifying time windows for collecting autonomic statistics

You can specify time windows when the autonomic collection of statistics is allowed.

Before you begin

Begin program-specific programming interface information.Your authorization ID must have privileges to modify data in the SYSIBM.SYSAUTOTIMEWINDOWS catalog table.

About this task

When the administrative task scheduler calls the ADMIN_UTL_EXECUTE stored procedure, the ADMIN_UTL_EXECUTE stored procedure checks whether the call is within a specified time window before resolving statistics alerts. If the call is not within a time window, the ADMIN_UTL_EXECUTE stored procedure reschedules itself in the administrative task scheduler to the next specified time window.

Procedure

To specify time windows during which the ADMIN_UTL_EXECUTE stored procedure can invoke the RUNSTATS utility to resolve statistics alerts:

Insert rows into the SYSIBM.SYSAUTOTIMEWINDOWS catalog table.
Each row describes a single time window for a particular Db2 member. Any row that does not specify a member (contains a NULL value) applies to all Db2 members.
For example, you might issue the following INSERT statements to create the specified time windows.
Every Monday from 12 midnight to just before midnight Tuesday, allowing 10 parallel tasks
You might issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH,DAY, FROM_TIME, TO_TIME, ACTION, MAX_TASKS)
		VALUES(NULL,'W',NULL,1,'00:00','23:59:59',NULL,10);
The following statement also achieves the same result:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME, ACTION, MAX_TASKS)
		values(NULL,'W',NULL,1,NULL,NULL,NULL,10);
Every Monday in January from 12 midnight to 12 noon, allowing 5 parallel tasks
Issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME ,ACTION, MAX_TASKS)
		VALUES(NULL,'W',1,1,'00:00','12:00:00',NULL,5);
The first day of each month from 12 midnight to 12 noon, allowing 5 parallel tasks
You might issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME ,ACTION, MAX_TASKS)
		VALUES(NULL,'M',NULL,1,'00:00','12:00:00',NULL,5);
Each first day of June from 08 a.m. to 2 p.m., allowing 5 parallel tasks
Issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME ,ACTION, MAX_TASKS)
		VALUES(NULL,'M',6,1,'08:00','14:00:00',NULL,5);
Every Sunday from 12 midnight to 12 noon, allowing 5 parallel tasks, on member DSN1
Issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME ,ACTION, MAX_TASKS)
		VALUES('DSN1','W',NULL,7,'00:00','12:00:00',NULL,5);
Every Sunday from 12 midnight to 12 noon, allowing 5 parallel tasks, on member DSN1, allowing only RUNSTATS alerts
Issue the following statement:
INSERT INTO SYSIBM.SYSAUTOTIMEWINDOWS(DB2_SSID, MONTH_WEEK, 
	MONTH, DAY, FROM_TIME, TO_TIME ,ACTION, MAX_TASKS)
		VALUES('DSN1','W',NULL,7,'00:00','12:00:00','RUNSTATS',5);
End program-specific programming interface information.