DB2 storage management: STOGROUP, SMS, and VSAM data sets

Every table and index in DB2 for z/OS sits on VSAM linear data sets. You rarely type IDCAMS DEFINE CLUSTER. You create a storage group, point table spaces at it, and let Db2 plus SMS place extents on DASD. This page covers CREATE / ALTER / DROP STOGROUP, VCAT, storage paths, data set naming, DSSIZE, PRIQTY, SECQTY, extents, and the special cases of LOB, XML, and work files.

Storage management
Progress0 of 0 lessons

Storage groups

A STOGROUP is a Db2 catalog object, not an SMS storage group (though they work together). It names:

  • VCAT — ICF catalog / high-level qualifier for Db2-managed clusters
  • VOLUMES — explicit VOLSERs, or * for SMS
  • Optional DATACLAS, MGMTCLAS, STORCLAS passed to DFSMS at DEFINE time
STOGROUP DDL
StatementRole
CREATE STOGROUPDefine VCAT, volumes or *, optional SMS classes
ALTER STOGROUPADD/REMOVE VOLUMES, change DATACLAS/MGMTCLAS/STORCLAS
DROP STOGROUPRemove the catalog object when unused
sql
1
2
3
4
5
6
7
8
9
10
11
CREATE STOGROUP HRSTO VOLUMES ('*') VCAT DB2T DATACLAS DB2DATA MGMTCLAS DB2MGMT STORCLAS DB2STOR; ALTER STOGROUP HRSTO DATACLAS DB2DATA2; DROP STOGROUP OLDSTO;

ALTER of SMS class names does not rewrite existing data sets. The next REORG, RECOVER, or LOAD REPLACE that deletes and reallocates the LDS picks up the new classes. ADD VOLUMES only matters for non-SMS lists. DROP fails if a database, table space, or index still uses the group.

VCAT, storage paths, SMS, VSAM

VCAT is overloaded in conversation: the STOGROUP VCAT clause, and USING VCAT on CREATE TABLESPACE/INDEX. USING STOGROUP is Db2-managed. USING VCAT hlq is user-managed: you IDCAMS DEFINE the cluster first with the Db2 naming convention. PBG cannot grow user-managed parts by itself. Prefer STOGROUP.

Storage paths in the LUW sense (automatic storage paths) are not how z/OS works. On z/OS the “path” is SMS ACS routines plus the STOGROUP VCAT and classes. ACS looks at the data set name (DSNDBC.*) and assigns SMS storage class, management class, and SMS storage group (a pool of DASD volumes—different object from Db2 STOGROUP).

SMS-managed storage with VOLUMES (*) is the modern default. SMS storage classes can request guaranteed space, EA/EF, striping. Data class influences DCB-like attributes, extended format, and extended addressability—needed for data sets above 4 GB.

VSAM: Db2 uses linear data sets (LDS) and VSAM Media Manager. You do not use KSDS for table pages. I/O is CI-oriented; page size should match CI size (4 KB pages → 4 KB CI, and so on) or utilities like concurrent copy get picky.

Data sets: table, index, LOB, XML, work file

VSAM pieces you will see in ISMF / LISTCAT
KindName patternNote
Table spacecat.DSNDBC.db.ts.I0001.A001One LDS per part/piece; I0001 vs I0002 after REORG instance switch
Index spaceSame pattern with index space nameNPSI is one piece; DPSI has a data set per part
LOBAuxiliary table space LDSOften EA, large DSSIZE; not the base table’s pages
XMLXML table space LDSSeparate from the base table; DOCUMENT/NODE storage
Work fileDSNDB07 (or work-file DB) spacesSorts, CGTT, overflow; size for peak queries

Table space data sets: one LDS per partition or piece. After online REORG FASTSWITCH, instance I0001/I0002 flips. Index space data sets follow the same catalog naming with the index space name. LOB data sets belong to the LOB table space (auxiliary table), not the base table’s pages. XML data sets similarly sit in XML table spaces. Work file data sets live in the work-file database (often DSNDB07): 4 KB and 32 KB spaces for sorts, created global temps, and overflow. Undersized work files show up as resource-unavailable SQLCODEs in heavy SQL, not as STOGROUP DDL errors.

Data set sizing: DSSIZE, PRIQTY, SECQTY, SPACE, extents

DSSIZE is the maximum size of a partition (or PBG part). It is not the primary allocation. A 64 G DSSIZE data set can still start at one cylinder.

PRIQTY is the primary quantity. SECQTY is secondary.SPACE in catalog reports (STOSPACE utility, RTS) is how much is actually used or allocated—not the DDL ceiling. Leaving PRIQTY/SECQTY off or coding -1 uses ZPARM TSQTY/IXQTY and the sliding-scale secondary algorithm (MGEXTSZ YES): early extents stay modest, later ones grow, which avoids a 255-extent death spiral on a badly sized object.

Extents are the chunks VSAM adds. Extent limits still exist (the exact maximum depends on SMS, EA, and z/OS level—far more than the old 255 on modern EA data sets, but “thousands of tiny extents” is still a performance and operational problem). SMS can consolidate adjacent extents. DSNACCOX can recommend REORG when extent counts explode.

sql
1
2
3
4
5
6
7
8
CREATE TABLESPACE HRTS IN HRDB USING STOGROUP HRSTO PRIQTY -1 SECQTY -1 DSSIZE 8 G SEGSIZE 32 MAXPARTITIONS 8;

DASD is the physical disks (or virtual volumes) SMS storage groups map to. Db2 does not pick a VOLSER when VOLUMES (*) is set—the storage administrator’s ACS does. Your job is a sensible DSSIZE, sliding-scale quantities, and a STOGROUP that points at the right SMS classes for production versus test.

Explain It Like I'm Five

A Db2 table is toys in labeled boxes (VSAM data sets) on warehouse shelves (DASD). A STOGROUP is the warehouse address and the rule “SMS, you pick the shelf.” VCAT is the building name stamped on every box. PRIQTY is how big the first box is; SECQTY is how much extra cardboard you add when it overflows (extents). DSSIZE is “this locker cannot grow past 8 gigabytes.” LOB and XML toys get their own boxes so the main box does not explode. The work-file room is extra tables where Db2 dumps puzzle pieces during a sort. User-managed VCAT is building every box yourself with a glue gun (IDCAMS)—possible, but the STOGROUP robot is better.

Exercises

  1. Write CREATE STOGROUP with VOLUMES (*), VCAT, and all three SMS class clauses.
  2. Explain what changes on disk when you ALTER STOGROUP DATACLAS before versus after a REORG.
  3. LISTCAT a table space cluster and identify DSNDBC vs DSNDBD, I0001, and A001.
  4. Contrast DSSIZE 4 G with PRIQTY -1: which is a ceiling and which is a first extent?
  5. Find your shop’s work-file database and list how many 4 KB versus 32 KB spaces it has.

Quiz

Test Your Knowledge

1. A Db2 STOGROUP is:

  • A SQL view
  • A catalog object that names an ICF catalog (VCAT) and volumes or SMS classes so Db2 can allocate VSAM data sets
  • An IRLM parameter
  • A REST collection

2. USING VCAT versus USING STOGROUP:

  • VCAT is always better
  • STOGROUP is Db2-managed allocation; VCAT means you predefine the VSAM LDS with IDCAMS (user-managed)
  • They are identical
  • VCAT only applies to MQTs

3. PRIQTY -1 and SECQTY -1 mean:

  • No space ever
  • Use Db2 defaults (TSQTY/IXQTY) and the sliding-scale secondary algorithm (with MGEXTSZ) instead of a fixed cylinder count
  • DSSIZE is zero
  • Only work files

4. Db2 table and index data sets are which VSAM type?

  • KSDS always
  • Linear data sets (LDS); Db2 uses VSAM Media Manager for I/O
  • Only sequential BSAM
  • PDS members

5. VOLUMES (*) on CREATE STOGROUP means:

  • All volumes in the world
  • SMS chooses volumes via ACS; you do not list VOLSERs
  • Db2 ignores SMS
  • Only tape

Frequently Asked Questions