DB2 Version 10.1 for Linux, UNIX, and Windows

AUTOMAINT_GET_POLICY procedure - retrieve automatic maintenance policy

The AUTOMAINT_GET_POLICY system stored procedure retrieves the automatic maintenance configuration for the database. This procedure takes two parameters: the type of automatic maintenance about which to collect information; and a pointer to a BLOB in which to return the configuration information. The configuration information is returned in XML format.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-AUTOMAINT_GET_POLICY--(--policy_type--,--policy--)----------><

The schema is SYSPROC.

Procedure parameters

policy_type
An input argument of type VARCHAR(128) that specifies the type of automatic maintenance policy to retrieve. The argment can be one of the following values:
AUTO_BACKUP
automatic backup
AUTO_REORG
automatic table and index reorganization
AUTO_RUNSTATS
automatic table runstats operations
MAINTENANCE_WINDOW
maintenance window
policy
An output argument of type BLOB(2M) that specifies the automatic maintenance settings for the given policy type, in XML format.

Authorization

One of the following authorities is required to execute the routine:
  • EXECUTE privilege on the routine
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority

Default PUBLIC privilege

None

Example

Here is an example of a call to the AUTOMAINT_GET_POLICY procedure from within embedded SQL C source code.

EXEC SQL BEGIN DECLARE SECTION;            
SQL TYPE IS BLOB(2M) backupPolicy;        
EXEC SQL END DECLARE SECTION;         

EXEC SQL CALL AUTOMAINT_GET_POLICY( 'AUTO_BACKUP', :backupPolicy );