A Db2 command can change subsystem availability, stop distributed access, cancel a thread, or terminate a utility. Before an operator types -STOP DATABASE or -TERM UTILITY, the command target and scope must be clear. A missing database name, wrong member, or broad command scope can turn a small support action into a larger outage.
This Db2 commands quick reference groups common Db2 for z/OS commands by the job they do: checking status, starting and stopping resources, changing runtime values, managing logs, handling utilities, and diagnosing threads.
Where Db2 commands can be issued
Most Db2 commands begin with a hyphen, such as -DISPLAY DATABASE. Depending on site setup and authority, commands may be issued from a z/OS console, TSO or DB2I, an APF-authorized program, CICS or IMS paths, or an IFI application. -START DB2 is normally a console-level action; do not treat it like an ordinary application command.
- Check whether the command is allowed from your interface.
- Confirm whether the command acts on one object, one member, a data sharing group, or the whole subsystem.
- Capture command output in the ticket or job log when it affects production.
DISPLAY commands
Use DISPLAY commands when you need current facts before taking action. In support work, this is usually the safest first step.
| Command | Use | Common support question |
|---|---|---|
-DISPLAY DATABASE | Shows database or table space status. | Is the object stopped, restricted, copy-pending, or unavailable? |
-DISPLAY THREAD | Shows local or distributed thread information. | Which plan, auth ID, correlation ID, or connection is holding work? |
-DISPLAY DDF | Shows Distributed Data Facility status. | Is distributed access active, stopped, or limited? |
-DISPLAY BUFFERPOOL | Shows buffer pool status and activity. | Is the buffer pool active, and what does the activity look like? |
-DISPLAY LOG | Shows active log and offload status. | Is logging healthy, or is archive/offload work falling behind? |
-DISPLAY UTILITY | Shows Db2 utility execution status. | Which utility ID is active, stopped, or waiting? |
-DISPLAY GROUP | Shows data sharing group information. | Which members are active, and what mode is the group using? |
START and STOP commands
START and STOP commands change availability. Use the narrowest object scope that solves the problem.
| Command | Use | Check first |
|---|---|---|
-START DATABASE | Makes a database or table space available. | Object name, access mode, and whether utilities are still running. |
-STOP DATABASE | Makes a database or table space unavailable or restricted. | Active threads, batch schedule, and online transaction impact. |
-START DDF | Starts distributed data access. | Network, location, and security readiness. |
-STOP DDF | Stops distributed data access. | Remote applications, DRDA clients, and application owners. |
-START TRACE | Starts trace activity. | Trace class, destination, expected volume, and stop plan. |
-STOP TRACE | Stops trace activity. | Trace identifier and whether diagnostic capture is complete. |
ALTER and SET commands
ALTER and SET commands change runtime behavior. Keep the before-and-after values in the change record.
| Command | Use | Production note |
|---|---|---|
-ALTER BUFFERPOOL | Changes buffer pool attributes. | Coordinate with DBA performance checks before changing size or thresholds. |
-ALTER GROUPBUFFERPOOL | Changes group buffer pool attributes in data sharing. | Check coupling facility impact and data sharing member scope. |
-ALTER UTILITY | Changes selected utility processing values. | Verify the utility ID and current phase before changing behavior. |
-SET ARCHIVE | Controls archive log allocation behavior. | Use with storage and operations awareness. |
-SET LOG | Changes logging checkpoint-related values. | Record the reason and expected duration of the change. |
-SET SYSPARM | Loads selected subsystem parameter values. | Confirm site procedures; not every subsystem parameter can be changed casually. |
Thread and utility commands
Commands such as -CANCEL THREAD and -TERM UTILITY can interrupt work. They should be driven by command output, not guesswork.
-DISPLAY THREAD(*) TYPE(ACTIVE)
-CANCEL THREAD(token)
-DISPLAY UTILITY(*)
-TERM UTILITY(utility-id)
Before canceling a thread, identify the connection, correlation ID, authorization ID, and unit of work. Before terminating a utility, capture the utility ID, phase, object name, and restart instructions.
Archive and log commands
Log commands affect recovery posture. -ARCHIVE LOG closes the current active log and starts use of the next available log data set. -DISPLAY LOG helps confirm logging and offload state before and after action.
- Use
-DISPLAY LOGbefore forcing archive activity. - Confirm archive destinations and offload health.
- Record log-related messages in the incident or change ticket.
Command safety checklist
- Confirm the subsystem ID and data sharing member.
- Confirm the object name, utility ID, thread token, or trace number.
- Run a matching
DISPLAYcommand first when possible. - Check authority and site operations rules.
- Know how to reverse the command or restore availability.
- Save the command output for the ticket.
Related Db2 topics
Use this reference with Db2 DSN Command Reference, Db2 Utilities, Db2 Buffer Pool, Db2 Packages, and Db2 Application Environment.
FAQ
What is a Db2 command on z/OS?
A Db2 command is an operational command used to display or change Db2 subsystem, object, thread, log, utility, trace, or distributed access state. Many Db2 commands begin with a hyphen.
Which Db2 command should I run first during an incident?
Use a matching DISPLAY command first when possible, such as -DISPLAY THREAD, -DISPLAY DATABASE, -DISPLAY UTILITY, or -DISPLAY LOG.
Are Db2 commands the same as DSN subcommands?
No. DSN starts the Db2 command processor and supports subcommands such as BIND and RUN. Db2 commands such as -DISPLAY DATABASE and -STOP DDF are operational subsystem commands.
No comments:
Post a Comment