DB2 utilities
The batch programs that load, back up, reorganise and check DB2 for z/OS data, run as jobs outside normal SQL.
Also written REORG, RUNSTATS, LOAD, UNLOAD, image copy, DSNUTILB, DB2 utility
DB2 for z/OS comes with utilities for work that SQL is not designed for. They run as batch jobs, usually through a program called DSNUTILB, and they work on whole table spaces and indexes rather than single rows.
The common ones: LOAD puts large amounts of data into a table quickly, and UNLOAD takes it out to a dataset. COPY makes a backup, called an image copy. RECOVER rebuilds a table space from image copies and logs. REORG rewrites a table space so the data is back in order and wasted space is removed. RUNSTATS collects statistics about the data, which DB2 uses to decide the fastest way to run each query.
After RUNSTATS, programs are often bound again so they can use the new statistics. That is why RUNSTATS and BIND are often mentioned together.
Many utilities run in the batch window, because some limit access to the data while they work. If a utility fails part of the way through, it can leave the table space in a restricted state until the utility is restarted or the state is cleared.
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
- 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 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- BINDPreparing a program's SQL for execution, working out how each statement will access the data and storing the result.
- IndexA structure that lets a database find rows by value without reading the whole table.
- Batch windowThe period, usually overnight, in which batch work has to finish before the business needs the systems back.
- Utility programA supplied program that performs a standard job such as copying, sorting, comparing or managing datasets, driven by control statements.