Monday, March 19, 2012

How to recover if just .ldf is lost?

If a disk containing the log file is lost, but the main database files are
OK,
what do you have to do to fix it?
All data before the last checkpoint should be in there.Hi
You may be lucky an sp_attach_single_file_db may work!
A data recovery firm may be able to retrieve the log files.
If you have log backups then you may be able to recover to a certain
point with them,
John|||Try Johns suggestion first. If that does not work have a look here:
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
--
Andrew J. Kelly SQL MVP
"Sandy Tipper" <sandy@.removethis.atuc.net> wrote in message
news:BQQSd.1174$MJ.6200@.newscontent-01.sprint.ca...
> If a disk containing the log file is lost, but the main database files are
> OK,
> what do you have to do to fix it?
> All data before the last checkpoint should be in there.
>|||You can attach the database from Enterprise manager.
You can just selet the primary mdf file and it will warn you that the .ldf
file will be recreated.
"Andrew J. Kelly" wrote:
> Try Johns suggestion first. If that does not work have a look here:
> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
> Restoring a .mdf
> --
> Andrew J. Kelly SQL MVP
>
> "Sandy Tipper" <sandy@.removethis.atuc.net> wrote in message
> news:BQQSd.1174$MJ.6200@.newscontent-01.sprint.ca...
> > If a disk containing the log file is lost, but the main database files are
> > OK,
> > what do you have to do to fix it?
> > All data before the last checkpoint should be in there.
> >
>
>|||There are a number of conditions that has to be met in order for SQL server to be able to just
"create a log file". IF these are not met, attach will not work and you are in for a support call,
restore or similar.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in message
news:0601E3D1-1CF2-4F85-95C7-E41788576320@.microsoft.com...
> You can attach the database from Enterprise manager.
> You can just selet the primary mdf file and it will warn you that the .ldf
> file will be recreated.
> "Andrew J. Kelly" wrote:
>> Try Johns suggestion first. If that does not work have a look here:
>> http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
>> Restoring a .mdf
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Sandy Tipper" <sandy@.removethis.atuc.net> wrote in message
>> news:BQQSd.1174$MJ.6200@.newscontent-01.sprint.ca...
>> > If a disk containing the log file is lost, but the main database files are
>> > OK,
>> > what do you have to do to fix it?
>> > All data before the last checkpoint should be in there.
>> >
>>

No comments:

Post a Comment