An application is provided with ODEX called "odexjob". This suspends database activity allowing the database to be backed up without the risk of corruption. If this is not possible or an alternative backup method is being employed (eg file replication), there could be some minor corruption. It may also be possible to fix a "broken" database rather than having to restore from a backup.
The DIRMASTR database contains the user directory (details of trading partners). It should change infrequently (only when you add/delete trading partners).
Likewise the TPRMASTR will only change when you add/edit Trading Partner Relationships.
The CTLMASTR database contains details of every sent/received file in the system and is changing whenever files are being processed.
The CTLINDEX database acts as an index for the CTLMASTR.
The CTLINDEX database can be rebuilt at any time from the CTLMASTR. When restoring from a backup, it is always safer to recreate the CTLINDEX from the CTLMASTR. This ensures that they are both in sync (run odexdist with the flags –ir to create a new CTLINDEX and rebuild it from the CTLMASTR) .
The WTDMASTR contains a note of any files or EERPs for which a call needs to be made (WTD = work to do). Records are removed once the file/EERP is sent.
The WTDMASTR should also be rebuilt from the CTLMASTR (it is by rebuilt on startup by default unless you run odexdist with the –w flag)
When the WTDMASTR, CTLMASTR and CTLINDEX are out of sync, you can experience problems of ODEX trying to send files which don’t exist).
So the most likely cause of problems is the CTLMASTR database. There are no referential integrity issues as the database is effectively a single table. Each database consists of a .dt file which contains a series of records and a .nx file acts as an index to locate them. The .nx should be rebuilt from the .dt if ODEX was running when the backup was taken.
Generally it is best to try to fix broken databases before restoring them from a backup.
First rebuild the nx from the dt using:
filefix –d DIRMASTR
filefix –d CTLMASTR
filefix DIRMASTR
filefix CTLMASTR
Then try rebuilding the databases in their entirety:
DIRMASTR
isamfix –ad
isamfix –am
CTLMASTR
isamfix –bd
isamfix –bm
Once they work, rebuild the CTLINDEX from the CTLMASTR (don’t restore one without the other).
|