Re: Crash Recovery

From: Sylvain Lafontaine ("Sylvain)
Date: 03/10/04


Date: Wed, 10 Mar 2004 02:36:30 -0500

In theory, if the logfile closely follow the backup of DATA.BAK, then you
can make a backup of the log file, then restore the database with norecovery
and finish with the restoration of the log file with recovery. Something
like, with DATA being the name of the database:

use master
go
sp_addumpdevice 'disk', 'log_dump_emergency', 'c:\tmp\log_dum_emergency.dmp'
go
backup log DATA to log_dump_emergency with no_truncate, init
go

restore database DATA from full_backup with replace, norecovery
go
restore log DATA from log_dump_emergency with recovery
go

use DATA
go

select count (*) from MyTable .........

But if there are a missing logfile beetween the time DATA.BAK has been taken
and the beginning of the transactions inside the log file, then you can't
use the procedure above and recover your database with a restore.

However, in the latter case, the use of a tool like Lumigent LogExplorer can
probably help you recover your database. There are others tools for
exploring a log file, you can make a search on the internet.

S. L.

"Bob Morris" <bmorris@kenyaonline.com> wrote in message
news:u1CcEsfBEHA.3404@TK2MSFTNGP10.phx.gbl...
> Very clever. Now does anyone know how to apply the LDF after restoring the
> database from the backup? That is what I am asking.
>
> "Lyle Fairfield" <MissingAddress@Invalid.Com> wrote in message
> news:Xns94A759EF43612FFDBA@130.133.1.4...
> > Lyle Fairfield <MissingAddress@Invalid.Com> wrote in
> > news:Xns94A75503EEE86FFDBA@130.133.1.4:
> >
> > > "Bob Morris" <bmorris@kenyaonline.com> wrote in
> > > news:e5TMyocBEHA.580@TK2MSFTNGP11.phx.gbl:
> > >
> > >> I am trying to restore a crashed server. The server has an SQL2K
> > >> installation with a small database (say) DATA. The file DATA.MDF has
> > >> gone missing during the crash. The file DATA.LDF has been recovered.
> > >> There is also a backup file DATA.BAK. This backup is about 4 MB and I
> > >> suspect it was used to install the database in the first place, as it
> > >> is several months old. The log file LDF has been recently updated and
> > >> is 47 Mb.
> > >
> > > Fire the database administrator. Fire the person responsible for
hiring
> > > and supervising the database administrator. Fire the person
responsible
> > > for hiring and supervising the person responsible for hiring and
> > > supervising the database administrator. Keep going up the hierarchical
> > > chain until you have reached the top.
> > > Then hire a minimally responsible and intelligent professional to
> > > administer your database. He or she can assess the potential for data
> > > recovery.
> >
> > BTW
> >
> > If you restore the database from the last backup, and then restore the
log
> > with recovery you MAY have your database. But I think you need a
> > professional SQL administrator to guide you through this.
> >
> >
> > --
> > Lyle
> > (for e-mail refer to http://ffdba.com/contacts.htm)
>
>



Relevant Pages

  • Backup and Restore Files
    ... What is the best way to backup and restore a runtime database file? ... pszDisplayName As String ...
    (microsoft.public.access.gettingstarted)
  • RE: How do I restore from mdf and ldf files?
    ... Tasks -> Backup Database ... Tasks -> Restore Database ... Windows 2003 Server with Latest Service Pack ... Pre-requisites for Sharepoint Backup and Restore: ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: POINT IN TIME RESTORE
    ... This is what you should have done in order to do the restore as you wish: ... > 3- erase data ... > 5- restore database with norecovery ... The BACKUP DATABAE can of course be at an earlier point in time, ...
    (microsoft.public.sqlserver.server)