Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 2: DB2 Architecture


DB2 Components

Inside the DB2 subsystem there are several managers, each responsible for one part of the work. Together they are called the DB2 components. The main ones are the buffer manager, the log manager, the lock manager, the catalog, the utilities and the attachment facilities.

The core managers

  • Buffer manager - Moves data pages between DASD and the buffer pools, and writes changed pages back to disk at the right time.
  • Log manager - Writes every data change to the active log first (write-ahead logging) so that DB2 can recover after a failure.
  • Lock manager (IRLM) - Grants and releases locks on tables, pages and rows so concurrent programs do not corrupt each other's data.
  • Catalog and directory - The data dictionary of DB2. The catalog (DSNDB06) describes every object; the directory (DSNDB01) holds internal control information.

Utilities and attachment facilities

  • Utilities - Programs like LOAD, UNLOAD, REORG, RUNSTATS, COPY and RECOVER that maintain tables and indexes. They run as batch jobs with their own JCL.
  • Attachment facilities - The doors through which programs reach DB2: TSO attachment (for SPUFI and batch), CAF (call attachment), RRSAF, CICS attachment and IMS attachment.
  • Your COBOL program never talks to DB2 directly; it calls the attachment facility, which passes the SQL to the DB2 components.
  • Example - check what is running right now:-
    -DISPLAY THREAD(*) -DISPLAY UTILITY(*)
  • -DISPLAY THREAD(*) lists every application connected through an attachment facility. -DISPLAY UTILITY(*) lists running utilities.

Storage groups - where data physically lives

  • A storage group is a named set of DASD volumes that DB2 uses when it creates tablespaces and indexes. It is defined once with SQL.
  • Example:-
    CREATE STOGROUP SGPROD VOLUMES ('VOL001','VOL002') VCAT PRODCAT;
  • After this, CREATE TABLESPACE ... USING STOGROUP SGPROD tells DB2 to allocate space on those volumes. The DBA manages volumes; developers just name the storage group.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant