SQL Server Recovery Models: A Quick Guide
Tags: sql, database
Published: 2021-07-27 10:47:13

---
title: SQL Server Recovery Models: A Quick Guide
published: true
date: 2021-07-27 10:00:42 UTC
tags: sql, database
canonical_url: https://www.syncfusion.com/blogs/post/sql-server-recovery-models-a-quick-guide.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2021/07/SQL-Server-Recovery-Models-A-Quick-Guide-672x372.png
---

A recovery model in a [Structured query language (SQL) Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server "Link to Microsoft SQL Server Wikipedia page") manages the transaction logs and handles how they are logged, backed up, and restored. The SQL Server database contains a master database file (MDF) and a log database file (LDF). The MDF data file consists of all the database objects, such as tables, stored procedures, and information. The LDF log file consists of all the logs, such as transactions that occur in a database.  There are three types of recovery models in SQL Server:

- [Simple](#simple-recovery-model)
- [Full](#full-recovery-model)
- [Bulk-logged recovery model](#bulk-logged-recovery-model)

In this blog post, we will see how to find the existing model in our database, the pros, and cons of the three recovery models in SQL Server, and how to change the model.

## How to find the existing recovery model in SQL Server

You can check what the existing recovery model in your database is using either of the following ways.

### SQL Server Management Studio

Follow these simple steps to find out what the existing recovery model is using the [SQL Server Management Studio](https://en.wikipedia.org/wiki/SQL_Server_Management_Studio "Link to SQL Server Management Studio Wikipedia page"):

1. First, open the SQL Server Management Studio.
2. Then, right-click on the **Database** and select the **Properties** option **.**
3. Now, the **Database Properties** window will appear. In that, select **Options** from the left pane. Then, it will display the current recovery model in your database.  
Refer to the following screenshot.  
 ![Database Properties Window](https://www.syncfusion.com/blogs/wp-content/uploads/2021/07/Database-Properties-Window.png)

### SQL query

You can also use the following SQL query to find the recovery model in a database.

```sql
SELECT name, recovery_model_desc
FROM sys.databases
WHERE name = 'My_Database_Name' ;
```

## Three types of recovery models in SQL Server

The three recovery models (simple, full, and bulk-logged) determine the backup and restore options for a database. Based on the type of the recovery model, we can restore the data if there is a malfunction or crash in the database.

### Simple recovery model

The basic recovery model in SQL Server is the simple recovery model. This model automatically removes the transaction log records on every completed transaction. So, it doesn’t support transaction log backups, only full or differential backup.

If there is a malfunction or crash in the database, then you can restore it with the recent full or differential backup. We cannot perform a point-in-time restore when using the simple recovery model. So, this may lead to a loss of the data that was modified between the time of recent full or differential backup and the time of failure.

#### Advantages

- The simple recovery model will automatically remove the transaction logs, so the disk size required is very small.
- It requires minimum administration comparing to the full and bulk-logged recovery models.

#### Disadvantages

- The major drawback of the simple recovery model is that it does not support point-in-time restore. So, it may cause a loss of data during a database malfunction.
- This recovery model is not suitable for production databases of an organization where data loss will not be accepted.

### Full recovery model

The full recovery model in SQL Server maintains the transaction logs until it is backed up. Using this model, we can restore the database at any point in time and there will not be any data loss.

Like the simple recovery model, the full recovery model records the transaction logs. But, it will not remove them automatically on each completed transaction. Along with the insert and update transactions, the transaction logs also record the creating and altering indexes. This process makes the log file size huge, as each transaction is recorded. So, this process requires administration to closely monitor the growing log size.

If the transaction log becomes full, the database will not accept further transactions until the log file is either backed up or truncated.

#### Advantages

- We can restore the data to any arbitrary point. Thus, this model helps us avoid data loss.

#### Disadvantages

- The transaction log file size is huge, and it grows in size with every transaction.
- It requires the administration to closely monitor the growing log size.
- If the transaction log is full, then the database will reject further transactions.

### Bulk-logged recovery model

The bulk-logged recovery model is similar to the full recovery model. The only difference is that the transaction log size is minimized when performing bulk-logged operations like bulk insert, select into and create index. So, the transaction log size in this model is small when comparing to the full recovery model.

Additionally, the bulk-logged recovery model increases the performance of large bulk operations, due to the minimal logging of the bulk transactions. In some cases, this model won’t support the point-in-time restore. The point-in-time restore can be done only if no bulk-logged operations are performed during the time of database malfunctioning or crashes.

If you perform a bulk operation, then we can restore the database only to the last transaction log before the bulk operation was recorded.

### Advantages

- The transaction log file size will not grow massive in size when comparing to the full recovery model.
- The point-in-time restore is also possible in the bulk-logged recovery model but only in certain cases.
- This model increases the performance of bulk operations due to minimal logging.

### Disadvantages

- Point-in-time restore is not supported for certain cases.

## How to change the recovery model

Before changing the recovery model of a database, we need to check the database activity. It is recommended that we change the recovery model during a time of lower database activity.

Before changing the recovery model, we need to make a full backup of the database. If anything goes wrong, we can immediately restore it to its original state.

You can change the recovery model of an SQL database using either of the following ways.

### SQL Server Management Studio

Follow these steps to change the recovery model using the SQL Server Management Studio:

1. First, open the SQL Server Management Studio.
2. Then, right-click on  **Database** and select  **Properties**.
3. Now, the Database Properties window will appear. In that, select **Options** from the left pane.
4. Then, select the new recovery model from the drop-down.
5. Finally, click  **Ok**  to reflect the changes.  
 ![Updating the Recovery Model in SQL Server Database](https://www.syncfusion.com/blogs/wp-content/uploads/2021/07/Updating-Recovery-Model-in-SQL-Server-Database.png)

### SQL query

You can also use the following SQL query to change the recovery model of a database.

```sql
USE [My_Database_Name] ;
ALTER DATABASE [My_Database_Name] SET RECOVERY FULL ;
```

## Conclusion

Thanks for reading! I hope you have a clear idea of the three different recovery models in SQL Server, how to check the existing one, and how to change it in your database. Try out the steps in this blog post and leave your feedback in the comments section!

Syncfusion has over 1,600 components and frameworks for [WinForms](https://www.syncfusion.com/winforms-ui-controls "Link to WinForms UI controls"), [WPF](https://www.syncfusion.com/wpf-ui-controls "Link to WPF UI controls"), [WinUI](https://www.syncfusion.com/winui-controls "Link to WinUI controls"), ASP.NET ([Web Forms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls "Link to ASP.NET Web Forms UI controls"), [MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls "Link to ASP.NET MVC UI controls"), [Core](https://www.syncfusion.com/aspnet-core-ui-controls "Link to ASP.NET Core UI controls")), [UWP](https://www.syncfusion.com/uwp-ui-controls "Link to UWP UI controls"), [Xamarin](https://www.syncfusion.com/xamarin-ui-controls/ "Link to Xamarin UI controls"), [Flutter](https://www.syncfusion.com/flutter-widgets "Link to Flutter UI controls"), [JavaScript](https://www.syncfusion.com/javascript-ui-controls "Link to JavaScript UI controls"), [Angular](https://www.syncfusion.com/angular-ui-components "Link to Angular UI controls"), [Blazor](https://www.syncfusion.com/blazor-components "Link to Blazor UI controls"), [Vue](https://www.syncfusion.com/vue-ui-components "Link to Vue UI controls"), and [React](https://www.syncfusion.com/react-ui-components "Link to React UI controls"). Use them to boost your application development speed.

For existing customers, the new version is available for download from the [License and Downloads](https://www.syncfusion.com/account/downloads "Link to license and download page of Essential Studio") page. If you are not yet a Syncfusion customer, you can try our 30-day [free trial](https://www.syncfusion.com/downloads "Link to the free evaluation of the Syncfusion Essential Studio") to check out our available features.

You can also contact us through our [support forum](https://www.syncfusion.com/forums "Link to the Syncfusion support forum"), [Direct-Trac](https://www.syncfusion.com/support/directtrac/ "Link to the Syncfusion support system Direct Trac"), or [feedback portal](https://www.syncfusion.com/feedback "Link to Syncfusion Feedback Portal"). We are always happy to assist you!

If you like this blog post, we think you’ll also like the following useful articles:

- [Top 10 SQL Query Optimization Techniques](https://dev.to/karthickramasamy08/top-10-sql-query-optimization-techniques-4c37-temp-slug-7449485 "Link to Top 10 SQL Query Optimization Techniques blog") [Blog]
- [How to Export Data from SQL Server to Excel Table in C#](https://dev.to/syncfusion/how-to-export-data-from-sql-server-to-excel-table-in-c-fo7 "Link to How to Export Data from SQL Server to Excel Table in C# blog") [Blog]
- [How to Migrate SQL Server in an ASP.NET MVC Application to MySQL and PostgreSQL](https://www.syncfusion.com/blogs/post/how-to-migrate-sql-server-in-an-asp-net-mvc-application-to-mysql-and-postgresql.aspx "Link to How to Migrate SQL Server in an ASP.NET MVC Application to MySQL and PostgreSQL blog") [Blog]
- _[SQL Server Metadata Succinctly](https://www.syncfusion.com/succinctly-free-ebooks/sql-server-metadata-succinctly "Link to the eBook SQL Server Metadata Succinctly")_ [Ebook]
- _[SQL Queries Succinctly](https://www.syncfusion.com/succinctly-free-ebooks/sql-queries-succinctly "Link to the eBook SQL Queries Succinctly")_ [Ebook]
- _[SQL on Azure Succinctly](https://www.syncfusion.com/succinctly-free-ebooks/sqlazure "Link to the eBook SQL on Azure Succinctly")_ [Ebook]