DB2 Version 10.1 for Linux, UNIX, and Windows

Configuring an automated maintenance policy using SYSPROC.AUTOMAINT_SET_POLICY or SYSPROC.AUTOMAINT_SET_POLICYFILE

You can use the system stored procedures AUTOMAINT_SET_POLICY and AUTOMAINT_SET_POLICYFILE to configure the automated maintenance policy for a database.

Procedure

To configure the automated maintenance policy for a database, perform the following steps:

  1. Connect to the database
  2. Call AUTOMAINT_SET_POLICY or AUTOMAINT_SET_POLICYFILE
    • The parameters required for AUTOMAINT_SET_POLICY are:
      1. Maintenance type, specifying the type of automated maintenance activity to configure.
      2. Pointer to a BLOB that specifies the automated maintenance policy in XML format.
    • The parameters required for AUTOMAINT_SET_POLICYFILE are:
      1. Maintenance type, specifying the type of automated maintenance activity to configure.
      2. The name of an XML file that specifies the automated maintenance policy.
    Valid maintenance type values are:
    • AUTO_BACKUP - automatic backup
    • AUTO_REORG - automatic table and index reorganization
    • AUTO_RUNSTATS - automatic table RUNSTATS operations
    • MAINTENANCE_WINDOW - maintenance window

What to do next

You can use the system stored procedures AUTOMAINT_GET_POLICY and AUTOMAINT_GET_POLICYFILE to retrieve the automated maintenance policy configured for a database.