Friday, March 9, 2012

restoring from transaction log backups

Hi
If I create a full backup at midnight, and then backup the transaction log
every hour, if I get a database failure, how do I restore to the last
transaction backup?
Do I need to restore the full backup and then restore each transaction
backup in order one by one, or do I just restore the database and the last
transaction log backup!?
Thanks
DanDan,
restore the full backup with no recovery then all the logs one by one. Each
log is restored with no recovery apart from the last one which is done with
recovery. If you are lucky, you can get the last log off the failed server
(usually using no_truncate) and this will be the last log in your chain.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:eveifEzXHHA.3268@.TK2MSFTNGP04.phx.gbl...
> Dan,
> restore the full backup with no recovery then all the logs one by one.
> Each log is restored with no recovery apart from the last one which is
> done with recovery. If you are lucky, you can get the last log off the
> failed server (usually using no_truncate) and this will be the last log in
> your chain.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
>
Just to be clear, make sure to specify "WITH NORECOVERY" when restoring the
full back up and the logs.
Otherwise you'll have to start over.
(I wish that were the default).
--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||Thanks guys.
"Greg D. Moore (Strider)" wrote:
> "Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
> news:eveifEzXHHA.3268@.TK2MSFTNGP04.phx.gbl...
> > Dan,
> > restore the full backup with no recovery then all the logs one by one.
> > Each log is restored with no recovery apart from the last one which is
> > done with recovery. If you are lucky, you can get the last log off the
> > failed server (usually using no_truncate) and this will be the last log in
> > your chain.
> > Cheers,
> > Paul Ibison SQL Server MVP, www.replicationanswers.com
> >
> Just to be clear, make sure to specify "WITH NORECOVERY" when restoring the
> full back up and the logs.
> Otherwise you'll have to start over.
>
> (I wish that were the default).
> --
> Greg Moore
> SQL Server DBA Consulting
> sql (at) greenms.com http://www.greenms.com
>
>

No comments:

Post a Comment