Recipe 6.12. Rebuilding a Database File from LogsProblemOne of your databases has become corrupt and you want to restore it using only the transaction log files. SolutionUsing a graphical user interface
DiscussionIf you have an unbroken chain of transaction log files and PRIV1.EDB becomes corrupt, you can quickly and accurately recover the data store by dismounting the database and removing (or renaming, which is much safer) the existing CHK, EDB and STM files. When you attempt to remount the database, the IS will create new, empty EDB and STM files, then it will begin sequentially playing back log files to restore the contents of these files. Note that the anchor log isn't relevant here; in order for Exchange to restore the contents of the database accurately, you'll need all of the log files. There's no way to tell Exchange "start with log file #5 and go forward from there"; in the case of an empty EDB and STM, the anchor log file will always be the first one. Because this approach requires you to have every log file created since the database was created, it's pretty difficult to find circumstances where it makes sense. In most cases (and assuming a reasonable level of backup planning), it will be easier to fix the database by reloading it from a backup and playing back the needed transaction logs, as described in Recipe 11.4. See AlsoRecipe 11.4 for restoring a database, MS KB 278958 (How to Use Log Files to Rebuild the Priv1.edb File), and MS KB 296843 (How to recover an Exchange 2000 Server database after error -1216) |