Export (0) Print
Expand All

Considerations for Switching from the Full or Bulk-Logged Recovery Model

A database can be switched to another recovery model at any time. If a switch occurs during a bulk operation, the logging of the bulk operation changes accordingly.

Switching between full and bulk-logged recovery models is useful before and after large bulk operations. The full recovery model, which fully logs all transactions, is intended for normal use. The bulk-logged recovery model is intended to be used temporarily during a large bulk operation—assuming that it is among the bulk operations that are affected by the bulk-logged recovery model (for more information, see Operations That Can Be Minimally Logged). If you switch between the full and bulk-logged recovery models during a bulk operation, logging of the bulk operation changes accordingly.

NoteNote

Some features such as database mirroring require that the database remain in the full recovery model.

For a database that uses full recovery, switching to the bulk-logged recovery model temporarily for bulk operations improves performance. However, if data loss is unacceptable, to prevent data loss, we recommend that you switch to the bulk-logged recovery model only under the following conditions:

  • Users are currently not allowed in the database.

  • No modifications are made during bulk processing that are not recoverable without depending on taking a log backup; for example, by re-running the bulk processes.

We recommend that:

  • Before switching to the bulk-logged recovery model, you back up the log.

    This is important because, under the bulk-logged recovery model, if the database fails, backing up the log for bulk operations requires access to the data.

  • After performing the bulk operations, you immediately switch back to full recovery mode.

  • After switching back from the bulk-logged recovery model to the full recovery model, you back up the log again.

Following these recommendations fully protects your data and enables point-in-time recovery. The following figure illustrates these recommendations.

Recommend process for using bulk-logged recovery

When switching between two recovery models, your backup strategy remains the same: continue performing periodic database, log, and differential backups.

Switching from the full or bulk-logged recovery to simple recovery is possible, but uncommon.

Back up the transaction log just before switching to the simple recovery model, to permit recovery to that point. Backing up the log is not supported under the simple recovery model, so, after switching, discontinue any scheduled jobs for backing up the transaction log. For more information, see How to: Change Maintenance Tasks in the Maintenance Plan Wizard.

To change the recovery model (Transact-SQL)

Use ALTER DATABASE, as follows:

  • To set the database to the full recovery model:

    USE master;

    ALTER DATABASE database_name SET RECOVERY FULL;

  • To set the database to the bulk-logged recovery model:

    USE master;

    ALTER DATABASE database_name SET RECOVERY BULK_LOGGED;

NoteNote

To change the default recovery model for new databases, use ALTER DATABASE to change the recovery model of the model database.

To change the recovery model (SQL Server Management Studio)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft