< Day Day Up > |
The REPAIR DBD OptionThe REPAIR utility can be used to test, maintain, and modify DB2 database information. DB2 maintains database information in the DB2 Catalog SYSIBM.SYSDATABASE table. An object known as a DBD is also maintained in the DB2 Directory in the SYSIBM.DBD01 "table." You can use the REPAIR option with the DBD specification to perform the following functions:
Listing 31.5 contains sample JCL to REPAIR the DBD for the DSN8D51A sample database. Listing 31.5. REPAIR DBD JCL//DB2JOBU JOB (UTILITY),'DB2 REPAIR DBD',MSGCLASS=X,CLASS=X, // NOTIFY=USER //* //**************************************************************** //* //* DB2 REPAIR UTILITY : : DBD REPAIR //* //**************************************************************** //* //UTIL EXEC DSNUPROC,SYSTEM=DSN,UID='REPRDBD',UTPROC=" //* //* UTILITY INPUT CONTROL STATEMENTS //* The first REPAIR statement builds a DBD based on //* the DB2 Catalog and compares it to the corresponding //* DBD in the DB2 Directory. //* The second REPAIR statement reports inconsistencies, //* if any exist. //* //DSNUPROC.SYSIN DD * REPAIR DBD TEST DATABASE DSN8D61A REPAIR DBD DIAGNOSE DATABASE DSN8D81A OUTDDN SYSREC /* // REPAIR DBD GuidelinesLog All RepairsRun the REPAIR utility with the LOG YES option. This ensures that all data changes are logged to DB2 and are therefore recoverable. Consult IBM Before Using DROP or REBUILDDo not issue the REPAIR DBD utility with the DROP or REBUILD option without consulting your IBM Support Center. These options can be dangerous if used improperly. Use TEST and DIAGNOSE for Error ResolutionWhen databases, or their subordinate objects, exhibit peculiar behavior, consider executing REPAIR DBD with the TEST option. If this run returns a condition code other than 0, run REPAIR DBD with the DIAGNOSE option and consult your IBM Support Center for additional guidance. You should also consider implementing a regularly scheduled REPAIR DBD run to consistently check for problems. |
< Day Day Up > |