473,388 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Restore LDF file after restoring backups in SQL Server 2005?

I'm working on a restore procedure for the case where all MDF files
are missing, but the LDF files are all intact. A full backup is done
every 24 hours, and a log backup is done every 3 hours. After
restoring the last full + log backups, is it at all possible to use
the LDF files to recover data from that point up to a newer point in
time?

I've found a post which explains how to do this on SQL Server 2000
<http://groups.google.com/group/comp.....ms-sqlserver/
browse_thread/thread/3ef5c7cbc0a83334/f3b0c70811d35ed7>, but step 4
fails with the following error message:
BACKUP LOG cannot be performed because there is no current database
backup.

Aug 22 '07 #1
2 8256
l0b0 (vi************@gmail.com) writes:
I'm working on a restore procedure for the case where all MDF files
are missing, but the LDF files are all intact. A full backup is done
every 24 hours, and a log backup is done every 3 hours. After
restoring the last full + log backups, is it at all possible to use
the LDF files to recover data from that point up to a newer point in
time?
At that point it may be a little late. Say that disaster strikes and
your MDF file is dead. At this point you can perform BACKUP LOG WITH
NO_TRUNCATE to back up the log. Then you restore and apply all logs
including this one.
I've found a post which explains how to do this on SQL Server 2000
<http://groups.google.com/group/comp.....ms-sqlserver/
browse_thread/thread/3ef5c7cbc0a83334/f3b0c70811d35ed7>, but step 4
fails with the following error message:
BACKUP LOG cannot be performed because there is no current database
backup.
It seems that Dan left out one point his post. And which point is fairly
obvious: you need to take a full backup of the newly created dummy database.
Since Dan read this group regularly, I hope is able to step in and clarify.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 22 '07 #2
On Aug 22, 12:38 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
l0b0 (victor.engm...@gmail.com) writes:
I'm working on a restore procedure for the case where all MDF files
are missing, but the LDF files are all intact. A full backup is done
every 24 hours, and a log backup is done every 3 hours. After
restoring the last full + log backups, is it at all possible to use
the LDF files to recover data from that point up to a newer point in
time?

At that point it may be a little late. Say that disaster strikes and
your MDF file is dead. At this point you can perform BACKUP LOG WITH
NO_TRUNCATE to back up the log. Then you restore and apply all logs
including this one.
Thanks! I ended up doing the following:
1. BACKUP LOG database TO DISK = 'C:\database.bak' WITH NO_TRUNCATE;
2. Restore full + log backups without recovery
3. RESTORE LOG database FROM DISK='C:\database.bak' WITH MOVE
'database_log' TO 'L:\database_log.LDF', RECOVERY;

It works fine.

Sep 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that...
2
by: phil2phil | last post by:
Hi, I have an old 2000 bak file for a db that I would now like restored onto sql server 2005. I keep erroring out though, this is what I'm doing: Went to Restore Database in sql 2005, selected...
9
by: cabrenner | last post by:
I am new to SQL Server, and migrating part of an Access application to SSE. I am trying to insert a comma delimited file into SSE 2005. I am able to run a BULK INSERT statement on a simple file,...
2
by: ShekharTeke | last post by:
I want to generate XML file which will be stored in C: of SQL Server 2005 machine. How to generate XML file in SQL Server 2005
2
by: sekaranus | last post by:
Can anyone guide me to import the data from .rpt file to SQL Server 2005 Using SSIS
2
by: asmx126453 | last post by:
hey peaple i get an error when i try to open a mdf database file in SQL server 2005 i tryd to use an converter but those are mssql to mysql converter i think thats wrong becase i cant get it to...
1
by: kapil dev | last post by:
I want to restore Database of sql server 2000 in sql server 2005(ver 2.1.0.4).I am anable to find any option or any Query to do it.Can anybody help me plz!! Thanks And Regards Kapil Dev Tripathi
1
by: rajeevraina | last post by:
Hi I wan to open a RTF file using a SQL Server 2005 Stored procedure and repalce some contents in the RTF with the values in the database. Is there a sample code to do so without loosing the...
3
by: MrMob | last post by:
How to call a DLL file from sql server 2005 and how to use it function.... using sql server 2005
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.