Data Recovery from Log Explorer to drop/truncate table

Source: Internet
Author: User
Tags truncated

Bytes ----------------------------------------------------------------------------------------

-- Environment Description:

-- Log Explorer version: Product Ver: 3.1.1, file Ver: 3.0.006 Enterprise Edition

-- DB version: mssql2000 8.00.194

-- Flystone

Http://blog.csdn.net/happyflystone

-- Reprinted to keep this information

Bytes --------------------------------------------------------------------------------------

 

-- Generate Test Database

  1. Use master
  2. Go
  3. Create Database csdn_test
  4. Go
  5. Use csdn_test
  6. Go

 

-- Generate a test table

 

  1. Create Table TA (id int)
  2. Go
  3. Insert into ta select ID from sysobjects
  4. Go
  5. Select * from Ta
  6. /*
  7. ID
  8. -----------
  9. 1
  10. 2
  11. 3
  12. 4
  13. 6
  14. 8
  15. 9
  16. 10
  17. .......
  18. ............
  19. 2110682617
  20. 2126682674
  21. 11199140
  22. 27199197
  23. 14675150
  24. (The number of affected rows is 298)
  25. */

 

-- Drop table Ta

 

  1. Drop table Ta
  2. Go

 

-- Open Log Explorer

 

 

  1. Perform the following operations in sequence:
  2. Click allach log file on the left.
  3. --> Settings: SQL Server, login name, and password
  4. --> Click Connect.
  5. --> Select the database and use on-line log
  6. --> Click attach and confirm again.
  7. --> Click salvage dropped/truncated data on the left.
  8. --> Input table: DBO. Ta
  9. Enter approximate time the table was dropped/truncated:
  10. 16:00:00 (modified here)
  11. Condition: Select Table was droped
  12. --> CLICK: Create
  13. Log Explorer automatically creates a text file with the following content:
  14. Create Table [DBO]. [Ta] ([ID] INT)
  15. Insert into [DBO]. [Ta] ([ID]) values (1)
  16. Insert into [DBO]. [Ta] ([ID]) values (2)
  17. Insert into [DBO]. [Ta] ([ID]) values (3)
  18. Insert into [DBO]. [Ta] ([ID]) values (4)
  19. Insert into [DBO]. [Ta] ([ID]) values (6)
  20. Insert into [DBO]. [Ta] ([ID]) values (8)
  21. Insert into [DBO]. [Ta] ([ID]) values (9)
  22. Insert into [DBO]. [Ta] ([ID]) values (10)
  23. Insert into [DBO]. [Ta] ([ID]) values (11)
  24. Insert into [DBO]. [Ta] ([ID]) values (12)
  25. Insert into [DBO]. [Ta] ([ID]) values (14)
  26. Insert into [DBO]. [Ta] ([ID]) values (19)
  27. Insert into [DBO]. [Ta] ([ID]) values (20)
  28. Insert into [DBO]. [Ta] ([ID]) values (21)
  29. .....
  30. .......
  31. Insert into [DBO]. [Ta] ([ID]) valuees (1326679824)
  32. Insert into [DBO]. [Ta] ([ID]) valuees (1486680394)
  33. Insert into [DBO]. [Ta] ([ID]) valuees (1518680508)
  34. Insert into [DBO]. [Ta] ([ID]) valuees (2096166663)
  35. Insert into [DBO]. [Ta] ([ID]) valuees (1330871858)
  36. Insert into [DBO]. [Ta] ([ID]) valuees (1416496225)
  37. Insert into [DBO]. [Ta] ([ID]) valuees (1420740314)
  38. Insert into [DBO]. [Ta] ([ID]) valuees (1553440608)
  39. Insert into [DBO]. [Ta] ([ID]) valuees (214044294)
  40. Insert into [DBO]. [Ta] ([ID]) valuees (1855970334)
  41. Insert into [DBO]. [Ta] ([ID]) valuees (1887970448)
  42. Insert into [DBO]. [Ta] ([ID]) valuees (1903970505)
  43. Insert into [DBO]. [Ta] ([ID]) valuees (1993058136)
  44. Insert into [DBO]. [Ta] ([ID]) valuees (2009058193)
  45. Insert into [DBO]. [Ta] ([ID]) valuees (1998890438)
  46. Insert into [DBO]. [Ta] ([ID]) valuees (2110682617)
  47. Insert into [DBO]. [Ta] ([ID]) valuees (2126682674)
  48. Insert into [DBO]. [Ta] ([ID]) valuees (11199140)
  49. Insert into [DBO]. [Ta] ([ID]) valuees (27199197)
  50. Insert into [DBO]. [Ta] ([ID]) valuees (14675150)

 

-- Test successful

-- Note: The above data is local test data, and the intermediate data is omitted.

 

 

 

 

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.