MSSQL restore to a point in time using log backups

Source: Internet
Author: User
Tags mssql

when you do an update or delete operation, you forget the Where condition or where the precision of the Where condition is insufficient, the result of data loss or update error after execution, if your database has a corresponding full backup, and cannot back up the log (truncate log on The checkpoint option is 1) You can use the backup of the transaction log for data recovery.

The steps to recover the data are as follows:

1, the first thing to do is to make a log backup (if you want to keep the log file size trunc. Log on chkpt. Option 1 Then it's not working)
Backup log dbName to disk= ' D:\NorthwindCS_log_20140908_2.bak '
2, restore a full-library backup, note the need to use with NORECOVERY, if there are other differential or incremental backups, then restore
Restore database DbName from disk= ' D:\NorthwindCS_full_20140901_2.bak ' with NORECOVERY
3, restore the last log backup is just the log backup, specify the point of recovery time to the time before the wrong operation
Restore log dbName from disk= ' D:\NorthwindCS_log_20140908_2.bak '
With stopat= ' 2014-03-16 11:10:00.740 '

truncate table,select into and other operations do not log logs and cannot take advantage of logs to recover the data ...

MSSQL restore to a point in time using log backups

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.