Are You Switching to BULK_LOGGED Recovery Model? Know Your Risks.
Basically, the tail-of-the-log backup encountered an error in the process but continued anyway. That also means that we can’t really rely on this backup. Let’s try restoring this tail-of-the-log backup as part of our restore sequence. [sourcecode language="SQL"] -- Try restoring from backups RESTORE DATABASE [testDB] FROM DISK = 'C:\Demos\testDB.bak' WITH REPLACE, NORECOVERY; GO RESTORE LOG [testDB] FROM DISK = 'C:\Demos\testDB_Log1.trn' WITH REPLACE, NORECOVERY; GO --Restore the tail-of-the-log backup RESTORE LOG [testDB] FROM DISK = 'C:\Demos\testDB_tail.trn' WITH REPLACE; GO [/sourcecode]
Because the database was switched to bulk-logged recovery model and other backup occurred prior to the disaster, the tail-of-the-log backup we were attempting did not contain enough information to recreate the index maintenance task that we did. In order to properly recreate that transaction, the backup process needed to access the data files that have been changed by the transaction. Since the data file in this case was damaged, there was no way for the tail-of-the-log backup to capture that information, thus rendering it as corrupt. This should give you some insights into the risk that your databases face when switching to the bulk-logged recovery model. So, what do you need to do to avoid this risk? Make sure that you run a backup immediately after the transactions you are running under the bulk-logged recovery model complete. That backup will certainly include all of the data pages that were changed by the minimally logged transaction and would be enough to recover your database should something happen afterwards. Don’t say I didn’t warn you!
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Cutting Costs And Building Sales By Migrating To Google Cloud Platform

Cutting Costs And Building Sales By Migrating To Google Cloud Platform
Nov 7, 2019 12:00:00 AM
2
min read
MySQL on AWS: RDS vs EC2
MySQL on AWS: RDS vs EC2
Dec 21, 2016 12:00:00 AM
3
min read
Log buffer #555: a carnival of the vanities for DBAs
Log buffer #555: a carnival of the vanities for DBAs
Oct 4, 2018 12:00:00 AM
1
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.