AUTOMAINT_SET_POLICYFILE procedure - configure automatic maintenance policy
You can use the AUTOMAINT_SET_POLICYFILE system stored procedure to configure automatic maintenance for the database.
This procedure takes two parameters: the type of automatic maintenance to configure; and the name of an XML document that specifies the configuration.
This procedure return the SQL success or SQL error code.
Authorization
- EXECUTE privilege on the routine
- DATAACCESS authority
- DBADM authority
- SQLADM authority
Default PUBLIC privilege
None
Syntax
The schema is SYSPROC.
Procedure Parameters
-
policy_type
- An input argument of type VARCHAR(128) that specifies the type
of automatic maintenance policy to configure. The argument 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_file_name
- An input argument of type VARCHAR(2048) that specifies the name of the file that is available in the tmp subdirectory of the database instance directory.
Example
To modify the current automatic maintenance settings for automatic backup:
call sysproc.automaint_set_policyfile( 'AUTO_BACKUP', 'AutoBackup.xml' )
This will replace the current automatic backup configuration settings with the new configuration contained in the AutoBackup.xml file located in the tmp directory under the database instance directory.
There are sample XML input files located in the SQLLIB/samples/automaintcfg directory which can be used as reference to create policy xml files.
