Transaction Log and STOPAT !!

  • Hello All,

    One of the users came to me and asked me to do a restore of the production database since

    he deleted a table at about 6:19:05PM. He told me that a restore as of 6:19PM would do fine. I have put up a full database backup that happens at midnight 12 and then a 30min

    interval backup that happens every 30mins.

    So, in this case I the transaction log backup that I would need are 6:00PM and the 6:30PM

    one. The full database backup was already restored.

    So, after restoring all the transaction logs, I finally restored the 6:30PM transaction log

    backup with a STOPAT of 6:19PM.

    After the restore went through fine successfully, we discovered the table was actually empty and it was then the user told me that he actually deleted at 6:15:05 PM and that

    a restore as of 6:15PM would do fine.

    I tried re-applying the 6:30PM log till 6:15PM but that did not undo the restore that the previous restore had already been done (when I executed with STOPAT of 6:19PM).

    I eventually had to redo the full database restore and then re-restore all the transactions

    untill 6:15PM and recover the table.

    Now, is there a way to rollback to roll back to 6:15PM when I first applied the transaction log

    with a STOPAT of 6:19PM.

    Any help would be very much appreciated.

    Here is how I applied the log

    RESTORE DATABASE DBX

    FROM DISK = 'H:\BACKUP\DBX_Backup.bak'

    WITH FILE = 1,

    NOUNLOAD ,

    STATS = 10,

    STANDBY = 'H:\MSSQL\UNDO\DBX.DAT'

    REPLACE ,

    MOVE 'DBX_Log' TO 'H:\MSSQL\TLog\DBX_Log.LDF',

    MOVE 'DBX_Data' TO 'H:\MSSQL\Data\DBX_Data.MDF',

    GO

    RESTORE LOG DBX

    FROM DISK = 'H:\BACKUP\DBX_LogBackup.bak'

    WITH FILE = @RestoreCount, -- repeat this as many times as restorecount is required.

    NORECOVERY

    GO

    RESTORE LOG DBX

    WITH STANDBY = 'H:\MSSQL\UNDO\DBX.DAT'

    GO

    rgn

  • quote:


    Now, is there a way to roll back to 6:15PM when I first applied the transaction log with a STOPAT of 6:19PM?


    No.

    --Jonathan



    --Jonathan

  • Just do the whole restore again. If you have Log Explorer or something similar, you could rollback the changes out of the transaction log.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply