improvedk / OrcaMDF

A C# parser for MDF files. Allows you to read tables, metadata and indexes from MDF files without it being attached to a running SQL Server instance.
http://improve.dk/archive/2011/05/03/introducing-orcamdf.aspx
GNU General Public License v3.0
181 stars 74 forks source link

can't open db #28

Closed fcontrerasz closed 10 years ago

fcontrerasz commented 10 years ago

im testing calling database function over visual studio 2010...i have 2 problems.

1- I can´t see RawDatabase function on reference over load.

2- only can use Database function, then when I load mdf.. dump:.

Loading Boot Page Loading Boot Page Loading Primary Record Page (1:20) Loading Primary Record Page (1:90) Loading Primary Record Page (1:425) Loading Primary Record Page (1:583) Loading Primary Record Page (1:17) Loading Primary Record Page (1:412) Loading Primary Record Page (5:191468)

Parameter name: File with ID 5 is not part of this database.

improvedk commented 10 years ago

Is this a working database or a corrupt one? Does the database consist of more than one datafile? Judging from the error there are two usual causes:

As for RawDatabase - you should be able to just create a new RawDatabase(path) - does that not work?

fcontrerasz commented 10 years ago

Sorry 4 my poor explication.

Exactly This Is a corrupt DB, I can't mount in sql server (suspect mode) and I need read ONLY the last month from 3 tables ... please helpme.

The FIles are:

I3_IC_Data.mdf 116GB I3_IC_DATA_2.ndf 3GB I3_IC_Log111.ldf 400MB IC_DATA4.ndf 104GB IC_DATA_3.ndf 9.76GB

now I install from nuget in visual 2012, and call using OrcaMDF.Core.Engine; where is the correct namespace to call RawDatabase?

image

improvedk commented 10 years ago

Gotcha!

In that case you'll definitely need RawDatabase, seeing as Database won't work in any work with corrupt databases. Unfortunately RawDatabase isn't available through NuGet yet, so you'll have to clone the source directly.

For a general intro to RawDatabase: http://improve.dk/orcamdf-rawdatabase-a-swiss-army-knife-for-mdf-files/

And for a walkthrough of recovering data: http://improve.dk/sql-server-corruption-recovery-when-all-else-fails/

Do note that RawDatabase currently only supports files up to 2GB due to using File.ReadAllBytes, but if you modify that to read from the file directly, it'll support any size files.

fcontrerasz commented 10 years ago

thks ! im load correctly RawDatabase in my proyect VS2012, What mean "but if you modify that to read from the file directly" ??

how can I load big data in Rawdatabase function ?

Im trying doing, but VS dump: The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.

image

improvedk commented 10 years ago

If you pull the latest source it should support any size files. I haven't tested much, besides running the test suite, but please let me know if it works any better for you :)

improvedk commented 10 years ago

Closing this one - let me know if there's any update :)