What are the three recovery models provided by SQL Server? What is the difference?

Source: Internet
Author: User

SQL Server provides three recovery models:

L simple recovery: allows you to restore the database to the latest backup.

L full recovery: allows you to restore the database to the fault point state.

L large-capacity log record recovery allows large-capacity log record operations.

Each of these models targets different performance, disk and tape space, and data loss protection needs. For example, when selecting a recovery model, you must consider the trade-offs between the following business requirements:

L performance of large-scale operations (such as index creation or large-capacity loading ).

L data loss performance (for example, committed transaction loss ).

L Space Loss of transaction logs

L simplify the backup and recovery processes.

Multiple suitable models can be created based on ongoing operations. After selecting a recovery model, design the required backup and recovery processes. Table 6 provides an overview of the advantages and meanings of the three recovery models.

Table 6 Comparison Between backup Models

Recover Model Advantages Performance of Work Loss Can it be restored to the instant point?
Simple Allows high-performance and large-capacity replication operations.

 

Reclaim the log space to minimize the space requirement.

Changes made after the latest database or differential backup must be redone. It can be restored to the end of any backup. Then you must redo the changes.
Complete Data File loss or damage will not cause work loss.

 

Can be recovered to any instant point (for example, ApplicationProgramOr before the user error ).

Normally, no.

 

If the log is corrupted, you must redo the changes that have occurred since the latest log backup.

It can be restored to any instant point.
Large-capacity Logging Allows high-performance and large-capacity replication operations. Large-capacity operations use the least log space. If the log is damaged or a large operation occurs after the latest log backup, you must redo the changes made since the last backup. Otherwise, no work is lost. It can be restored to the end of any backup. Then you must redo the changes.

Simple recovery requires minimal management. In a simple recovery model, data can only be restored to the latest full database backup or differential backup status. The minimum transaction log space is used instead of the transaction log backup. Once the log space is no longer needed to be recovered from a server failure, the log space can be reused. Compared with the full model or large-capacity logging model, the simple recovery model is easier to manage, but if the data file is damaged, the data loss performance is higher.

The full recovery and large-capacity log recovery model provides the maximum protection for data. These models rely on transaction logs to provide full recoverability and prevent the maximum loss of work caused by failures. The full recovery model provides the maximum flexibility to restore the database to an earlier instant point.

The large-capacity logging model provides higher performance and lower log space consumption for some large-scale operations (such as index creation or large-capacity replication. However, this will sacrifice some flexibility for point-in-time recovery. Many databases have to go through the large-capacity loading or index creation phase, so you may want to switch between the large-capacity logging model and the full recovery model.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.