Saturday, April 26, 2014

Where are DB2 plans , DB2 packages stored?

Recollecting from the DB2 architecture, we know when DB2 gets installed  on Z/OS,  the following system objects are created: DB2 Directory,catalog... as shown below.
DB2 SYSTEM Objects. We need all these components to run our DB2 on Z/OS.


 There are  system databases like DSNDB01, DSNDB06, DSNDB07 on which all these system objects resides on.
DB2 Directory resides in DSNDB01 database and this database contains 5 Table spaces.
SCT02 : knows as Skeleton Cursor table
SPT01 : Known as the Skeleton Package  table
SYSLGRNX : Log range. This table space maintains the log whenever a table or index is opened or closed.
SYSUTILX:  Maintains a row when ever any utility is running and Row persists till utility runs. If the utility is terminated, db2 uses the information in the row to restart.
DBD02 : Contains information about the databases that exists within the sub system.

Whenever we issue a bind against our  SQL statements onto a plan, a DB2 structure is created in the SCT02 Table space.
If we do a package bind, a similar structure is created in the SPT01 table space.
When executing the db2 program, these structures are loaded  from  SCT02 or SPT01 into the EDM pool.

So,We are creating and maintaining one form of  DB2 internal structure corresponding to the SQL statements in our Cobol-db2 program inside the DB2 directory(either in SCT02 or SPT01). and this is where the plans/packages are stored.
We cannot view this structure inside this directory..
On a broader sense, we cannot view anything in  DB2 directory. This Directory is only for DB2 internal use.
 However information about the package or the plan are written on to the DB2 CATALOG  tables like SYSIBM.SYSPLAN, SYSIBM.SYSPACKAGE and others. These table we can query and gather the required information as and when needed.

No comments:

Post a Comment