Shadowing System Databanks
The system databanks (SYSDB, TRANSDB, LOGDB, and SQLDB) require special handling in some situations.
If a problem occurs with these databanks or their shadows, the only permitted login is SYSADM logging into the BSQL program. The BSQL program will then recognize the problem and help you correct it.
System databanks are handled in the same way as other databanks, with the following exceptions:
- If an error is encountered on a user databank, automatic shadowing fail-over takes place. However, if there is a problem with SYSDB, TRANSDB, SQLDB or LOGDB, new users cannot login. Users already active will receive an error message when attempting operations that depend on the affected system databank, while other operations continue to work. The error state is held until Mimer SQL is stopped and the error is corrected.
- If there is a problem with SYSDB, TRANSDB or LOGDB shadows, new users cannot login until the faulty shadow is dropped or suspended, see If a Shadow for SYSDB, TRANSDB or LOGDB Is Not Accessible.
- No users can be connected while a shadow for SYSDB, TRANSDB, or LOGDB is being created, altered or dropped.
- You cannot create a shadow for SQLDB as it is a TEMPORARY databank.
Transforming a SYSDB Shadow to a Master
If SYSDB is lost or corrupt, any existing SYSDB shadow can be altered to become the master in order to allow Mimer SQL to start again.
The SYSDB shadow file should be renamed and/or moved to the location where the master SYSDB was. Then the BSQL is started and login is performed as SYSADM. Enter the name of the shadow to be transformed into the master, and exit.
ExampleMimer SQL command line utility, version 9.3.7 Username: SYSADM Password: MIMER/DB warning -18013 in function CONNECT MIMER/DB started from SYSDB shadow. Transform SYSDB shadow to master with BSQL, or restart system from master SYSDB -- Transform shadow -- DATABANK SHADOW OFFLINE FILE ======================================== SYSDB SYSSH N SYSDB_S --- One shadow found Name of shadow to transform (<CR> = skip): sysdb_s Shadow SYSSH transformed to master
If the disk where SYSDB is located becomes inaccessible, it may be more suitable to redefine the database home directory (to point out the SYSDB shadow) instead of restoring the original directory structure.
Note: In this case the ALTER DATABANK statement must be used for all databanks explicitly defined to be located on the halted disk, i.e. with an absolute file specification in the data dictionary.
If SYSDB is lost and no shadows exist, a backup copy of SYSDB can be restored to allow Mimer SQL to start again, an example of how to do this is given in Backing-up and Restoring Data.
TRANSDB and Shadowing
Shadowing TRANSDB assures that you can bring your database up-to-date if the TRANSDB master is lost or damaged.
Transforming a TRANSDB Shadow to a Master
Start the BSQL program and login as SYSADM. A message is displayed saying that TRANSDB cannot be opened, and a shadow must be transformed to the master, this is similar to the example in Transforming a SYSDB Shadow to a Master.
If there are uncompleted transactions they will be completed, as if the original TRANSDB was still functioning.
LOGDB and Shadowing
If some databanks are not shadowed but backup copies of the databanks exist, then a shadow of LOGDB is useful since LOGDB, in this case, is even more important from a restore perspective.
Transforming a LOGDB Shadow to a Master
Start the BSQL program and login as SYSADM. A message is displayed saying that LOGDB cannot be opened, and a shadow must be transformed to the master, this is similar to the example in Transforming a SYSDB Shadow to a Master.
If there are transactions not yet written to the log, they will be written automatically.
SQLDB and Shadowing
Shadowing SQLDB is not necessary because SQLDB only contains temporary data.
However, SQLDB is required when a user logs on to Mimer SQL. If SQLDB is corrupt or lost, you must recreate it by logging on to the BSQL program as SYSADM. This automatically recreates SQLDB if the databank is not found.
If a Shadow for SYSDB, TRANSDB or LOGDB Is Not Accessible
If a shadow for SYSDB, TRANSDB or LOGDB is not accessible, SYSADM should login to the BSQL program.
An error message is given followed by the option to drop the shadow or set it offline. If the shadow is corrupt or missing, you should drop it. For example:Mimer SQL command line utility, version 9.3.7 Username: SYSADM Password: MIMER/DB fatal error -16142 in function CONNECT Cannot open databank LOGDB_S, file logdb_s not found Inaccessible shadow encountered. DROP or SET OFFLINE? (D/S): D -- Drop shadow -- Shadow LOGDB_S dropped
If the shadow is only temporarily unavailable, it may be enough to set it offline for a short period of time.
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40