In a Structured query language (SQL) Server, a recovery model manages transaction logs and controls how they are logged, backed up, and restored. A master database file (MDF) and a log database file (LDF) are included in the SQL Server database (LDF). All database objects, such as tables, stored procedures, and information, are stored in the MDF data file. The LDF log file contains all of the logs that occur in a database, such as transactions. In SQL Server, there are three types of recovery models:
In this lesson, we’ll look at how to find the existing model in our database, the pros and cons of SQL Server’s three recovery models, and how to change the model.
You can determine the existing recovery model in your database by using one of the methods listed below.
Using SQL Server Management Studio, follow these simple steps to determine the existing recovery model:

You can also use the SQL query below to locate the recovery model in a database.
SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'My_Database_Name' ;
The backup and restore options for a database are determined by the three recovery models (simple, full, and bulk-logged). If there is a malfunction or crash in the database, we can restore the data based on the type of recovery model.
The simple recovery model is SQL Server’s default recovery model. With each completed transaction, this model automatically deletes the transaction log records. As a result, it only supports full or differential backups, not transaction log backups.
If the database fails or crashes, you can restore it using the most recent full or differential backup. When using the simple recovery model, we cannot perform a point-in-time restore. As a result, data that was modified between the time of the most recent full or differential backup and the time of failure may be lost.
SQL Server’s full recovery model keeps the transaction logs until they are backed up. Using this model, we can restore the database at any point in time without losing any data.
The full recovery model, like the simple recovery model, saves transaction logs. However, it will not automatically remove them after each completed transaction. Along with insert and update transactions, the transaction logs also record index creation and modification. Because each transaction is recorded, the log file grows enormously in size. As a result, administration must keep a close eye on the growing log size.
The database will stop accepting new transactions if the transaction log is full until it has been backed up or truncated.
The data can be recovered to any specific point at will. So, this paradigm aids in preventing data loss.
Similar to the full recovery concept is the bulk-logged recovery model. The main distinction is that when bulk-logged actions like bulk insert, select into, and build index are carried out, the transaction log size is lowered. In contrast to the complete recovery approach, the transaction log size in this model is modest.
Due to the low logging of the bulk transactions, the bulk-logged recovery approach also improves the performance of big bulk processes. This model may not always support the point-in-time restoration. Only if no bulk-logged activities were carried out at the time the database malfunctioned or crashed could a point-in-time restore be conducted.
We can only restore the database to the last transaction log before the bulk operation was recorded if you perform a bulk operation.
In some cases, point-in-time restore is not supported.
Before changing a database’s recovery model, we must examine the database’s activity. It is recommended that we change the recovery model when database activity is low.
We must create a full backup of the database before changing the recovery model. If something goes wrong, we can quickly restore it to its original condition.
You can change the recovery model of a SQL database in one of two ways.
To change the recovery model in SQL Server Management Studio, follow these steps:
The following SQL query can also be used to modify a database’s recovery model.
USE [My_Database_Name] ; ALTER DATABASE [My_Database_Name] SET RECOVERY FULL ;
Not a member yet? Register now
Are you a member? Login now