DB2 data sharing concepts

Data sharing is the DB2 for z/OS feature that lets several Db2 subsystems — members of one group — read and write the same data with cache coherency and global locking. This page is the vocabulary: member, group, Coupling Facility, SCA, group buffer pools and their duplexing, SCA duplexing, member and group recovery, XES, XCF, CFLEVEL, and the CFRM policy.

Data sharing
Progress0 of 0 lessons

Data sharing concepts in one picture

Start from a standalone subsystem: one catalog, one set of logs, one IRLM, local buffer pools. Enable data sharing and that subsystem becomes member DB2A in group DSNDB2P (names vary). You add member DB2B on another LPAR. Both open the same table spaces. When they both care about the same page set for update, Db2 uses the Coupling Facility so their local buffers do not lie to them.

text
1
2
3
4
5
6
7
Group DSNDB2P group attach DB2P Member DB2A on ZOS1 (MSTR, DBM1, IRLM, DIST, …) Member DB2B on ZOS2 CF structures: DSNDB2P_SCA DSNDB2P_LOCK1 DSNDB2P_GBP0, DSNDB2P_GBP1, …

Member

A member is a full Db2 subsystem: it has a four-character SSID, its own address spaces, its own BSDS and logs, and its own local buffer pool sizes. You START and STOP it independently. DISPLAY GROUP shows ACTIVE, FAILED, or QUIESCED. You can add members for incremental capacity and quiesce them in the off-season. Up to 32 members can belong to one group.

Work can run on any member. CICS, batch, and JDBC usually use the group attach name so they do not care which member is up. Member-unique attach is still used for utilities that must run on a specific member.

Group

The group is the shared identity: one catalog and directory, one set of user databases, one set of CF structure names prefixed by the group name. Commands and binds that have group scope (many DSN BIND subcommands, BACKUP SYSTEM) take effect for every member. Operator commands like START DB2 are still member-scoped — you start DB2A, not “the group” as a single address space.

What is shared versus private
ObjectShared?
SSID / member nameNo — unique per member
BSDS and logsNo — each member has its own
Catalog and directoryYes — one set for the group
User table spacesYes — shared DASD
Local buffer poolsNo — each DBM1 has its own BPn
Group buffer poolsYes — in the CF
SCA and LOCK1Yes — one of each per group

Coupling Facility

A Coupling Facility is a z/OS CF LPAR (external or integrated) that holds structures. Db2 does not store table spaces in the CF. It stores coherence and locking state and a cache of changed pages. At least two CFs are the HA baseline. CF storage is carved by the CFRM policy, not by CREATE TABLESPACE.

SCA and SCA duplexing

The shared communications area (groupname_SCA) is allocated by ssnmMSTR. It holds member and BSDS names, exception statuses, and recovery information (including indoubt lists) and helps coordinate startup. Without an SCA the group cannot run.

SCA duplexing is system-managed: XES keeps a secondary structure on another CF; Db2 talks to one logical SCA. Use it when the SCA is not failure-isolated from the members (typical ICF-on-same-CEC layouts). If the SCA is on a failure-isolated external CF and rebuild to a second CF works, some shops run SCA simplex. Under-allocate the SCA and exception-state information will not fit — that is an availability bug.

Group buffer pool and GBP duplexing

A group buffer pool maps one-for-one to a local buffer pool name: GBP0 for BP0, GBP1 for BP1, and so on. When a page set is GBP-dependent, changed pages go to the GBP and directory entries drive cross-invalidation of local buffers. DBM1 allocates the GBP.

Group buffer pool duplexing is user-managed: Db2 knows there is a primary and a secondary and writes changed pages to both. IBM strongly recommends it. If the primary CF fails, the secondary already has the changed pages. You do not duplex “the catalog” this way — you duplex GBP0, which happens to cache catalog pages when they are GBP-dependent.

Member recovery and group recovery

Member recovery

One member abends or you STOP it. Others keep running. Restart that member from its BSDS and logs (normal restart recovery). Retained locks in LOCK1 protect its uncommitted changes until restart (or LIGHT restart) completes. This is everyday operations.

Group recovery

SCA and/or LOCK1 are lost and cannot be rebuilt. All members come down. Group restart rebuilds those structures from every member’s log. Started members can peer-restart inactive members by reading their logs, but you should start all non-quiesced members for availability. Group recovery is not RECOVER TABLESPACE and not remote DR.

XCF and XES

XCF (cross-system coupling facility) is the z/OS signalling and group membership layer. Sysplex members join XCF groups; D XCF,GROUP shows them. Db2 data sharing sits on that membership.

XES (cross-system extended services) is the programming interface to CF structures: connect, read, write, rebuild, duplex. IRLM uses XES for LOCK1; Db2 uses XES for SCA and GBPs. When people say “XES lock” they mean the CF lock structure path, not a COBOL LOCK TABLE statement.

text
1
2
3
4
D XCF,GROUP D XCF,STR D XCF,STR,STRNAME=DSNDB2P_SCA -DIS GROUP

CFLEVEL

CFLEVEL is the CFCC (Coupling Facility Control Code) level. Structure functions — including flavors of duplexing and Auto Alter behavior — require a minimum CFLEVEL. Both CFs in a duplex pair must support the functions you encoded in the policy. After a CF upgrade, confirm CFLEVEL before you assume asynchronous lock duplexing or a new structure option is actually available.

CFRM policy

The CFRM policy is the z/OS definition of every structure:

  • STRNAME — DSNDB2P_SCA, DSNDB2P_LOCK1, DSNDB2P_GBP0, …
  • SIZE / INITSIZE / MINSIZE — allocation and Auto Alter bounds
  • PREFLIST — which CFs may host the structure, in order
  • DUPLEX — ENABLED / ALLOWED / DISABLED depending on structure type
  • ALLOWAUTOALT — let z/OS grow the structure

Activate the policy with SETXCF. Db2 cannot invent a GBP that is missing from CFRM. Rebuild uses the current SIZE on the alternate CF; if that CF cannot allocate enough, rebuild fails. Changing SIZE for LOCK1’s lock table may require a rebuild, not just Auto Alter.

Operators also use SETXCF FORCE,STRUCTURE in recovery situations — that is a sharp tool. DISPLAY XCF,STR is the safe everyday view.

Explain It Like I'm Five

A data sharing group is several teachers sharing one classroom library. Each teacher (member) has their own desk and notebook (logs). The hallway whiteboard (SCA) lists who is in today. The lock box (LOCK1) stops two teachers grabbing the same book. The shared fridge (GBP) keeps the latest leftovers. XCF is the school intercom; XES is the rulebook for using the hallway fridge. The CFRM policy is the principal’s poster that says how big the fridge is and which building it lives in. CFLEVEL is the model year of the fridge. If one teacher goes home sick, class continues. If the whiteboard is destroyed and there is no spare, school stops until you rebuild it from everyone’s notebooks.

Exercises

  1. For your site, name the group, group attach, and two member SSIDs.
  2. List three things that are member-private and three that are group-shared.
  3. Write the likely CF structure names for group PRODDB2 for SCA, LOCK1, and GBP0.
  4. When would you duplex the SCA, and when might rebuild on a second CF be enough?
  5. Use D XCF,STR (or a saved listing) to find SIZE and PREFLIST for the lock structure.

Quiz

Test Your Knowledge

1. What is a Db2 data sharing member?

  • A table space type
  • One Db2 subsystem that belongs to a data sharing group and shares catalog, directory, and user data with the other members
  • Only a DDF location
  • A FlashCopy relationship

2. What does the group attach name do?

  • Names a buffer pool
  • Lets TSO, batch, and CICS attach to any active member without hard-coding a member SSID
  • Replaces the catalog
  • Starts the CF

3. What is a CFRM policy?

  • A COBOL special register
  • The z/OS Coupling Facility Resource Management policy that names structures, SIZE/INITSIZE, preference lists, and duplexing
  • A BIND option
  • Only a RACF profile

4. XCF versus XES:

  • They are identical
  • XCF is cross-system coupling signalling between z/OS images; XES is the extended services API used to access CF structures
  • XES is only for TCP/IP
  • XCF stores table data

5. What is duplexed for GBPs versus SCA?

  • Nothing can be duplexed
  • GBPs use user-managed duplexing (Db2 writes both copies); SCA (and often LOCK1) use system-managed duplexing via XES when not failure-isolated
  • Only BSDS dual copy
  • Only archive logs

Frequently Asked Questions