MUSTRECOVER for Logged Databases [ COMMUNICATOR 3000/XL XL RELEASE 3.0 ] MPE/iX Communicators
COMMUNICATOR 3000/XL XL RELEASE 3.0
MUSTRECOVER for Logged Databases
by Mark Boronkay
Commercial Systems Division/DBL
The following information describes the procedures for using the
MUSTRECOVER option.
HOW MUSTRECOVER WORKS
The MUSTRECOVER enhancement involves two new database flags. The first
flag is maintained by the user through DBUTIL. The second flag is
internally maintained by TurboIMAGE.
During the first write-mode DBOPEN (mode 1,2,3 or 4) against a database,
TurboIMAGE checks to determine if the database was enabled for
MUSTRECOVER. If the database has been enabled for MUSTRECOVER, TurboIMAGE
then checks the internally maintained flag to determine if it too is on.
If so, then the database open fails and the condition code is set to -34.
If DBERROR is called with this condition code, the following text is
returned:
DATABASE MUST BE RECOVERED BEFORE WRITE ACCESS IS ALLOWED
At this point, the user should exit the application and take action to
initiate recovery of the database.
NOTE Reader access (DBOPEN modes 5,6,7 and 8) will be granted regardless
of MUSTRECOVER status. The MUSTRECOVER check is only done when the
first writer calls DBOPEN.
If the first write-mode DBOPEN to a MUSTRECOVER enabled database finds
the internally maintained flag off, TurboIMAGE assumes that the database
is consistent and that no recovery is needed. In this case, TurboIMAGE
sets the internal flag on. The last write-mode accessor calling DBCLOSE
forces TurboIMAGE to turn the flag off.
ENABLING MUSTRECOVER
MUSTRECOVER is enabled and disabled with the DBUTIL enable and disable
commands. The syntax for enabling and disabling MUSTRECOVER is:
ENA[BLE] dbname FOR MUSTRECOVER
DIS[ABLE] dbname FOR MUSTRECOVER <<default>>
If logging is not enabled, TurboIMAGE will enable it automatically. The
following are some examples of the DBUTIL display for MUSTRECOVER:
1. MUSTRECOVER is enabled and logging was already enabled:
:RUN DBUTIL.PUB.SYS
>> ENABLE orders FOR MUSTRECOVER
Mustrecover is enabled.
Logging is enabled.
2. MUSTRECOVER was enabled when logging was not enabled:
:RUN DBUTIL.PUB.SYS
>> ENABLE orders FOR MUSTRECOVER
Mustrecover is enabled.
Logging is enabled.
3. ROLLBACK and MUSTRECOVER are both enabled and logging was not
enabled:
:RUN DBUTIL.PUB.SYS
>> ENABLE orders FOR ROLLBACK, MUSTRECOVER
Rollback recovery is enabled.
Mustrecover is enabled.
ILR is enabled. <<automatically enabled for ROLLBACK>> Logging
is enabled.
DISABLING MUSTRECOVER
There is a specific sequence in disabling databases that utilize
MUSTRECOVER. That order is to disable MUSTRECOVER prior to disabling
logging. This implies that disabling MUSTRECOVER does not automatically
disable logging (refer to example #1 below). Here are some examples of
disabling MUSTRECOVER with DBUTIL:
1. Database does not need recovery. MUSTRECOVER is disabled but
logging remains enabled:
:RUN DBUTIL.PUB.SYS
>> DISABLE orders FOR MUSTRECOVER
Mustrecover is disabled
Logging is enabled
2. Disable logging while MUSTRECOVER is still enabled. (NOTE: this
is an error)
:RUN DBUTIL.PUB.SYS
>> DISABLE orders FOR LOGGING
MUSTRECOVER must be disabled before LOGGING can be disabled.
Logging is enabled.
3. Database needs recovery and MUSTRECOVER is disabled. This is an
example of overriding a recovery situation in order to allow
access to a potentially corrupt database:
:RUN DBUTIL.PUB.SYS
>> DISABLE orders FOR MUSTRECOVER
WARNING: Disable mustrecover requested but database
needs recovery.'' Cannot guarantee a
consistent database. Please type Y to
confirm your disable command >> Y
Mustrecover is disabled.
Logging is enabled.
NOTE By disabling MUSTRECOVER after a system failure but prior to a
proper recovery, users will have normal read and write access to
the database. However, this would override the MUSTRECOVER
insistence of database recovery. Be aware that overriding
MUSTRECOVER in this case does not guarantee consistency.
EFFECTS ON OTHER DBUTIL COMMANDS
PURGE: The purge command will purge a database requiring
recovery.
ERASE: The erase command automatically disables
MUSTRECOVER and sets the internal flag off.
HELP: The help command under the enable/disable options
displays syntax information for the MUSTRECOVER
option.
SHOW: The show command with the flags or all option will
display the MUSTRECOVER status of the specified
database.
NOTE If MUSTRECOVER is enabled and the database needs recovery, the SHOW
command will display the following message: MUSTRECOVER is
enabled and the database needs recovery.
MPE/iX Communicators