Recovery of Database question for 2008, 2012 sql

Scenario-

Database gets an update script that hoses the information.   This database has transaction logs and all the backups necessary to complete a point in time recovery.  

can someone point me to a document that tells you how to start the process.  do you put the database in single-user mode and restore on top of it.... can you put a single db on sql in single-user mode without affecting other db's.  

do I detach the jacked up database and just restore from backup files the "new" database.
feel free to expound
jamesmetcalf74Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
You just need to assure there's no one connected to the database and then run the restore commands, starting by the last full backup with the norecovery option:
RESTORE DATABASE DBNameHere
   FROM DISK='C:\BACKUPS\DBNameHere.Bak
   WITH REPLACE, NORECOVERY

Open in new window

after that you'll need to restore the last diff backup with norecover still:
RESTORE DATABASE DBNameHere
   FROM DISK='C:\BACKUPS\DBNameHere_diff.Bak
   WITH NORECOVERY

Open in new window

and then you'll need to restore each transaction log backup made after the last diff backup until the last one that has included the point you want to restore. Only the last restore needs the recover option:
RESTORE LOG DBNameHere
   FROM DISK='C:\BACKUPS\DBNameHere_Log01.trn
   WITH NORECOVERY
GO
RESTORE LOG DBNameHere
   FROM DISK='C:\BACKUPS\DBNameHere_Log02.trn
   WITH RECOVERY

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arnoldCommented:
Not sure where the Diff backup is comming from (prior questioin with info).
As to the last transaction log, you have to specify the point in time before the script was run as the cutoff.

Presumably after the event was discovvered, you run the transaction log backup.
full backup
incremental backups if setup or the last diff backup prior to this event
transaction bcakups with the restriction of the stopat=time before the incident

https://msdn.microsoft.com/en-us/library/ms179451.aspx
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Diff backup is just in case if he have it. If don't he can skip it.
You're right about the point in time restore. I forgot the STOP AT clause in the last restore log:
RESTORE LOG DBNameHere
   FROM DISK='C:\BACKUPS\DBNameHere_Log02.trn
   WITH RECOVERY, STOPAT = 'Jun 30, 2015 11:30 AM'

Open in new window

NOTE: Date and time are an example only. You need to replace with the desired recovery date and time.
0
Eugene ZCommented:
also you can check the below info:

How to: Restore to a Point in Time (SQL Server Management Studio)
https://technet.microsoft.com/en-us/library/ms190982(v=sql.105).aspx

How to: Restore to a Point in Time - SQL Server - YouTube
www.youtube.com/watch?v=0cNSsLXDUDc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.