Db2 termination types
Db2 terminates normally in response to the STOP DB2 command . If Db2 stops for any other reason, the termination is considered abnormal.
Normal terminations
In a normal termination, Db2 stops all activity in an orderly way.
You can use either STOP DB2 MODE (QUIESCE) or STOP DB2 MODE (FORCE). The effects of each command are compared in the following table.
Thread type | QUIESCE | FORCE |
---|---|---|
Active threads | Run to completion | Roll back |
New threads | Permitted | Not permitted |
New connections | Not permitted | Not permitted |
You can use either command to prevent new applications from connecting to Db2.
When you issue the STOP DB2 MODE(QUIESCE) command, current threads can run to completion, and new threads can be allocated to an application that is running.
- Open, held cursors exist.
- Special registers are not in their original state.
Before Db2 can stop, all held cursors must be closed and all special registers must be in their original state, or the transaction must complete.
With CICS, QUIESCE mode stops the CICS attachment facility, so an active task might not necessarily run to completion.
For example, assume that a CICS transaction opens no cursors that are declared WITH HOLD and modifies no special registers, as follows:
EXEC SQL
. ← -STOP DB2 MODE(QUIESCE) issued here
⋮
SYNCPOINT
⋮
EXEC SQL ← This receives an AETA abend
The thread is allowed to run only through the first SYNCPOINT.
When you issue the command STOP DB2 MODE(FORCE), no new threads are allocated, and work on existing threads is rolled back.
A data object might be left in an inconsistent state, even after a shutdown with mode QUIESCE, if it was made unavailable by the command STOP DATABASE, or if Db2 recognized a problem with the object. MODE (QUIESCE) does not wait for asynchronous tasks that are not associated with any thread to complete before it stops Db2. This can result in data commands such as STOP DATABASE and START DATABASE having outstanding units of recovery when Db2 stops. These outstanding units of recovery become inflight units of recovery when Db2 is restarted; then they are returned to their original states.
Abnormal terminations (abends)
An abnormal termination, or abend, is said to happen when Db2 does not terminate in an orderly way.
A Db2 abend can leave data in an inconsistent state for any of the following reasons:
- Units of recovery might be interrupted before reaching a point of consistency.
- Committed data might not be written to external media.
- Uncommitted data might be written to external media.
When Db2 abnormally terminates, you might receive message DSNV086E. Message DSNV086E includes a reason code for the abend. In most cases, the documentation for that reason code includes information to help you to determine the cause of the abend.
For example, if the reason code is 00F3040A, Db2 detected a previous error in which an allied address space was not in a good state when going through end-of-memory. One reason that this situation occurs is that one or more agents were in a Db2 must-complete state or were still holding Db2 latches. Follow the instructions in the problem determination section of 00F3040A to determine the cause of the previous error.