Skip to main content

Recovery Model


A recovery model is a database property that controls how transactions are logged, whether the transaction log requires (and allows) backing up, and what kinds of restore operations are available. Three recovery models exist: simple, full, and bulk-logged. Typically, a database uses the full recovery model or simple recovery model. A database can be switched to another recovery model at any time.

SQL Server Recovery Models

The three types of recovery models that you can choose from are:

  1. Full
  2. Simple
  3. Bulk-Logged


FULL - Recovery Model

The full recovery model is the most complete recovery model and allows you to recover all of your data to any point in time as long as all backup files are useable and readable. With this model all operations are fully logged which means that you can recover your database to any point. In addition, if the database is set to the full recovery model you need to also issue transaction log backups otherwise your database transaction log will continue to grow forever.

STEPs to Step-up via SSMS

STEP 1: Right click on database name and select Properties

STEP 2: Go to the Options page

STEP 3: Under Recovery model select "Full"

STEP 4: Click "OK" to save

Why FULL Recovery Model?

  • Data is critical and you want to minimize data loss.
  • You need the ability to do a point-in-time recovery.
  • You are using Database Mirroring.
  • You are using Always On Availability Groups.

Types of backups you can run when the data is in the "Full" recovery model:

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

Step-up FULL Recovery Model via T-SQL

ALTER DATABASE <Database Name> SET RECOVERY FULL

GO


Simple - Recovery Model

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.

STEPs to Step-up via SSMS

STEP 1: Right click on database name and select Properties

STEP 2: Go to the Options page

STEP 3: Under Recovery model select "Simple"

STEP 4: Click "OK" to save

Why Simple 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.

Types 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

Step-up Simple Recovery Model via T-SQL

ALTER DATABASE <Database Name> SET RECOVERY SIMPLE

GO


Bulk-Logged - Recovery Model

An adjunct of the full recovery model that permits high-performance bulk copy operations such as BULK INSERT, CREATE INDEX, SELECT INTO, etc... that are not fully logged in the transaction log and therefore do not take as much space in the transaction log. Can recover to the end of any backup. Point-in-time recovery is not supported. Log backups may be of a significant size because the minimally-logged operations are captured in the log backup. If the log is damaged or bulk-logged operations occurred since the most recent log backup, changes since that last backup must be redone.

STEPs to Step-up via SSMS

STEP 1: Right click on database name and select Properties

STEP 2: Go to the Options page

STEP 3: Under Recovery model select "Bulk-logged"

STEP 4: Click "OK" to save

Why Bulk-Logged Recovery Model?

  • Data is critical and you want to minimize data loss, but you do not want to log large bulk operations
  • Bulk operations are done at different times versus normal processing.

Types of backups you can run when the data is in the "Bulk-Logged" recovery model:

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

Step-up Bulk-Logged Recovery Model via T-SQL

ALTER DATABASE <Database Name> SET RECOVERY BULK_LOGGED

GO


Popular posts from this blog

Download SQL Server Management Studio (SSMS)

Summary:  In this post, you will learn &  able to download  SSMS. About  SQL Server Management Studio ( SSMS ):  SSMS is Free!! SQL Server Management Studio (SSMS) is an integrated environment for managing any SQL infrastructure, from SQL Server to Azure SQL Database. SSMS provides tools to configure, monitor, and administer instances of SQL Server and databases. Use SSMS to deploy, monitor, and upgrade the data-tier components used by your applications, and build queries and scripts. Use SSMS to query, design and manage your databases and data warehouses, wherever they are - on your local computer, or in the cloud.   SSMS -  Prerequisites for Installation: SSMS supports the following 64-bit platforms when used with the latest available service pack: Supported Operating Systems: Windows 10 (64-bit) version 1607 (10.0.14393) or later Windows 8.1 (64-bit) Windows Server 2019 (64-bit) Windows Server 2016 (64-bit) Windows Server 2012 R2 (64-bit) Window...

What is SQL Server?

SQL Server SQL Server is a relational database management system (RDBMS) developed by Microsoft. SQL Server supports a wide variety of transaction processing, business intelligence and analytics applications in corporate IT environments. SQL Server supports ANSI SQL, which is the standard SQL (Structured Query Language) language. However, SQL Server comes with its own implementation of the SQL language, T-SQL. Why SQL Server? Microsoft SQL Server is a comprehensive database server and information platform offering a complete set of enterprise-ready technologies and tools that help people derive the most value from information at the lowest total-cost-of-ownership. Enjoy high levels of performance, availability, and security; employ more productive management and development tools; and deliver pervasive insight with self-service business intelligence (BI). A complete and integrated platform, Microsoft SQL Server brings it all together to get more value out of existing IT skills and asse...

SQL Server Tools - Microsoft Recommended Tools

Graphic User Interface (GUI-based Tools) SQL Server Management Studio (SSMS) SSMS SSMS is Free!!  SQL Server Management Studio (SSMS) is an integrated environment for managing any SQL infrastructure, from SQL Server to Azure SQL Database. SSMS provides tools to configure, monitor, and administer instances of SQL Server and databases. Use SSMS to deploy, monitor, and upgrade the data-tier components used by your applications, and build queries and scripts. Use SSMS to query, design and manage your databases and data warehouses, wherever they are - on your local computer, or in the cloud. SSMS -  Prerequisites for Installation: SSMS supports the following 64-bit platforms when used with the latest available service pack: Supported Operating Systems: Windows 10 (64-bit) version 1607 (10.0.14393) or later Windows 8.1 (64-bit) Windows Server 2019 (64-bit) Windows Server 2016 (64-bit) Windows Server 2012 R2 (64-bit) Windows Server 2012 (64-bit) Windows Server 2008 R2 (64-bit) Suppor...