DB2 commands
The commands for controlling and checking DB2 for z/OS, such as displaying or stopping databases, which usually start with a hyphen.
Also written -DISPLAY DATABASE, -START DATABASE, -STOP DATABASE, -DISPLAY UTILITY, command prefix
DB2 for z/OS is controlled with its own commands, separate from SQL. They start with a command prefix, which identifies the DB2 subsystem. The prefix is often a hyphen, so commands are written like -DISPLAY DATABASE. A site with several DB2 subsystems gives each its own prefix.
Some common ones: -DISPLAY DATABASE shows the status of databases and their table spaces, including any restricted states. -START DATABASE and -STOP DATABASE make objects available or unavailable. -DISPLAY THREAD shows connected work. -DISPLAY UTILITY shows running utilities, and -TERM UTILITY ends one.
They can be issued from the system console, from the DB2I screens in ISPF, from the DSN command in TSO, or from programs and automation. Each command is checked against the user's DB2 authority.
For developers, -DISPLAY DATABASE is the most useful. When a program gets an error saying a resource is unavailable, the display usually shows why, for example a table space in a pending state after a failed utility.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DB2 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- DB2 threadThe connection between an application and DB2 for the length of its work, which DB2 tracks and can display.
- Table spaceThe storage structure in DB2 for z/OS that holds the data of one or more tables, kept in VSAM datasets that DB2 manages.
- DB2 utilitiesThe batch programs that load, back up, reorganise and check DB2 for z/OS data, run as jobs outside normal SQL.
- System consoleThe screen where z/OS shows its messages to operators and accepts system commands.