Operator STOP commands are how you politely (or not so politely) tell DB2 for z/OS to stop using a resource. You might close a table space before a volume move, shut DDF for a network change, stop a stored procedure that is abending, or stop the whole subsystem for an IPL. This page covers the STOP family as IBM documents it in the Command Reference: databases, the subsystem, DDF, traces, procedures, functions, RLIMIT, profiles, REST services, accelerators, CDDS, dynamic query capture, machine learning, and OpenTelemetry.
On z/OS, a Db2 command is the verb plus keywords, preceded by the command prefix defined for that subsystem (often a hyphen, sometimes a unique prefix such as -DB2A). In IBM manuals the hyphen is written as -STOP DATABASE so you remember it is an operator command, not SQL. Abbreviation examples include -STO DB for STOP DATABASE, -STO DB2 for STOP DB2, -STO DDF, -STO PROC, -STO RLIM, and -STO TRA.
You can issue these commands from:
DSN9022I reports normal command completion. DSN9023I reports abnormal completion. For asynchronous STOP DATABASE, DSN9022I can appear before the objects actually stop; watch DSNT736I and DISPLAY DATABASE status STOPP versus STOP.
Think of STOP as “make this unavailable.” The object you name decides the blast radius: one partition, one procedure, all traces, or the whole Db2 address spaces.
| Command | What it stops | Typical data sharing scope |
|---|---|---|
| -STOP ACCEL | Stop using specified IBM Db2 Analytics Accelerator servers | Member or group (options) |
| -STOP CDDS | Close and deallocate the compression dictionary data set on all data sharing members | Group |
| -STOP DATABASE | Make databases, spaces, or partitions unavailable and close data sets | Group |
| -STOP DB2 | Stop the Db2 subsystem (this member) | Member |
| -STOP DDF | Stop or suspend the distributed data facility (VTAM/TCP/IP) | Member |
| -STOP DYNQUERYCAPTURE | Stop capture of dynamic SQL statements by specified monitors | Member or group (options) |
| -STOP FUNCTION SPECIFIC | Stop accepting SQL that invokes specified external/SQL functions | LOCAL or GROUP |
| -STOP ML | Stop IBM Db2 AI for z/OS (machine learning) functions if started | Member |
| -STOP OTEL | Stop OpenTelemetry propagation and SMF 1161 span emission (Db2 13) | Member (no SCOPE GROUP) |
| -STOP PROCEDURE | Stop accepting SQL CALL for stored procedures | LOCAL or GROUP |
| -STOP PROFILE | Disable profile-table monitoring and related profile functions | Member |
| -STOP RESTSVC | Stop new discover/invoke requests for native REST services | Group |
| -STOP RLIMIT | Stop the resource limit facility (governor) | Member |
| -STOP TRACE | Stop Db2 trace types and destinations | LOCAL or GROUP |
-STOP DATABASE makes specified objects unavailable for applications and closes their data sets. You can name databases, table spaces, index spaces, physical partitions of partitioned spaces (including data-partitioned secondary indexes), or logical partitions of nonpartitioned secondary indexes. Stopping a logical partition does not close the index data set. In data sharing the command has group scope: every member sees the stop. If a GBP-dependent object is stopped, Db2 does the processing needed so the object is no longer GBP-dependent.
Authorization typically includes the STOPDB privilege, database authorities (DBMAINT, DBCTRL, DBADM), System DBADM, SYSCTRL, or SYSADM. Implicit databases can be authorized on the implicit database or on DSNDB04. When data definition control is active, installation SYSOPR or installation SYSADM is required to stop spaces that contain registration tables. If you stop catalog spaces in DSNDB06 that are needed to check authorization, you need installation SYSADM to start them again.
You must specify a database list (or *). Patterns IBM documents:
SPACENAM (abbreviations SPACE or SP) names table spaces or index spaces inside those databases. The same list, range, and asterisk patterns apply. SPACENAM(*) stops all spaces in the named databases. PART(integer) stops one or more partitions (lists and ranges). PART is valid for partitioned table spaces, partitioned indexes, and nonpartitioned type 2 indexes on partitioned table spaces. CLONE processes clone objects only; omit CLONE to process base objects only.
Without AT(COMMIT), STOP DATABASE takes drain-all locks and exclusive locks as documented (partitioned versus nonpartitioned). With AT(COMMIT), Db2 marks the object so new requesters cannot get in. Applications already running continue until their next commit; after that commit they cannot come back. The object actually reaches STOP when all jobs release claims and all utilities release drain locks. Use AT(COMMIT) to break in on threads bound with RELEASE(DEALLOCATE) when there is heavy thread reuse. The option is ignored for declared temporary databases.
1234-STOP DATABASE(DSN8D81A) SPACENAM(DSN8S81E) -STOP DATABASE(*) AT(COMMIT) -STOP DATABASE(DSN8D81A) SPACENAM(XEMP2) PART(1) -STOP DATABASE(MYDB*) SPACENAM(MYDB*SP) CLONE
If you stop a space with SPACENAM, you must START DATABASE that space explicitly later—starting only the database does not restart spaces you stopped by name. Index spaces for declared temporary tables cannot be stopped. The CDB and resource limit database cannot be stopped while they are active. From a TSO or z/OS console the command runs asynchronously; from batch it runs synchronously so later job steps can depend on the stop. The command retries drain locks and fails if it times out more than 15 times or hits a serious deadlock.
-STOP DB2 stops the Db2 subsystem (this data sharing member). You need STOPALL privilege, SYSOPR, SYSCTRL, or SYSADM.
123-STOP DB2 MODE(QUIESCE) -STOP DB2 MODE(QUIESCE) CASTOUT(NO) -STOP DB2 MODE(FORCE)
-STOP DDF stops the distributed data facility if it is already started, ending the DDF interface to VTAM or TCP/IP. Authorization is SYSOPR, SYSCTRL, or SYSADM. Member scope.
| MODE | What Db2 does |
|---|---|
| QUIESCE (default) | Active distributed threads finish; inactive threads terminate. Cleanest stop; wait for DDF work to drain. |
| FORCE | Terminate all currently executing distributed threads and the VTAM/TCP/IP connection. Can take up to about three minutes. May create indoubt work at two-phase-commit partners. |
| SUSPEND | Queue inbound DDF work, terminate pool threads, keep inactive threads inactive until START DDF. Use when locking conflicts exist between DDL/GRANT/REVOKE and clients. |
With MODE(SUSPEND) you can add CANCEL(n) to cancel remaining active DBATs if suspend has not finished in n seconds (0–9999), or WAIT(n) to resume DDF if suspend does not complete in n seconds. After a successful SUSPEND, other non-DDF holders might still exist—use CANCEL THREAD for those. If CMTSTAT is ACTIVE, all DDF threads are treated as active for QUIESCE. DISPLAY DDF status values include STOPDQ (normal stop), STOPDF (forced stop), and SUSPND (suspended).
123-STOP DDF -STOP DDF MODE(FORCE) -STOP DDF MODE(SUSPEND) CANCEL(600)
These twins stop new work, not work already queued or scheduled. -STOP PROCEDURE stops SQL CALL for stored procedures. -STOP FUNCTION SPECIFIC stops SQL that invokes specified functions. You cannot stop built-in functions, inline SQL functions, or UDFs sourced on another function. Db2 itself issues STOP … ACTION(REJECT) when a routine exceeds the installation MAX ABEND COUNT (DSNTIPX).
A stopped routine does not stay stopped across a Db2 restart. To disable permanently, ALTER or DROP the routine, or remove the z/OS load module. STOP PROCEDURE and STOP FUNCTION SPECIFIC affect all versions of native SQL procedures / SQL functions that you name.
123-STOP PROCEDURE ACTION(REJECT) -STOP PROCEDURE(PAYROLL.CALC_TAX,USERPRC3) SCOPE(GROUP) -STOP FUNCTION SPECIFIC(PAYROLL.USERFN1,PAYROLL.USERFN3) ACTION(REJECT)
-STOP TRACE stops tracing. You need TRACE privilege, SQLADM, System DBADM, SYSOPR, SYSCTRL, SYSADM, or SECADM. SCOPE can be LOCAL (default) or GROUP.
Stopping traces does not undo SMF already written. If a monitor program allocated an OP buffer, stop the corresponding trace before the program ends so the buffer is released cleanly.
123-STOP TRACE(*) -STOP TRACE(PERFM) DEST(SMF) -STOP TRACE(MONITOR) TNO(1,2) SCOPE(LOCAL)
-STOP RLIMIT stops the resource limit facility (governor). Previously set limits return to infinity and accumulated governed time resets. Dynamic SQL that was limited (SELECT, INSERT, UPDATE, DELETE through PREPARE or EXECUTE IMMEDIATE) then runs with no governor limit until you START RLIMIT again. SYSOPR, SYSCTRL, or SYSADM.
-STOP PROFILE disables the profile function that reads SYSIBM.DSN_PROFILE_TABLE and DSN_PROFILE_ATTRIBUTES (idle-thread monitors, connection thresholds, special registers, and related profile actions). SQLADM, System DBADM, SYSOPR, SYSCTRL, or SYSADM. Member scope. START PROFILE reloads and re-enables profiles.
12-STOP RLIMIT -STOP PROFILE
Tells this Db2 subsystem to stop using the named IBM Db2 Analytics Accelerator servers. Queries already running on an accelerator are not the same as “Db2 will not route new work.” Pair with DISPLAY ACCEL and START ACCEL when you bounce an accelerator appliance or take a server out of the configuration.
Directs all members of a data sharing group to close and deallocate the compression dictionary data set (CDDS) used with replication products that need a shared dictionary. Use when the CDDS must be moved or recovered; START CDDS afterward.
Prevents Db2 from accepting new discover or invoke requests for one or more native REST services. You can qualify names with a collection ID (the REST package collection, often SYSIBMSERVICE). Existing in-flight invokes are not the same as new HTTP requests; DISPLAY RESTSVC shows status. START RESTSVC enables the service definition again.
Stops capture of dynamic SQL statements by the monitors you started with START DYNQUERYCAPTURE (used with dynamic statement stabilization and related capture into catalog structures such as SYSIBM.SYSDYNQRY). Specify the same monitor identification you used on START.
Stops Db2 functions used by IBM Db2 AI for z/OS if that product has already been started with START ML. DISPLAY ML shows whether ML is active on the member.
On Db2 13 (APAR PH67971 and related PTFs), -STOP OTEL stops all Db2 OpenTelemetry functions: W3C trace-context propagation and writing of extended SMF type 1161 subtype 1 span records. There is no SCOPE(GROUP)—issue STOP OTEL on each data sharing member. START OTEL EMIT(YES|NO) starts processing; DISPLAY OTEL DETAIL shows emit counts. If OTEL is already stopped, DSNW303I reports that the command is ignored.
12345-STOP ACCEL(*) -STOP CDDS -STOP RESTSVC(SYSIBMSERVICE.GetEmployee) -STOP ML -STOP OTEL
Operators rarely issue a random STOP. A typical maintenance window looks like this:
Never confuse STOP DATABASE with the SQL DROP statement, and never confuse STOP DB2 with cancelling one batch job. STOP DATABASE is reversible with START DATABASE. STOP DB2 takes down MSTR, DBM1, DIST (if up), IRLM identification, and allied connections for that member.
Imagine Db2 is a busy library. STOP DATABASE is putting a “closed” sign on one shelf so nobody can take those books, while the rest of the library stays open. STOP DDF is locking the front door that remote visitors use. STOP PROCEDURE is telling the librarian not to take any new phone requests for a special service. STOP DB2 is turning out the lights and sending everyone home. QUIESCE means “finish the chapter you are reading, then leave.” FORCE means “the fire alarm—out now,” which can leave bookmarks (indoubt work) in a messy place.
1. What does -STOP DATABASE do to table spaces and index spaces?
2. Which MODE should you use for a planned -STOP DB2 if you can wait for work to finish?
3. Why would an operator specify AT(COMMIT) on STOP DATABASE?
4. What is the default MODE of -STOP DDF?
5. Does -STOP PROCEDURE immediately kill CALL statements already running?