DB2 log
DB2's record of every change made to its data, used to undo work that fails and to recover data after a problem.
Also written active log, archive log, BSDS, bootstrap dataset, log record
DB2 writes every change to its log before the change is considered complete. Each log record holds what the data looked like before and after the change. This is what makes commit and rollback work: if a program fails, DB2 uses the log to undo its uncommitted changes.
The log is kept in active log datasets, usually two copies of each for safety. When an active log fills, DB2 copies it to an archive log, often on tape or disk, and reuses the active one. A small dataset called the BSDS, the bootstrap dataset, keeps a list of which logs exist and what they contain.
The log is also central to recovery. If a table space is damaged or loaded with bad data, the RECOVER utility starts from the latest image copy and applies the changes from the log up to a chosen point. Disaster recovery depends on copies of the log too.
Programs that update a lot of data without committing make long stretches of log that must be read back if they fail. That is one more reason long-running batch jobs commit regularly.
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
- Commit and rollbackMaking a set of changes permanent together, or undoing them together, so a transaction never half-happens.
- DB2 utilitiesThe batch programs that load, back up, reorganise and check DB2 for z/OS data, run as jobs outside normal SQL.
- DB2 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- Disaster recoveryThe plans, copies of data and second systems that let an organisation keep running if a whole data centre is lost.
- 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.