Rollback transaction using transaction log

后端 未结 4 1529
误落风尘
误落风尘 2020-12-13 15:57

Would it be possible rollback transactions using Transactionlog file for a particular record?

I am using SQL Server 2005.

相关标签:
4条回答
  • 2020-12-13 16:38

    Check out RedGate's LogRescue product. Without 3rd party products, you're probably limited to doing a point in time restore to a separate database and then manually copying the record back to your production database.

    0 讨论(0)
  • 2020-12-13 16:44

    As far as third-party software goes, you can use Dell's Toad software free for thirty days, and it has transaction logs with undo script generation capability.

    0 讨论(0)
  • 2020-12-13 16:49

    From what I know your options are ApexSQL Log (pricey but has a free trial) or undocumented SQL Server commands such as DBCC Log and fn_dblog.

    Any of these will only work if your database was in full recovery mode, in which case SQL Server stores a lot more details in transaction log.

    Also I don’t think this works for any type of transaction. I’ve seen people using this technique for reverting insert, update, delete but I’m really sure if it can be used to revert say ALTER TABLE or something like that.

    0 讨论(0)
  • 2020-12-13 16:56

    Natively, no. I believe there are some pricey third party tools to do this, though.

    Alternatively, you can restore your DB from a backup, and then RESTORE LOGS to a point in time with the STOPAT = '6/30/2009 2:30PM' argument.

    There are Apex and SQL Log Rescue available. If your logs aren't in FULL recovery mode, though, you may be up a creek if you can't restore.

    0 讨论(0)
提交回复
热议问题