SQL error operation using log Explorer revocation

Source: Internet
Author: User
Tags db2 mssql save file sql error

1. Download and install log Explorer

2. Open Log Explorer File=>attach log file-> Select Server and login method->connect->
Select Database->attach-> the left dialog box Browse->view log-> to see the log record.
To restore: Right-click Log Record undo transation-> Select Save file name and path, and then open the file to Query Analyzer to execute
T-SQL code can ...

For example, if log is delete table where ... , the generated file code is the Insert Table ....

Right-click Log Record undo transation-> Select Save file name and path and then open the file to Query Analyzer to execute T-SQL code ...

One issue used by log Explorer

1) Complete differences and log backups of the database
The deletion of inactive entries in the transaction log is selected during backup
Using Log Explorer to try to read the log,
Hint no log recorders found that match the filter,would your like to view unfiltered data
Select Yes to see the record.


If you do not choose to delete inactive entries in the transaction log
You can see the original log when you try to read it with Log Explorer.

2) Modify some of the data in one of the tables, at this time log Explorer to read logs, can be used for log recovery

3) Then restore the backup, (note: Recovery is to disconnect the log Explorer from the database, or connect to other data,
Otherwise, the database is in use and cannot be recovered)
When you're done recovering, turn on Log Explorer to prompt no log recorders found that match the filter,would your like to view unfiltered data
Select Yes to see the log record that you just modified in 2, so you cannot recover.

--------------------------------------------------------------------------------
The system has a database DB1, the system is in use of the process, accidentally deleted a table T1 data
Now I can recover the database by following the method of TIME1 recovery with full backup file plus log backup point-in-time

But the problem is that the database has to be in use, so in addition to the TA table where you deleted the data, the other
Table data you can't just revert to the wrong time point TIME1, because, TIME1 also have data changes later

There are two ways of solving this problem
1: Easy to handle with log Exeplore

2: First set up a database DB2, restore the full backup file to DB2, and then use the T1 data in DB2 to update
T1 data in the DB1.


--View backup information
RESTORE filelistonly from DISK = ' C:\Program Files\Microsoft SQL Server\mssql\backup\db1_backup '

--Restore the old backup
RESTORE DATABASE db2 from DISK = ' C:\Program files\microsoft SQL Server\mssql\backup\db1_backup ' with Replace,norecovery,
Move ' db1_data ' to ' C:\Program Files\Microsoft SQL Server\mssql\data\db2_data.mdf ',
Move ' db1_log ' to ' C:\Program Files\Microsoft SQL Server\mssql\data\db2_log.ldf '

--Restore the data log to a point in time
Restore log db2 from disk= ' Db_log_backup ' with stopat= ' 2003/4/22 9:57 '

SOURCE http://bbs.csdn.net/topics/300029748

SQL error operation using log Explorer revocation

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.