SQL Server Simple Recovery Model

Overview

The “Simple” recovery model does what it implies, it gives you a simple backup that can be used to replace your entire database in the event of a failure or if you have the need to restore your database to another server.  With this recovery model you have the ability to do complete backups (an entire copy) or differential backups (any changes since the last complete backup).  With this recovery model you are exposed to any failures since the last backup completed, because you will only be able to restore the data to the point when the backup occured.

Explanation

The “Simple” recovery model is the most basic recovery model for SQL Server.  Every transaction is still written to the transaction log, but once the transaction is complete and the data has been written to the data file the space that was used in the transaction log file is now re-usable by new transactions.  Since this space is reused there is not the ability to do a point in time recovery, therefore the most recent restore point will either be the complete backup or the latest differential backup that was completed.  Also, since the space in the transaction log can be reused, the transaction log will not grow forever as was mentioned in the “Full” recovery model.

Here are some reasons why you may choose this recovery model:

  • Your data is not critical and can easily be recreated
  • The database is only used for test or development
  • Data is static and does not change
  • Losing any or all transactions since the last backup is not a problem
  • Data is derived and can easily be recreated

Type of backups you can run when the data is in the “Simple” recovery model:

  • Complete backups
  • Differential backups
  • File and/or Filegroup backups
  • Partial backups
  • Copy-Only backups

Set SQL Server Simple Recovery Model using T-SQL

ALTER DATABASE dbName SET RECOVERY recoveryOption
GO

Example: change AdventureWorks database to “Simple” recovery model

ALTER DATABASE AdventureWorks SET RECOVERY SIMPLE
GO

Set SQL Server Simple Recovery Model using Management Studio

  • Right click on database name and select Properties
  • Go to the Options page
  • Under Recovery model select “Simple”
  • Click “OK” to save
change database simple recovery model

5 Comments

  1. Hi Masters,

    I have a simple mode database. I insert about 300 KB data in loops, each loops ends with commit. The log file is continuously growing, growing :(

    Why? The article says, that “once the transaction is complete and the data has been written to the data file the space that was used in the transaction log file is now re-usable by new transactions”

    Thank you,
    Istvan

  2. Hi Zhong,

    When the database is in simple recovery mode once the transactions are complete and get written to the data file, that space in the transaction log can be reused so the transaction log doesn’t need to keep growing. It is a bit more complex than that, but overall, that is how it works.

    -Greg

  3. Hi Tan, the recovery model is just how the database works to save transactions and this impacts what types of backups you can do. See the other pages in this tutorial for how to actually do the backup.

Leave a Reply

Your email address will not be published. Required fields are marked *