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

Module 12: CICS Resource Definitions and Administration


DB2 Definitions

Programs that run SQL under CICS reach DB2 through the CICS DB2 attachment facility. Three definition types wire it up: DB2CONN, DB2ENTRY and DB2TRAN.

The three DB2 definition types

  • DB2CONN - one per CICS region. Holds the region-wide connection to a DB2 subsystem: which DB2, which plan exit, thread limits, accounting.
  • DB2ENTRY - one per application or plan. Says which DB2 plan a group of transactions uses, plus its own thread and accounting options.
  • DB2TRAN - routes a transaction id to a DB2ENTRY. A transaction without a DB2TRAN uses the pool entry defined on the DB2CONN.
  • Together they decide: can this transaction reach DB2, with which plan, and how many threads it may hold.

Key attributes

  • DB2CONN: DB2ID (subsystem name), PLAN (default plan), PLANEXITNAME (dynamic plan exit), THREADLIMIT, TCBLIMIT, ACCOUNTREC (NONE/TASK/TXID), AUTHTYPE and COMAUTHTYPE (how the DB2 authorization id is picked), STANDBYMODE, CONNECTERROR.
  • DB2ENTRY: TRANSID or the entry name, PLAN, PLANEXITNAME, ACCOUNTREC, AUTHTYPE, DROLLBACK (rollback on deadlock), THREADLIMIT.
  • DB2TRAN: TRANSID (the CICS transaction), ENTRY (which DB2ENTRY it uses), PLAN override.
  • ACCOUNTREC controls SMF accounting records - TASK gives per-task data, TXID groups by transaction.

Connecting and disconnecting

  • The DB2CONN is installed like any resource with CEDA INSTALL GROUP.
  • The connection itself is started with CEMT SET DB2CONN CONNECTED or the CDBN transaction, and stopped with CDBQ/CDBF.
  • A program's first SQL call grabs a thread; thread reuse settings on the DB2ENTRY control performance.

Example - connect a region and give the ORD1 transaction its own plan:

CEDA DEFINE DB2CONN(DB2C) GROUP(DB2GRP) DB2ID(DB2P) PLAN(ORDPLAN) THREADLIMIT(50) ACCOUNTREC(TASK) AUTHTYPE(USERID) CEDA DEFINE DB2ENTRY(ORDENT) GROUP(DB2GRP) TRANSID(ORD1) PLAN(ORDPLAN) ACCOUNTREC(TASK) CEDA DEFINE DB2TRAN(ORD1) GROUP(DB2GRP) TRANSID(ORD1) ENTRY(ORDENT) CEDA INSTALL GROUP(DB2GRP)





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant