point in time restore

  • Hello everybody,

    I have a small problem,

    thursday morning I had full backup of my user database and every 1 hour I had transaction log backup.

    so, it goes like this

    full backup - 8:00 AM

    transaction - 9:00 AM

    transaction - 10:00 AM

    transaction - 11:00 AM

    transaction - 12:00 PM

    transaction - 1:00 PM

    some one deleted a table at 10:45 AM

    How can I restore all the transaction logs with minimal data loss

    please tell the procedure

    Till 10:45 AM I can go for point in time restore after that what should I do?

    thank you,

    what about the transactions log files at 12:00 PM and 1:00 PM.how to restore them.

    If I won't restore them I will lost important data

  • Restore database DBname from disk='path of full backup' with norecovery

    GO

    Restore log DBname from disk='path of Tlog backup @9.00' with norecovery

    GO

    Restore log DBname from disk='path of Tlog backup @10.00' with norecovery

    GO

    Restore log DBname from disk='path of Tlog backup @11.00'  

    With RECOVERY,STOPAT='August 18,2007 10:45 AM'

    I think this would work

    [font="Verdana"]- Deepak[/font]

  • Actually, why not run that code on a dev server.  Then script the table, recreate it in production and import the data from dev?

  • thank you,

    what about the transactions log files at 12:00 PM and 1:00 PM.how to restore them.

    If I won't restore them I will lost important data

  • That's why i said runt he restore on ANOTHER SERVER, or as another db if the server option is not available.  Then reimport the table.

  • Just to clarify what Ninja is saying.  He means run the code that Deepak provided on another server or to a new database and then import the deleted table from that database into the production db.  Basically if the db is sales and the deleted table is customers, restore the database on another server or to another database (sales2?), then use SSIS or another tool to import the customer table into your production sales db from the restored sales (sales2) db.  Then you have not lost the data from later on.

    Hope that clears things up. 

  • I agree with Jack and Ninja.  When I need to restore a table (or even part of a table) that has been deleted, but not mess anything else up, I usually restore to a dev server and use the Import / Export wizard to move the data from the restored DB.

    Afterwards, of course, I would then remove the privledges that allowed someone to delete the table in the first place.  Or place a DDL trigger on the box to prevent table deletion.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 7 posts - 1 through 6 (of 6 total)

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