473,883 Members | 2,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attach DB with corrupt .ldf?

NF
Hey gang,

I've been trying to restore a DB from it's MDF and LDF all morning;
the catch? The LDF appears to be corrupt.

When I first started the SQL Server, the db in question was marked as
"Suspect'. I did some research on this and it has caused me to attempt
detaching, backing up, deleting the LDF, using ATTACH DB and even
sp_attach_singl e_file_db, and sp_add_data_fil e_recover_suspe ct_db.

Nothing works.

So, with an MDF and no LDF ... is it possible to recreate this
database somehow? Can I attach the MDF to another (empty) database to
retrieve it's contents? (Tried it, couldn't get it to work), can I
extract the contents of the MDF - even if it's just the objects and
not the data itself - in some capacity?

I've read in various places about attaching an MDF with no LDF and the
system will recreate the LDF as needed, but that doesn't work either.

Ideas are most, most, most welcome.
Jul 20 '05 #1
1 4307
[posted and mailed]

NF (na**********@b ellsouth.net) writes:
I've been trying to restore a DB from it's MDF and LDF all morning;
the catch? The LDF appears to be corrupt.

When I first started the SQL Server, the db in question was marked as
"Suspect'. I did some research on this and it has caused me to attempt
detaching, backing up, deleting the LDF, using ATTACH DB and even
sp_attach_singl e_file_db, and sp_add_data_fil e_recover_suspe ct_db.

Nothing works.

So, with an MDF and no LDF ... is it possible to recreate this
database somehow? Can I attach the MDF to another (empty) database to
retrieve it's contents? (Tried it, couldn't get it to work), can I
extract the contents of the MDF - even if it's just the objects and
not the data itself - in some capacity?

I've read in various places about attaching an MDF with no LDF and the
system will recreate the LDF as needed, but that doesn't work either.


There is a way, but I am not going to post it, because it's a
path too dangerous.

My first advice is that you open a case with Microsoft support. Yes,
that will cost you an arm and a leg, but consider how many arms and
legs losing the data will cost you. They have the procedures to recover
as much as possible.

My second advice is to restore from a clean backup.

The way I know means building a log from nothing and at all, and lead
you into the MDF as it was when things went bad. You may find a very
good database. You may also find a database that is just a big mess,
because you got it mid-transaction. And the fact that the LDF is corrupt
is an indication of that. Corruption may exist both in the SQL Server
structures and in your own data.

And if you don't understand the essence of what I'm saying above, don't
ask any further questions, but get on the phone with Microsoft.

If you absolutely want to do this on your own as a last resort before
you throw the database away, drop me a mail.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

4
7326
by: neo | last post by:
I got a mdf file from my co-worker who just stopped SQL server and delete ldf file and give me a mdf file. if it was detached, it would work fine but it was just copied. Is there any way to attach this mdf file? I tried sp_attach_db and sp_attach_single_file_db and both failed.
5
3210
by: Vinay | last post by:
Hi I have a corrupt word file. I am able to open it with the code given below tr Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo( pInfo.UseShellExecute = Tru pInfo.FileName = "c:\corrupt.doc Dim p As Process = System.Diagnostics.Process.Start(pInfo Catch ex As Exceptio MsgBox(ex.ToString End Tr
0
2007
by: Filips Benoit | last post by:
A particular form - always the same - sometimes becomes corrupt after saving. Error msg = The expression On Open you entered as the event property settings produced the following error: A problem occurred while 'DB-name' was communicating with the ole server or ActiveX controle. The form has a calendar-controle. I have eliminated the code in the OnOpen-event but the form stays corrupt!
21
2742
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest table which cotains 600k of records. I've tried copying the database and trying to compact that -doesn't work. I've tried Repair and then compact which also doesn't work. I've tried to create a new database and import the tables but it flakes out...
9
2493
by: Bungle | last post by:
Hi There, Does anybody know where i might be able to locate a tool/application that can determine whether a Database is corrupt?? Also, can a bad network connection cause a corruption to a database? Thanks in advance for any help, Bungle
4
1942
by: dixie | last post by:
I have come across some code to walk through the records of a corrupt table and copy it record by record to a new table. It comes from the MVPS.Org site and is as follows. ----------------------- (Q) How can I recover records from a corrupt table? (A) First, using Access while in the database window, copy the table's structure only from the corrupt table, if possible. Then using the code below, copy each individual row from the old...
0
2372
by: Fredo | last post by:
I have an app that I'm writing to manage jpgs. Sometimes the photos are corrupt. If I use something like ACDSee, it will show the image, but it will have a note in the status bar that the image is corrupt, and it says, specifically, "The source datastream is corrupt." I'd like to be able to detect this as well with C#, but the Image.FromFile() method returns the image and I can't see any way to determine if it's corrupt. Is this simply...
3
2213
by: rdemyan via AccessMonster.com | last post by:
One of my users had a corrupt front end that wouldn't open. My app is launched using a launching application (logon app). The logon app has a button for downloading a "fresh" copy of the front end from the server to the user's PC. I thought that this was a good idea since Access seems susceptible to corruption. I told the user to open the logon form and click the "Download" button, which would then replace the corrupt front end on his...
8
2786
by: iheartvba | last post by:
Hi this is a query made using access query builder: SELECT tblBank.BankID, Now() AS TimeRecd, Val(Right(nz(,0),3)) AS ConsID, "AutoCASH" AS RecUser, tblBank.Dt, Forms!frmRecCASHRunningBal!tbGroup AS GroupID FROM tblBank WHERE (((tblBank.Dt)>(!!-1) And (tblBank.Dt)<(!!+1))); 1.tblBank has a record in the Dt field which equals = 02/07/08 2. tbBankMinDate -1 = 01/07/08 3. tbBankRecDate + 1 = 03/07/08
0
9953
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10868
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7980
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4231
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.