How do I restore a SQL Server database from last night's full backup and the active transaction log file?

Posted by Dylan Beattie on Server Fault See other posts from Server Fault or by Dylan Beattie
Published on 2011-01-04T16:46:53Z Indexed on 2011/01/04 16:55 UTC
Read the original article Hit count: 169

I have been told that it's good practise to keep your SQL Server data files and log files on physically separate disks, because it'll allow you to recover your data to the point of failure if the data drive fails.

So... let's say that mydata.mdf is on drive D:, and my mydata_log.ldf is on drive E:, and it's 16:45, and drive D: has just died horribly.

So - I have last night's full backup (mydata.bak). I have hourly transaction-log backups that will bring the data back up to 16:00... but that means I'll lose 45 minutes worth of updates.

I still have mydata_log.ldf on the E: drive, which should contain EVERY transaction that was committed right up to the point where the drive failed.

How do I go about recreating the database and restoring data from the backup file and the live transaction log, so I don't lose any updates? Is this possible?

© Server Fault or respective owner

Related posts about sql-server

Related posts about backup