< Day Day Up > |
To determine when to reorganize the system catalog, DBAs can use most of the same basic indicators used to determine whether application table spaces should be reorganized. Although it always has been a wise course of action to execute RUNSTATS on the DB2 Catalog table spaces, it becomes even more important now that these table spaces can be reorganized. These statistics can be analyzed to determine when a REORG should be run. When RUNSTATS is run for a catalog table space, the statistics about that system catalog table space are gathered and then stored in the DB2 Catalog tables themselves . In general, the following indicators and situations should be reviewed when determining when to reorganize your system catalog table spaces and indexes:
For the SYSDBASE , SYSVIEWS , and SYSPLAN catalog table spaces, the value for the FAROFFPOSF and NEAROFFPOSF columns of SYSINDEXPART can be higher than for other table spaces before they need to be reorganized. Additionally, you can use REORG when it is necessary to move the DB2 Catalog and Directory to a different disk device. Synchronizing System Catalog ReorganizationIt is a more difficult prospect to determine when the DB2 Directory table spaces should be reorganized. The RUNSTATS utility does not maintain statistics for these "table spaces" like it can for the DB2 Catalog. However, it is possible to base the reorganization of the DB2 Directory table spaces on the reorganization schedule of the DB2 Catalog table spaces. In fact, in certain situations, it is imperative that specific DB2 Directory table spaces are reorganized when a "companion" DB2 Catalog table space is reorganized. The chart in Table H.1 provides information on keeping the DB2 catalog and DB2 directory table spaces "in sync." Table H.1. DB2 Directory Reorganization Indicators
These table spaces are logically related . DB2 requires that you reorganize them at the same time to keep them synchronized. DB2 Catalog Reorganization DetailsThere are 20 DB2 Catalog table spaces and six DB2 Directory table spaces (refer to Tables H.2 and H.3). DB2 has different rules for different sets of these table spaces. There are three groupings of table spaces:
Table H.2. DB2 Catalog Table Spaces ( DSNDB06 )
Table H.3. DB2 Directory Table Spaces ( DSNDB01 )
There are only two table spaces in the first grouping of table spaces that cannot be reorganized at all: DSNDB01.SYSUTILX and DSNDB01.SYSLGRNX . Do not attempt to reorganize these table spaces as DB2 will not permit it. The second grouping of table spaces must be processed differently than other table spaces:
These six table spaces require special "handling and care." Because they have a different internal configuration than most other table spaces, a different calculation is required for the size of the unload data set ( SYSREC ) used during the REORG utility. These table spaces contain internal links. Links are internal pointers that tie the information in their tables together hierarchically. A link can be thought of as a type of parent-child relationship in which, due to these links, the BUILD and SORT phases of the REORG utility are not executed. The WORKDDN , SORTDATA , SORTDEVT , and SORTNUM options are ignored when reorganizing these table spaces. Also, the REORG utility cannot be restarted from the last checkpoint when used against these six table spaces. Instead, it must be restarted from the beginning of the phase. Finally, as mentioned before, a different set of steps must be executed during reorganization for these table spaces. All other DB2 Catalog and DB2 Directory table spaces can be reorganized like any other DB2 table space. Keep in mind that the LOB table spaces in the DB2 Catalog are under the same restrictions as any other LOB table space regarding DB2 utilities. Steps to REORG the Six "Special" Table SpacesThe following steps should be used when reorganizing the six "special" table spaces:
Furthermore, keep in mind that these six table spaces cannot be reorganized using specifying SHRLEVEL CHANGE . And finally, the SORTDATA , SORTDEVT , SORTNUM , and SORTKEYS options are ignored for these table spaces. Steps to REORG Regular Table SpacesThe following steps should be used when reorganizing the remaining "regular" system catalog and directory table spaces:
These steps should be familiar to you because they closely follow the steps executed during the reorganization of an application data table space. There are several additional required steps added as precautions because of the critical nature of the DB2 catalog and directory. NOTE It is important to take a full image copy before and after reorganizing any DB2 catalog or directory table space. Catalog Reorganization RestrictionsIn addition to the procedures outlined previously, there are several restrictions on the manner in which the REORG TABLESPACE utility can be used with system catalog table spaces. First, recall that the SYSUTILX and SYSLGRNX table spaces in the DB2 Directory cannot be reorganized. When reorganizing the DB2 Catalog ( DSNDB06 ) and DB2 Directory ( DSNDB01 ) table spaces, the following options cannot be used:
Also, the reorganization of two specific table spaces are treated differently than any other in the manner in which they are tracked by DB2. Generally, DB2 records the reorganization of any table space in the SYSIBM.SYSCOPY system catalog table. However, DB2 records the reorganization of the DSNSB06.SYSCOPY and DSNDB01.DBD01 table spaces in the log instead. You cannot collect inline statistics on the following DB2 Catalog and DB2 Directory table spaces:
Finally, in many 24x7 environments, it may be necessary to reorganize the system catalog and dictionary while it is being accessed. However, because of the central nature of the system catalog and directory to the operation of DB2, the following restrictions apply to concurrent activity during catalog reorganization:
The ability to reorganize the DB2 catalog and directory table spaces provides the DBA with a potent tool for his or her system tuning arsenal. Take the Proper Image CopiesFinally, be sure to take a full image copy both before and after reorganizing any DB2 Catalog or DB2 Directory object. Failure to do so can result in an unrecoverable system table ”a situation which is best avoided at all costs. |
< Day Day Up > |