preface
emmm, one day when I go to work, I chat with my friends and modify the database data. Accidentally, I updated it without a conditional statement. About 6W of more records in that table were all modified by mistake. The whole person suddenly panicked, and then thought about it calmly. This is my local database panicking. However, the data has been changed by more than 6W, and I don't want to synchronize it from the official database. So all kinds of searches and search for solutions on the Internet. Since my local database version is SQL Server 2008, I have been reading blogs for a long time, and most blogs require that the database have been fully backed up at least once. I'm sorry, but I really haven't backed up my local database yet. This method does not work, so it can only be doneIt's a different way. Until I found a tool to recover data from database logs -ApexSQL Log。 This software, the genuine version needs to be paid, a few hundred dollars, the free version can query the operation of each data, can be recovered by a single piece of data, of course, you can also export and restore SQL statements in batches, but only export one for every ten pieces of data, that is to say, my 6W piece of data, can only recover one-tenth in batches. Still not in line with my needs. I found a free cracked version of ApexSQL Log (https://down.itsvse.com/item/11530.html)。 You can download it yourself.
environment
>SQL Server2008
tools
>ApexSQL Log 2016 cracked for self-use
Text
Step 1: After downloading, unzip it directly and find itApexSQLLog.exe- > double-click to open。
Step 2:After opening, some will pop up the update interface, and you can directly select Cancel.
Step 3: Now enter the main interface, you will see the following picture, Server selects the server to be restored, and the following content is also selected accordingly。 Since it is a cracked version, some of the lines in the selection of the database are not displayed, but it does not affect the use. Finally select Next.
Step 4: Select the corresponding database log file and go to the next step。
Step 5: You can see the following four options, we choose the first one, you can clearly see all the operation records, of course, you can also choose the second item to restore directly, below we choose the first item。
Step 6: First, select the time range according to the corresponding scenario, here we select the last 24 hours。
Step 7: Then select according to the corresponding operation type。
Step 8: Then select the form you want to restore - > Finish。
Step 9: We can see that this interface clearly displays our operation data within 24 hours, the type of execution - update, detailed time, what data has been changed, the data before the change, and the data after the change。
Even in the following interface, we can directly see the operation record of the line, undo the script, and retry the script.
We areTo recover data, you can directly paste the statement in the Undo Script above and execute it. Of course, if the data volume is large, continue with the operation of batch exporting scripts below
Step 10: Select all the data you want to recover ,——> select Undo Script in the menu bar.
Step 11: We can see the following interface that pops up, which is full of SQL scripts. You can paste it directly into the database to execute, or you can continue to connect to the database in this tool to execute, let's continue to use this tool to execute, click the Execute button.
Step 12: Below we can see that the execution is successful.
Epilogue
In this way, all the misoperated data is recovered. Although it can be recovered, friends should still be cautious about operating database data. If such a big mistake is made in the production environment, it will have very serious consequences. If the final step is unclear, you can leave a message below.
|