카테고리 없음

Transaction log 를 이용한 복구

보미아빠 2013. 11. 7. 17:07

 

 

 

select who.[Current LSN], sl.name, cast(who.[Begin Time] as datetime) [Begin Time], what.Operation
  , what.[RowLog Contents 0]
  , what.[RowLog Contents 1]
  , what.*
  from fn_dblog (NULL, NULL) who
  join fn_dblog (NULL, NULL) what
    on left (who.[Current LSN], 17) = left (what.[Current LSN], 17)
  join sys.syslogins sl
    on who.[Transaction SID] = sl.sid
 where who.Operation = 'LOP_BEGIN_XACT'
   and what.PartitionId = (select partition_id from sys.partitions where object_id = object_id('student'))
   and what.[Context] IN ('LCX_HEAP','LCX_CLUSTERED')
   and cast(who.[Begin Time] as datetime) between '20000101' and '20200101'

 

 

http://www.sqlservercentral.com/articles/Transaction+Logs/71415/

http://raresql.com/2012/02/01/how-to-recover-modified-records-from-sql-server-part-1/

http://raresql.com/2012/02/01/how-to-recover-modified-records-from-sql-server-part-2/