Restore data to point using database logs _ PHP Tutorial

Source: Internet
Author: User
Recover Data-to-point operations using database logs. Many of you may have encountered the following problems: the update or delete statement does not include the where clause, or the where clause is not accurate enough, which causes serious consequences after execution, in this case, many friends may have encountered the following problems:
If the update or delete statement does not include the where clause or the where clause is not accurate enough, the execution may cause serious consequences. in this case, data recovery can only be performed using the backup of transaction logs, therefore, if your SQL statement does not have a full-database backup or cannot back up logs (The truncate log on checkpoint option is 1), data cannot be restored, or you can only recover the data from the last backup.
The following describes how to restore data:
1. if a full-database backup (or multiple differential or incremental backups exist) exists before the misoperation ), the first thing to do is to perform a log backup (if trunc is set to prevent the log file from becoming larger. log on chkpt. if option is set to 1, you will die)
Backup log dbName to disk = 'filename'
2. recover a full-Database Backup. use with norecovery. if there are other differences or incremental backups, recover them one by one.
Restore database dbName from disk = 'filename' with norecovery
3. restore the last log backup, that is, the log backup you just created. specify the recovery time point to the time before the misoperation.
Restore log dbName from disk = 'filename'
With stopat = 'date _ time'
These operations can be completed in the SQL SERVER Enterprise Manager, which is not difficult...
Of course, if the misoperation involves operations that do not remember logs, such as truncate table and select into, the above methods cannot be used to recover data...


When the explain update or delete statement does not include the where clause, or the where clause is not accurate enough, it causes serious consequences after execution. in this case, the data is restored...

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.