Data sharing is only as available as the coupling facility structures behind it. This page covers how DB2 recovers when a group buffer pool, the SCA, or the lock structure fails; how duplexing and structure rebuild differ; what REBUILDPERCENT means; how member failover works; and how to think about performance and first-aid troubleshooting.
IBM splits CF problems into:
A channel (link) failure is statistically more common than a whole CF death if you have only one link. Dual CF links and a preference list of two CFs in the CFRM policy are the hardware story; duplexing is the software twin.
Duplexing means z/OS maintains two allocated instances of a structure. Writes go to both. If one instance fails, Db2 deallocates the bad copy and keeps running on the good one. That switch is usually fast. You then repair the CF and reestablish duplexing (SETXCF START,POL or the duplexing rebuild Db2/z/OS drives when DUPLEX(ENABLED) is in the policy).
| Structure | If duplexed | If simplexed |
|---|---|---|
| GBPn | Continue on surviving instance; recast duplexing later | AUTOREC or manual recovery from log; more disruptive |
| SCA | Continue on surviving instance | Rebuild from virtual storage; group restart if that fails |
| LOCK1 | Continue on surviving instance | Rebuild from storage; cost depends on modify locks held |
Changed pages that would otherwise live in only one GBP are also in the secondary. Castout still runs from the primary; the secondary is for failover, not a second castout engine. GBP duplexing protects against losing changed pages that have not yet been written to disk. It costs extra CF cache bandwidth. Many production groups duplex GBP0 (catalog and directory) and the busy user GBPs.
The shared communications area (SCA) holds group-wide control information. LOCK1 holds the lock table and modify-lock list. Duplexing them avoids bringing members down when a single CF or link is lost. Simplexed SCA rebuild from virtual storage is usually quick. Simplexed lock rebuild is also often quick, but elapsed time grows with the number of modify locks held at the failure.
If Db2 cannot rebuild simplexed SCA and LOCK1 from member storage into an alternate CF (preference list + enough CF storage), IBM documents that all active members abend and you perform a group restart so the structures can be rebuilt from the logs. That is the nightmare scenario duplexing is meant to avoid.
A rebuild allocates a new structure (often on another CF) and copies or reconstructs content. Operators can request it with SETXCF START,REBUILD. Automatic rebuild depends on:
Rebuild of a simplexed GBP is the painful case: Db2 tries to allocate the current size on the alternate CF. If storage cannot be allocated, changed pages are written to disk instead of staying in the GBP. AUTOREC(YES) on the GBP can start automatic recovery; otherwise you may need START DATABASE to pull pages from the log. Plan CF SIZE so a rebuild target actually fits.
REBUILDPERCENT is an SFM policy keyword, not a Db2 DSNZPARM. z/OS computes a weighted loss of systems’ connectivity to the structure. Roughly:
The exact tables differ slightly for SCA, LOCK1, and non-duplexed GBPs, but the idea is the same: SFM + REBUILDPERCENT decide “rebuild in place” versus “sacrifice the member.” Duplexed structures often switch to the copy with good connectivity instead of taking that rebuild-or-die choice.
Member failure (abend, z/OS outage) is not the same as CF failure. Work should move: sysplex distributor / DVIPA for DDF, CICSPlex for CICS, WLM for batch. The failed member still holds retained locks (modify locks left in LOCK1) until restart recovery runs. Other members cannot update those protected pages. Restart the member as soon as the LPAR is up. Deferring restart of objects with retained page set P-locks can put pages on the logical page list (LPL) so the rest of the page set is not locked out—an advanced recovery tactic, not a first-day habit.
Group restart is heavier: the group cannot form until SCA/LOCK1 are rebuilt from logs. Disaster-recovery playbooks also talk about a single surviving member at a remote site (lock structure + SCA still required; GBPs can be small after you are truly one-system).
Logs are shared in the sense that every member can read the others’ logs. Recovery uses LRSN (log record sequence number), not a single-subsystem RBA, when you name a point in time.
Recovery design and performance share the same structures. Watch:
Application COMMIT frequency still matters: long units of work hold modify locks in the record list and make a lock-structure rebuild slower. Binding with a reasonable isolation (CS, currently committed) reduces real contention that recovery later has to wait on.
1234567-DISPLAY GROUP DETAIL -DISPLAY GBPOOL(GBP0) GDETAIL -DISPLAY BUFFERPOOL(BP0) GDETAIL D XCF,STR D XCF,STR,STRNAME=DSNCAT_LOCK1 D XCF,STR,STRNAME=DSNCAT_SCA D XCF,STR,STRNAME=DSNCAT_GBP0
The coupling facility is a shared whiteboard. Duplexing is writing on two whiteboards in two rooms so if one room’s lights go out, the other still has the notes. Rebuild is grabbing a new whiteboard and copying everything over. REBUILDPERCENT is the fire-alarm rule: if enough kitchens lose the hallway, automatically copy the board; if only one kitchen loses it, that kitchen sits down until someone fixes the door. Failover is sending the cooks to another kitchen. Retained locks are “nobody else may touch this pot until the missing cook comes back and says what happened.”
1. If a duplexed group buffer pool instance fails, what does Db2 typically do?
2. What is REBUILDPERCENT used for?
3. If simplexed SCA and lock structure rebuild from virtual storage fails, what happens?
4. What are retained locks?
5. Why is rebuilding a simplexed GBP more painful than a duplexed GBP failover?