Checking a Database for Errors
If, for any reason, Reality is not shut down properly, when users next attempt to
log on, they may be prevented from logging on with the message <30020> Database needs checking
.
If this occurs, you will need to run the realdbck utility to check the database.
Used without any options, realdbck checks the specified database. If any errors are found, it asks if you want to attempt to repair them. If realdbck finds that the database is clean, or is able to repair any errors, your users can log on and continue using the database. If, however, realdbck reports that errors remain, you will need to rebuild it (using mkdbase -r), restore the last back-up tape and, if you are using transaction logging, roll forward your clean logs.
Checking the Database Automatically at Startup
The RealDbCk database configuration parameter allows you to choose what action to take at startup if the database was not shut down properly. The parameter accepts the following values:
0 If the database was not shut down cleanly, the connection is rejected and the database is locked. You will need to run realdbck to check and, if necessary, clean the database.
1 If the database was not shut down cleanly, the connection is rejected and realdbck is run automatically to check the database. If no errors are found connections are enabled; otherwise, the database is locked.
2 If the database was not shut down cleanly, the connection is rejected and realdbck is run automatically to check the database. When realdbck completes, connections are enabled, whether or not any errors were found.
Note
If the database check fails, continuing to use the database may result in unrecoverable data corruption.
3 If the database was not shut down cleanly, a message is logged to that effect, but realdbck is not run. The connection is allowed.
Note
If the database was not down cleanly, continuing to use the database may result in unrecoverable data corruption.
Connection is always allowed if the database was shut down cleanly.
Note
While realdbck is running, all
connections are rejected with the message <30029>: Database check in progress - please wait (nn%)
.
Daemon Log Messages
The messages listed in the following table are logged in the daemon log, to record the checks made and their success or otherwise in cleaning a dirty database. The messages are also logged in the file DatabasePath/configs/dbproblems.log to ensure that they are not lost when the daemon log is rotated.
Message |
Reason |
---|---|
|
The start-up test found that the database was not shut down cleanly. |
|
The database daemon is about to run realdbck to check the database. Logons will be inhibited until the check is complete. |
|
Checking the database succeeded and logons are enabled. |
|
Checking the database failed and the database has been left locked. |
|
Checking the database failed, but logons have been enabled anyway. |
|
The start-up test found that the database was not shut down cleanly but logons have been enabled anyway. |