DB2 DISPLAY commands for monitoring

Before you open a performance monitor, a DB2 operator command can tell you whether the subsystem is drowning in threads, a table space is STOP, a buffer pool is too small, or a utility has been STOPPED since last night. This page is the monitoring subset of -DISPLAY: THREAD, DATABASE, BUFFERPOOL, GROUP, DDF, UTILITY, TRACE, STATS, and BLOCKERS — what to type and what the output is for.

Monitoring
Progress0 of 0 lessons

How DISPLAY fits in monitoring

Accounting and statistics traces tell you what happened over an interval. DISPLAY tells you what is true right now. Issue commands from a z/OS console (command prefix, often a hyphen), from DB2I COMMANDS, from DSN, or through IFI. In examples below, -DIS is the usual abbreviation.

Monitoring DISPLAY commands
CommandMonitoring use
-DISPLAY THREADWho is in Db2: allied, DBAT, status, TOKEN
-DISPLAY DATABASEObject status, RESTRICT, LOCKS, CLAIMERS, LPL
-DISPLAY BUFFERPOOLPool sizes and, with DETAIL, getpage/I/O stats
-DISPLAY GROUPData sharing members, levels, restart state
-DISPLAY DDFDDF status, ports, connection and DBAT counts
-DISPLAY UTILITYActive, stopped, or terminating utilities
-DISPLAY TRACEActive IFC traces, classes, destinations, TNO
-DISPLAY STATSFTB memory, index traverse, log reader tasks
-DISPLAY BLOCKERSThreads holding locks or claims on named objects

DISPLAY THREAD

-DISPLAY THREAD lists threads: allied (TSO, CICS, IMS, batch CAF), database access threads (DBATs from DDF), and parallel child tasks. Status values you will live with:

  • ACTIVE — currently in Db2 or associated
  • INACTIVE — DDF thread pooled / waiting (depends on DDF settings)
  • INDOUBT — two-phase commit unresolved
  • POSTPONED — abort incomplete (often after restart)
text
1
2
3
4
-DISPLAY THREAD(*) -DISPLAY THREAD(*) DETAIL -DISPLAY THREAD(*) TYPE(INDOUBT) -DISPLAY THREAD(*) LOCATION(*)

Read AUTHID, PLAN, CONNID, CORRID, ASID, and TOKEN. TOKEN is what -CANCEL THREAD wants. DETAIL adds more SQL and elapsed clues. A sudden pile of ACTIVE CICS threads with the same PLAN is a loop or a missing syncpoint. A pile of INDOUBT after a CICS outage is a recover-indoubt problem, not a CPU problem.

DISPLAY DATABASE

-DISPLAY DATABASE shows RW/RO/STOP and restricted statuses on databases, table spaces, and index spaces.

text
1
2
3
4
5
-DISPLAY DATABASE(DBHR) SPACENAM(*) RESTRICT -DISPLAY DATABASE(DBHR) SPACENAM(TSHEMP) LOCKS -DISPLAY DATABASE(DBHR) SPACENAM(*) CLAIMERS -DISPLAY DATABASE(DBHR) SPACENAM(*) USE -DISPLAY DATABASE(DBHR) SPACENAM(*) LPL
  • RESTRICT — STOP, RECP, CHKP, GRECP, LPL, WEPR, UT*, RO, and friends. First command after SQLCODE -904
  • LOCKS — who holds or waits for locks on those spaces
  • CLAIMERS — who holds claims (drain/claim for utilities)
  • USE — allocated applications
  • LPL — logical page list ranges (pages Db2 could not write or read cleanly)

Monitoring pattern: RESTRICT on the application databases every few minutes during the online day; LOCKS/CLAIMERS when a utility will not drain or SQL waits on a lock.

DISPLAY BUFFERPOOL

-DISPLAY BUFFERPOOL(bp) DETAIL is the live I/O picture: virtual pool size, sequential steal threshold, getpages, synchronous reads, prefetch reads, page writes. Hit ratio is approximately 1 − (synchronous reads / getpages) for random work — treat DISPLAY numbers as a snapshot, not a 15-minute SMF average.

text
1
2
3
-DISPLAY BUFFERPOOL(*) -DISPLAY BUFFERPOOL(BP2) DETAIL -DISPLAY BUFFERPOOL(BP2) LIST

If DETAIL shows almost as many sync reads as getpages, the pool is too small or the object does not stay resident. Compare with accounting class 3 buffer-pool wait times later; DISPLAY is the “is it happening now” check.

DISPLAY GROUP

In data sharing, -DISPLAY GROUP lists members, whether they are ACTIVE, the Db2 code level, catalog level, and function level. A member in a bad restart state belongs on the incident bridge before you tune SQL. DISPLAY GROUPBUFFERPOOL is the cousin for GBP hit ratios; GROUP itself is membership and levels.

DISPLAY DDF

-DISPLAY DDF shows whether DDF is started, the location name, IP and ports, and statistics for connections and threads DDF owns.

text
1
2
3
-DISPLAY DDF -DISPLAY DDF DETAIL -DISPLAY DDF LOCATION(*)

Watch DBAT counts versus MAXDBAT, inactive connection reuse, and a location that is STOPPED when the network team says “the database is down.” DDF STOPD with CICS still healthy is a distributed-only outage.

DISPLAY UTILITY

-DISPLAY UTILITY(*) lists IBM utilities in ACTIVE, STOPPED, or TERMINATING status, with phase and sometimes percent. STOPPED means the utility job died while SYSUTILX still owns the control row — restart or TERM, do not start a second COPY on the same space. Long-running REORG in UNLOAD versus RELOAD tells you which phase to compare to last week’s baseline.

DISPLAY TRACE

-DISPLAY TRACE(*) is how you find leftover performance traces. Output includes trace number (TNO), type (STAT, ACCTG, PERFM, AUDIT, MONITOR, GLOBAL), classes, destination (SMF, GTF, OPn, OPX), and filters. Monitoring shops DISPLAY TRACE after every change window. Stopping the wrong accounting class 1 trace is how you lose SMF 101 for the night — read TNO twice.

DISPLAY STATS

-DISPLAY STATS is not the statistics trace. It prints selected live resource counters:

  • INDEXMEMORYUSAGE — memory for fast index traversal (FTB)
  • INDEXTRAVERSECOUNT — FTB factor for an index or the highest N
  • LOGREADERTASKS (abbreviation LRT) — log-reader SRB stats; SCOPE(GROUP) in data sharing
text
1
2
3
-DISPLAY STATS(INDEXMEMORYUSAGE) -DISPLAY STATS(INDEXTRAVERSECOUNT) -DISPLAY STATS(LRT) SCOPE(GROUP)

DISPLAY BLOCKERS

-DISPLAY BLOCKERS lists locks and claims that active threads hold against the databases, tables, indexes, or spaces you name. Use it when a utility cannot drain, a DROP hangs, or timeouts pile up and DISPLAY DATABASE LOCKS is too noisy. It answers “who is in my way?” not “what was the average lock wait last hour?” (that is accounting class 3).

A small monitoring loop

Many shops automate:

  • Every few minutes: DATABASE RESTRICT, BUFFERPOOL DETAIL on critical pools, DDF
  • Every 15 minutes: THREAD DETAIL (or a filtered subset), UTILITY
  • After changes: TRACE, GROUP (data sharing)
  • On incidents: BLOCKERS, DATABASE LOCKS/CLAIMERS, THREAD TYPE(INDOUBT)

DISPLAY does not replace SMF accounting. It keeps you from waiting an interval to learn that DSNDB06 is LPL or that MAXDBAT is full.

Explain It Like I'm Five

DISPLAY is looking through the classroom window right now. THREAD is “who is sitting in a chair.” DATABASE RESTRICT is “which desks have a ‘do not touch’ sign.” BUFFERPOOL is “how full is the toy box and how often we walk to the cupboard.” DDF is “is the front door unlocked for visitors.” UTILITY is “is the janitor still mopping.” TRACE is “did someone leave a video camera running.” BLOCKERS is “whose backpack is blocking the aisle.” The report card at the end of the day is SMF — different tool, different time.

Exercises

  1. Issue (or write) DISPLAY THREAD(*) and circle the fields you would need to CANCEL a runaway batch job.
  2. Explain the difference between DISPLAY DATABASE LOCKS and DISPLAY BLOCKERS.
  3. From a BUFFERPOOL DETAIL display, state how you would roughly judge a poor hit ratio.
  4. A JDBC application cannot connect but CICS can. Which two DISPLAY commands do you run first?
  5. DISPLAY UTILITY shows STOPPED COPY. What do you not do next?

Quiz

Test Your Knowledge

1. Which DISPLAY command gives the TOKEN used by CANCEL THREAD?

  • -DISPLAY ARCHIVE
  • -DISPLAY THREAD (TOKEN column; LUWID for some distributed threads)
  • -DISPLAY PROFILE only
  • -DISPLAY ML

2. -DISPLAY DATABASE(...) RESTRICT is typically the first look when:

  • You want to BIND a package
  • SQLCODE -904 or utilities will not start because objects are STOP, RECP, CHKP, LPL, or similar
  • You only need SMF 101
  • You want to create a stogroup

3. DISPLAY BUFFERPOOL(...) DETAIL is for:

  • Only RACF users
  • Current VPSIZE/VPSEQT plus getpage and I/O counters so you can see hit ratio and prefetch behaviour
  • Only starting DDF
  • Only listing plans

4. DISPLAY BLOCKERS shows:

  • Only SMF record types
  • Locks and claims that active threads hold against the databases or spaces you name
  • Only archive tape units
  • Only WLM service classes

5. DISPLAY STATS(INDEXMEMORYUSAGE) reports:

  • Only log offload percent
  • Memory used for fast index traversal (FTB) by index
  • Only DDF IP names
  • Only utility phase times

Frequently Asked Questions