The DB2 Directory

 <  Day Day Up  >  

Many DB2 application developers are unaware that DB2 uses a second dictionary-like structure in addition to the DB2 Catalog. This is the DB2 Directory. Used for storing detailed, technical information about aspects of DB2's operation, the DB2 Directory is for DB2's internal use only.

The DB2 Directory is composed of five "tables." These tables, however, are not true DB2 tables because they are not addressable using SQL. From here on, they are referred to as structures instead of tables. These structures control DB2 housekeeping tasks and house complex control structures used by DB2. See Figure 22.7 for a summation of the relationships between the DB2 Catalog, the DB2 Directory, and DB2 operations. The objects in the DB2 Directory can be listed by issuing the following command:

 

 -DIS DB(DSNDB01) SPACE(*) LIMIT(*) 

Figure 22.7. The DB2 Directory.

graphics/22fig07.gif


A quick rundown of the information stored in the DB2 Directory is in the following sections.

SCT02

The SCT02 structure holds the skeleton cursor tables (SKCTs) for DB2 application plans. These skeleton cursor tables contain the instructions for implementing the access path logic determined by the DB2 optimizer.

The BIND PLAN command causes skeleton cursor tables to be created in the SCT02 structure. Executing the FREE PLAN command causes the appropriate skeleton cursor tables to be removed from SCT02 . When a DB2 program is run, DB2 loads the skeleton cursor table into an area of memory called the EDM Pool to enable execution of the SQL embedded in the application program.

SPT01

Similar to the skeleton cursor tables are skeleton package tables which are housed in the SPT01 DB2 Directory structure. The skeleton package tables contain the access path information for DB2 packages.

The BIND PACKAGE command causes skeleton package tables to be created in the SPT01 structure. Executing the FREE PACKAGE command causes the appropriate skeleton package tables to be removed from the DB2 Directory. When running a DB2 program that is based on a plan with a package list, DB2 loads both the skeleton cursor table for the plan and the skeleton package tables for the packages into memory to enable execution of the SQL embedded in the application program.

DBD01

Database descriptors, or DBDs, are stored in the DBD01 DB2 Directory structure. A DBD is an internal description of all the DB2 objects defined within a database. DB2 uses the DBD as an efficient representation of the information stored in the DB2 Catalog for these objects. Instead of accessing the DB2 Catalog for DB2 object information, DB2 accesses the DBD housed in the DB2 Directory because it is more efficient to do so.

The DBD in the DB2 Directory can become out of sync with the physical DB2 objects that it represents, but this is unlikely . If this does happen, you will encounter many odd and unexplainable abends. The situation can be corrected using the REPAIR DBD utility, which is covered in Chapter 32, "Backup and Recovery Utilities." Furthermore, the REPAIR DBD TEST DATABASE utility can be run to detect when a DBD is out of sync with the actual physical objects.

SYSUTILX

DB2 monitors the execution of all online DB2 utilities. Information about the status of all started DB2 utilities is maintained in the SYSUTILX DB2 Directory structure. As each utility progresses, the step and its status are recorded. Utility restart is controlled through the information stored in SYSUTILX .

Note that this structure maintains information only for started DB2 utilities. There are two "tables" within the SYSUTILX tablespace: SYSUTIL and SYSUTILX . Each utility step consumes a separate row, or record, in SYSUTIL , and in SYSUTILX when the amount of information exceeds the capacity of SYSUTIL . When the utility finishes normally or is terminated , all information about that utility is purged from SYSUTIL and SYSUTILX .

SYSLGRNX

The RBA ranges from the DB2 logs are recorded on SYSLGRNX for tablespace updates. When recovery is requested , DB2 can efficiently locate the required logs and quickly identify the portion of those logs needed for recovery.

 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net