Falling back to a prior shutdown point
When a failure occurs in your environment, you might decide to fall back to a prior shutdown point.
Procedure
To fallback to a prior shutdown point:
- Use the print log map utility on the most current copy
of the BSDS. Even if you are not able to do this, continue with the next step. (If you are unable to do this, an error message is issued.)
- Use the access method services IMPORT command to restore the backed-up versions of the BSDS and active log data sets.
- Use the print log map utility on the copy of the BSDS with which Db2 is to be restarted.
- Determine whether any archive log data sets must be deleted.
- If you have a copy of the most current BSDS, compare it to the BSDS with which Db2 is to be restarted. Delete and uncatalog any archive log data sets that are listed in the most current BSDS but are not listed in the previous one. These archive log data sets are normal physical sequential (SAM) data sets. If you are able to do this step, continue with step 5.
- If you were not able to print a copy of the most current BSDS
and the archive logs are cataloged, use access method services LISTCAT
to check for archive logs with a higher sequence number than the last
archive log that is shown in the BSDS that is being used to restart Db2.
- If no archive log data sets with a higher sequence number exist, you do not need to delete or uncatalog any data sets, and you can continue with step 5.
- Delete and uncatalog all archive log data sets that have a higher sequence number than the last archive log data set in the BSDS that is being used to restart Db2. These archive log data sets are SAM data sets. Continue with the next step.
If the archive logs are not cataloged, you do not need to uncatalog them.
- Issue the START DB2 ACCESS(MAINT) command until data is consistent or page sets are stopped.
- Determine what data needs to be recovered, what data needs
to be dropped, what data can remain unchanged, and what data needs
to be recovered to the prior shutdown point.
- For table spaces and indexes that might have been changed after the shutdown point, use the Db2 RECOVER utility to recover these table spaces and indexes. They must be recovered in the proper order.
- For data that has not been changed after the shutdown point (data used with RO access), you do not need to use RECOVER or DROP.
- For table spaces that were deleted after the shutdown point, issue the DROP statement. These table spaces will not be recovered.
- Re-create any objects that were created after the shutdown point.
You must recover all data that has potentially been modified after the shutdown point. If you do not use the RECOVER utility to recover modified data, serious problems might can occur because of data inconsistency.
If you try to access inconsistent data, any of the following events can occur (and the list is not comprehensive):- You can successfully access the correct data.
- You can access data without Db2 recognizing any problem, but it might not be the data that you want (the index might be pointing to the wrong data).
- Db2 might recognize that a page is logically incorrect and, as a result, abend the subsystem with an X'04E' abend completion code and an abend reason code of X'00C90102'.
- Db2 might notice that a page was updated after the shutdown point and, as a result, abend the requester with an X'04E' abend completion code and an abend reason code of X'00C200C1'.
- Analyze the CICS® log and the IMS log to determine the work that must be redone (work that was lost because of shutdown at the previous point). Inform all users (TSO users, QMF users, and batch users for whom no transaction log tracking has been performed) about the decision to fall back to a previous point.
- When Db2 is started
after being shut down, indoubt units of recovery might exist. This
occurs if transactions are indoubt when the STOP DB2 MODE
(QUIESCE) command is issued. When Db2 is started
again, these transactions will still be indoubt to Db2. IMS and CICS cannot know the disposition
of these units of recovery.
To resolve these indoubt units of recovery, use the RECOVER INDOUBT command.
- If a table space was dropped and re-created after the shutdown
point, drop and re-create it again after Db2 is restarted.
To do this, use SQL DROP and SQL CREATE statements.
Do not use the RECOVER utility to accomplish this, because it will result in the old version (which might contain inconsistent data) that is being recovered.
- If any table spaces and indexes were created after the
shutdown point, re-create these after Db2 is restarted.
You can accomplish this in these ways:
- For data sets that are defined in Db2 storage groups, use the CREATE TABLESPACE statement, and specify the appropriate storage group names. Db2 automatically deletes the old data set and redefines a new one.
- For user-defined data sets, use the access method services DELETE command to delete the old data sets. After these data sets have been deleted, use the access method services DEFINE command to redefine them; then use the CREATE TABLESPACE statement.