Personal tools
You are here: Home DB2 Problem Resolution Functions and Stored Procedures AUTOMAINT_SET_POLICYFILE procedure can fail with a misleading error message.
Navigation
Log in


Forgot your password?
 
Document Actions

AUTOMAINT_SET_POLICYFILE procedure can fail with a misleading error message.

The AUTOMAINT_SET_POLICYFILE procedure can fail with a misleading error message because of lack of table privileges. This usually happens if the database has been created by restoring the db from another environment (different db/instance name) and the privileges on systools.policy are not carried out.

Here is the the error:

db2 "call sysproc.automaint_set_policyfile('MAINTENANCE_WINDOW', 'DB2MaintenanceWindowPolicy.xml')"

SQL1438N  An internal error occurred while processing the XML automated
maintenance policy configuration file or LOB parameter passed to
AUTOMAINT_SET_POLICY or AUTOMAINT_SET_POLICYFILE.  SQLSTATE=5U0ZZ

***note that in this case the DB2MaintenanceWindowPolicy.xml has no code errors.

Here is the fix:

db2 grant all on systools.policy to <user id>
DB20000I  The SQL command completed successfully.

db2 "call sysproc.automaint_set_policyfile( 'MAINTENANCE_WINDOW', 'DB2MaintenanceWindowPolicy.xml')"

  Return Status = 0

Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls