Use of Log Explorer

Source: Internet
Author: User

Usage:

Open Log Explorer->AttachLog File ->Select SQL Server server and login Mode->Connect->
Select database in Database Name->Attach->Browse in the left-side dialog box-> View Log->You can see the log record.

To restore the log, right-click the log record undo transation.->Select save file name and Path->Open the file and run it in the query analyzer.
T-SQLCodeYou can.

For example, if log is deleteTable Where... The generated file code is insertTable....
Then, put the insert table code in the query analyzer and execute it to restore the data.

-- --------------------------------------------------------------------
-- How to restore deleted/updated data
-- --------------------------------------------------------------------
1 Connect to the database of the deleted Database
Open Log Explorer and select" File " -> "Attach Log File " -> Select Server and login Mode -> "Connect" -> Select "Database" -> "Attach"
2 View logs
Select" Browse "Project -> " View Log " -> The current log record is displayed.
3 Restore data
Right-click a log record and select "undo transation" -> "Select Save file name and path" -> Open the file and run it in the query analyzer.
T - SQL code is enough.
For example, if log is delete Table Where ... The generated file code is insert Table ....

-- --------------------------------------------------------------------
-- Log Explorer restores data after the drop table and truncate table
-- --------------------------------------------------------------------
1 Connect to the database of the deleted Database
Same as above
2 Recovery Method
1 ) Select "salvaage dropped / Truncate "Menu, select the table name And droped in the dialog box on the right. / Date of trucated,
File In name, select the storage location where the insert statement is generated. In condition, select droped or truncated,
Click" Create "The insert statement will be generated, and the generated statement will be executed in the query analyzer.
2 ) Select the "viewddl commands" menu -> Select" Truncate Table "Operation item -> Click "Salvage" -> Generate statement ->
Query analyzer execution

-- --------------------------------------------------------------------
-- Several Problems in Log Explorer
-- --------------------------------------------------------------------
1 ) Complete database operations / Difference / Log backup
If you select to delete the non-active entries in the transaction log during backup
When you try to view logs again Using Log Explorer, the system prompts No Log Recorders found that match the filter, wocould you Like To View If unfiltered data is set to yes, the record is not displayed.

If you do not select to delete non-active entries in the transaction log
When Log Explorer is used to view logs, the original logs can be viewed and restored.
2) Modified part of the data in one of the tables. At this time, Log Explorer is used to view the logs, which can be used for log recovery.
3) And then recover the backup. (Note: The restoration is to disconnect Log Explorer from the database or connect to other data,
Otherwise, the database is in use and cannot be recovered)
After restoration, Log Explorer prompts NoLogRecorders found that match the filter, wocould youLike To ViewUnfiltered data. If you select Yes, you cannot see the log record modified in step 2. Therefore, the data cannot be restored.
4Do not use the SQL backup function to back up your logs.

The correct backup method is:
Stop SQL Service, copy data files and log files for file backup.

Start the SQL service and use Log Explorer to restore data.

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.