显示标签为“mdf”的博文。显示所有博文
显示标签为“mdf”的博文。显示所有博文

2012年3月22日星期四

Disk Crash Recover - Won't Recover my SQL Database

My client had a hard disk crash, was running SQL 7.0. The disk engineers were
able to recover the MDF and NDF for a particular database, and I was trying
to attach the MDF back to our new server (SQL 2000). However, because the LDF
transaction log is missing, it is refusing to do so. We were using a "simple"
log model, so I'm not sure if the transaction log even had anything to useful.
I've tried "fooling" SQL server, like copying a good LDF file of a similary
named database, but it knows it's not part of the set and wont recover it.
Also, barring the inability to restore it, is there a tool to break apart a
big MDF file and get to the underlying tables that make it up, so at least
perhaps I can recover some of the data in some of the tables?
Thanks,
Bill Rosman
Chicago,IL
Have you tried sp_attach_single_file_db?
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rosman Computing" <RosmanComputing@.discussions.microsoft.com> wrote in
message news:6049E918-795A-47A5-9716-AF3A627E313C@.microsoft.com...
> My client had a hard disk crash, was running SQL 7.0. The disk engineers
> were
> able to recover the MDF and NDF for a particular database, and I was
> trying
> to attach the MDF back to our new server (SQL 2000). However, because the
> LDF
> transaction log is missing, it is refusing to do so. We were using a
> "simple"
> log model, so I'm not sure if the transaction log even had anything to
> useful.
> I've tried "fooling" SQL server, like copying a good LDF file of a
> similary
> named database, but it knows it's not part of the set and wont recover it.
> Also, barring the inability to restore it, is there a tool to break apart
> a
> big MDF file and get to the underlying tables that make it up, so at least
> perhaps I can recover some of the data in some of the tables?
> Thanks,
> Bill Rosman
> Chicago,IL
|||Yes I have tried sp_attach_single_file, but it still keeps on looking for the
LDF transaction log file.
bill r.
"Paul S Randal [MS]" wrote:

> Have you tried sp_attach_single_file_db?
> --
> Paul Randal
> Lead Program Manager, Microsoft SQL Server Storage Engine
> http://blogs.msdn.com/sqlserverstorageengine/default.aspx
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Rosman Computing" <RosmanComputing@.discussions.microsoft.com> wrote in
> message news:6049E918-795A-47A5-9716-AF3A627E313C@.microsoft.com...
>
>
|||try using sp_attach_db, attaching .MDF and .NDF files only, no need to
attach .LDF file, it will create a new one.
"Rosman Computing" wrote:
[vbcol=seagreen]
> Yes I have tried sp_attach_single_file, but it still keeps on looking for the
> LDF transaction log file.
> bill r.
> "Paul S Randal [MS]" wrote:
|||Well, if you know the database was shutdown cleanly (e.g. by detaching it
while SQL Server is running) then the log file won't be needed as there's
nothing to recover.
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:e3gxb3pHHHA.1912@.TK2MSFTNGP03.phx.gbl...
> Whether or not a log file is needed when you attach (or similar) a
> database depends on whether there is recovery work to do in the database.
> Every time a database starts, it will see whether it has to perform
> recovery work. Recovery work include REDO and UNDO of log records. This it
> has to do because transactions might have been in flight when the database
> was shut down. If SQL Server determines that there is recovery work to be
> done, it *need* the log file.
> SQL Server will not allow you to use an inconsistent database (as in the
> case of missing log file and it need to do recovery work).
> I.e., you never know whether SQL Server can create the log file - so you
> should *never* rely on this. (Paul - I welcome elaborations and/or
> corrections to this statement... :-). )
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Celal" <Celal@.discussions.microsoft.com> wrote in message
> news:EF5EC77E-2AFA-42BA-8CEE-A5242D4AD0AF@.microsoft.com...
>
|||How would you check the bit in the file header - there's no documented way
to do so :-) and you'd have to have the database attached or know the file
header row structure.
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eaL4mWuHHHA.1264@.TK2MSFTNGP06.phx.gbl...
> Ahh, I tend to forget about the detach/offline cases. I guess my sceptism
> about these things isn't as much technical or mistrust, but more from
> these newsgroups. All the posts where SQL Server cannot create the log
> file. "I *did* detach the database first". Perhaps the simple truth is:
> a) The poster (not in this thread, I should add), claims that detach was
> performed even though it wasn't performed. ...In some vain hope that
> claiming that fact would somehow change things.
> b) I'm polluted by posts where log files cannot be created, and I just
> don't keep track of which cases detach (or offline) actually happened.
> I wish there could be some type of "FK"/link in NTFS so SQL Server could
> enforce that we cannot delete log files unless it was shutdown cleanly
> (even when SQL Server is stopped). Also, there would be nice if we could
> investigate this bit(?) in the mdf file header(?).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
> news:eM0AAPuHHHA.1240@.TK2MSFTNGP03.phx.gbl...
>

Disk Crash Recover - Won't Recover my SQL Database

My client had a hard disk crash, was running SQL 7.0. The disk engineers wer
e
able to recover the MDF and NDF for a particular database, and I was trying
to attach the MDF back to our new server (SQL 2000). However, because the LD
F
transaction log is missing, it is refusing to do so. We were using a "simple
"
log model, so I'm not sure if the transaction log even had anything to usefu
l.
I've tried "fooling" SQL server, like copying a good LDF file of a similary
named database, but it knows it's not part of the set and wont recover it.
Also, barring the inability to restore it, is there a tool to break apart a
big MDF file and get to the underlying tables that make it up, so at least
perhaps I can recover some of the data in some of the tables?
Thanks,
Bill Rosman
Chicago,ILHave you tried sp_attach_single_file_db?
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstor...ne/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rosman Computing" <RosmanComputing@.discussions.microsoft.com> wrote in
message news:6049E918-795A-47A5-9716-AF3A627E313C@.microsoft.com...
> My client had a hard disk crash, was running SQL 7.0. The disk engineers
> were
> able to recover the MDF and NDF for a particular database, and I was
> trying
> to attach the MDF back to our new server (SQL 2000). However, because the
> LDF
> transaction log is missing, it is refusing to do so. We were using a
> "simple"
> log model, so I'm not sure if the transaction log even had anything to
> useful.
> I've tried "fooling" SQL server, like copying a good LDF file of a
> similary
> named database, but it knows it's not part of the set and wont recover it.
> Also, barring the inability to restore it, is there a tool to break apart
> a
> big MDF file and get to the underlying tables that make it up, so at least
> perhaps I can recover some of the data in some of the tables?
> Thanks,
> Bill Rosman
> Chicago,IL|||Yes I have tried sp_attach_single_file, but it still keeps on looking for th
e
LDF transaction log file.
bill r.
"Paul S Randal [MS]" wrote:

> Have you tried sp_attach_single_file_db?
> --
> Paul Randal
> Lead Program Manager, Microsoft SQL Server Storage Engine
> http://blogs.msdn.com/sqlserverstor...ne/default.aspx
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Rosman Computing" <RosmanComputing@.discussions.microsoft.com> wrote in
> message news:6049E918-795A-47A5-9716-AF3A627E313C@.microsoft.com...
>
>|||try using sp_attach_db, attaching .MDF and .NDF files only, no need to
attach .LDF file, it will create a new one.
"Rosman Computing" wrote:
[vbcol=seagreen]
> Yes I have tried sp_attach_single_file, but it still keeps on looking for
the
> LDF transaction log file.
> bill r.
> "Paul S Randal [MS]" wrote:
>|||> try using sp_attach_db, attaching .MDF and .NDF files only, no need to
> attach .LDF file, it will create a new one.
Whether or not a log file is needed when you attach (or similar) a database
depends on whether there
is recovery work to do in the database. Every time a database starts, it wil
l see whether it has to
perform recovery work. Recovery work include REDO and UNDO of log records. T
his it has to do because
transactions might have been in flight when the database was shut down. If S
QL Server determines
that there is recovery work to be done, it *need* the log file.
SQL Server will not allow you to use an inconsistent database (as in the cas
e of missing log file
and it need to do recovery work).
I.e., you never know whether SQL Server can create the log file - so you sho
uld *never* rely on
this. (Paul - I welcome elaborations and/or corrections to this statement...
:-). )
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Celal" <Celal@.discussions.microsoft.com> wrote in message
news:EF5EC77E-2AFA-42BA-8CEE-A5242D4AD0AF@.microsoft.com...[vbcol=seagreen]
> try using sp_attach_db, attaching .MDF and .NDF files only, no need to
> attach .LDF file, it will create a new one.
> "Rosman Computing" wrote:
>|||Well, if you know the database was shutdown cleanly (e.g. by detaching it
while SQL Server is running) then the log file won't be needed as there's
nothing to recover.
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstor...ne/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:e3gxb3pHHHA.1912@.TK2MSFTNGP03.phx.gbl...
> Whether or not a log file is needed when you attach (or similar) a
> database depends on whether there is recovery work to do in the database.
> Every time a database starts, it will see whether it has to perform
> recovery work. Recovery work include REDO and UNDO of log records. This it
> has to do because transactions might have been in flight when the database
> was shut down. If SQL Server determines that there is recovery work to be
> done, it *need* the log file.
> SQL Server will not allow you to use an inconsistent database (as in the
> case of missing log file and it need to do recovery work).
> I.e., you never know whether SQL Server can create the log file - so you
> should *never* rely on this. (Paul - I welcome elaborations and/or
> corrections to this statement... :-). )
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Celal" <Celal@.discussions.microsoft.com> wrote in message
> news:EF5EC77E-2AFA-42BA-8CEE-A5242D4AD0AF@.microsoft.com...
>|||Ahh, I tend to forget about the detach/offline cases. I guess my sceptism ab
out these things isn't
as much technical or mistrust, but more from these newsgroups. All the posts
where SQL Server cannot
create the log file. "I *did* detach the database first". Perhaps the simple
truth is:
a) The poster (not in this thread, I should add), claims that detach was per
formed even though it
wasn't performed. ...In some vain hope that claiming that fact would somehow
change things.
b) I'm polluted by posts where log files cannot be created, and I just don't
keep track of which
cases detach (or offline) actually happened.
I wish there could be some type of "FK"/link in NTFS so SQL Server could enf
orce that we cannot
delete log files unless it was shutdown cleanly (even when SQL Server is sto
pped). Also, there would
be nice if we could investigate this bit(?) in the mdf file header(?).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:eM0AAPuHHHA.1240@.TK2MSFTNGP03.phx.gbl...
> Well, if you know the database was shutdown cleanly (e.g. by detaching it
while SQL Server is
> running) then the log file won't be needed as there's nothing to recover.
> --
> Paul Randal
> Lead Program Manager, Microsoft SQL Server Storage Engine
> http://blogs.msdn.com/sqlserverstor...ne/default.aspx
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:e3gxb3pHHHA.1912@.TK2MSFTNGP03.phx.gbl...
>|||How would you check the bit in the file header - there's no documented way
to do so :-) and you'd have to have the database attached or know the file
header row structure.
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstor...ne/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eaL4mWuHHHA.1264@.TK2MSFTNGP06.phx.gbl...
> Ahh, I tend to forget about the detach/offline cases. I guess my sceptism
> about these things isn't as much technical or mistrust, but more from
> these newsgroups. All the posts where SQL Server cannot create the log
> file. "I *did* detach the database first". Perhaps the simple truth is:
> a) The poster (not in this thread, I should add), claims that detach was
> performed even though it wasn't performed. ...In some vain hope that
> claiming that fact would somehow change things.
> b) I'm polluted by posts where log files cannot be created, and I just
> don't keep track of which cases detach (or offline) actually happened.
> I wish there could be some type of "FK"/link in NTFS so SQL Server could
> enforce that we cannot delete log files unless it was shutdown cleanly
> (even when SQL Server is stopped). Also, there would be nice if we could
> investigate this bit(?) in the mdf file header(?).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
> news:eM0AAPuHHHA.1240@.TK2MSFTNGP03.phx.gbl...
>|||Hehe, I knew you were to say something like that...

> How would you check the bit in the file header - there's no documented way
to do so :-) and you'd
> have to have the database attached or know the file header row structure.
If we know what bit(?) it is, we could check it with a hex editor. Or, even
produce some tiny
utility that reads the beginning of the file, see what value the bit has and
present it. Heck, that
small utility could even be produced by MS ;-).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:eIKzFlvHHHA.3540@.TK2MSFTNGP02.phx.gbl...
> How would you check the bit in the file header - there's no documented way
to do so :-) and you'd
> have to have the database attached or know the file header row structure.
> --
> Paul Randal
> Lead Program Manager, Microsoft SQL Server Storage Engine
> http://blogs.msdn.com/sqlserverstor...ne/default.aspx
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:eaL4mWuHHHA.1264@.TK2MSFTNGP06.phx.gbl...
>

Disk Array

Is it possible/okay to store SQL 2K's .mdf's and .ldf's on a disk array?
I would like to attach a SCSI disk array to my server box in order to have
more scaleable storage solution. I have found some information about SAN's
but I don't see why I cannot use a less-expensive disk array to acheive the
same goal. Has anyone tried anything like this before? Thanks....
-dougLocally attached SCSI disk arrays are fine for many environments and quite
common in my experience. SAN solutions are more robust but also more
expensive. We consider SANs for VLDBs and/or storage for multiple servers.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Doug Threewitt" <doug@.seisystems.com> wrote in message
news:ORhbDbx8DHA.488@.TK2MSFTNGP12.phx.gbl...
> Is it possible/okay to store SQL 2K's .mdf's and .ldf's on a disk
array?
> I would like to attach a SCSI disk array to my server box in order to have
> more scaleable storage solution. I have found some information about
SAN's
> but I don't see why I cannot use a less-expensive disk array to acheive
the
> same goal. Has anyone tried anything like this before? Thanks....
>
> -doug
>

Disk Array

Is it possible/okay to store SQL 2K's .mdf's and .ldf's on a disk array?
I would like to attach a SCSI disk array to my server box in order to have
more scaleable storage solution. I have found some information about SAN's
but I don't see why I cannot use a less-expensive disk array to acheive the
same goal. Has anyone tried anything like this before? Thanks....
-dougLocally attached SCSI disk arrays are fine for many environments and quite
common in my experience. SAN solutions are more robust but also more
expensive. We consider SANs for VLDBs and/or storage for multiple servers.
Hope this helps.
Dan Guzman
SQL Server MVP
"Doug Threewitt" <doug@.seisystems.com> wrote in message
news:ORhbDbx8DHA.488@.TK2MSFTNGP12.phx.gbl...
> Is it possible/okay to store SQL 2K's .mdf's and .ldf's on a disk
array?
> I would like to attach a SCSI disk array to my server box in order to have
> more scaleable storage solution. I have found some information about
SAN's
> but I don't see why I cannot use a less-expensive disk array to acheive
the
> same goal. Has anyone tried anything like this before? Thanks....
>
> -doug
>

2012年3月11日星期日

Disaster....

Scenario:
w2k server sp4
sql server 2k sp3a
I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
of some size.
Yesterday night I encountered some read errors on it.
W2k suggests me to run CHKDSK /F, that I obviously do.
When system restarts that 3,34 GB MDF file is now size 0kb!!!
Now...
I know that I should have a backup but these data aren't so
important...but If I can retrieve them is better than nothing !!!!!
I'm trying to restore some files with lots of recovery tools but I
notice that all of them find thousands of files...
How can I do, if possible, to obtain my MDF back "full" of data?
Any help MUCH MUCH appreciated...
Best Regards.
F.No need to multi-post... I posted an answer in *.setup...
Steve
"Fabri" <no@.sp.am> wrote in message
news:UP5Md.485761$b5.22987015@.news3.tin.it...
> Scenario:
> w2k server sp4
> sql server 2k sp3a
>
> I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
> of some size.
> Yesterday night I encountered some read errors on it.
<snip>

Disaster..

Scenario:
w2k server sp4
sql server 2k sp3a
I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
of some size.
Yesterday night I encountered some read errors on it.
W2k suggests me to run CHKDSK /F, that I obviously do.
When system restarts that 3,34 GB MDF file is now size 0kb!!!
Now...
I know that I should have a backup but these data aren't so
important...but If I can retrieve them is better than nothing !!!!!
I'm trying to restore some files with lots of recovery tools but I
notice that all of them find thousands of files...
How can I do, if possible, to obtain my MDF back "full" of data?
Any help MUCH MUCH appreciated...
Best Regards.
F.
Fabri,
You really shouldn't put SQL Server data files on an exernal USB drive.
Anyway, there's not much you can do in this instance unless you send the
drive off to a specialist for repair (expensive). I have heard that
putting it in the freezer for a few hours can revive it. However, if
your CHKDSK has overwritten or "fixed" sectors on the disk, it is
unlikely you will get the data back without a corrupt MDF file.
I think your only choices here are to restore from backup, or start again.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Fabri wrote:
> Scenario:
> w2k server sp4
> sql server 2k sp3a
>
> I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
> of some size.
> Yesterday night I encountered some read errors on it.
> W2k suggests me to run CHKDSK /F, that I obviously do.
> When system restarts that 3,34 GB MDF file is now size 0kb!!!
> Now...
> I know that I should have a backup but these data aren't so
> important...but If I can retrieve them is better than nothing !!!!!
> I'm trying to restore some files with lots of recovery tools but I
> notice that all of them find thousands of files...
> How can I do, if possible, to obtain my MDF back "full" of data?
> Any help MUCH MUCH appreciated...
> Best Regards.
>

Disaster..

Scenario:
w2k server sp4
sql server 2k sp3a
I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
of some size.
Yesterday night I encountered some read errors on it.
W2k suggests me to run CHKDSK /F, that I obviously do.
When system restarts that 3,34 GB MDF file is now size 0kb!!!
Now...
I know that I should have a backup but these data aren't so
important...but If I can retrieve them is better than nothing !!!!!
I'm trying to restore some files with lots of recovery tools but I
notice that all of them find thousands of files...
How can I do, if possible, to obtain my MDF back "full" of data?
Any help MUCH MUCH appreciated...
Best Regards.
F.Fabri,
You really shouldn't put SQL Server data files on an exernal USB drive.
Anyway, there's not much you can do in this instance unless you send the
drive off to a specialist for repair (expensive). I have heard that
putting it in the freezer for a few hours can revive it. However, if
your CHKDSK has overwritten or "fixed" sectors on the disk, it is
unlikely you will get the data back without a corrupt MDF file.
I think your only choices here are to restore from backup, or start again.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Fabri wrote:
> Scenario:
> w2k server sp4
> sql server 2k sp3a
>
> I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
> of some size.
> Yesterday night I encountered some read errors on it.
> W2k suggests me to run CHKDSK /F, that I obviously do.
> When system restarts that 3,34 GB MDF file is now size 0kb!!!
> Now...
> I know that I should have a backup but these data aren't so
> important...but If I can retrieve them is better than nothing !!!!!
> I'm trying to restore some files with lots of recovery tools but I
> notice that all of them find thousands of files...
> How can I do, if possible, to obtain my MDF back "full" of data?
> Any help MUCH MUCH appreciated...
> Best Regards.
>

Disaster..

Scenario:
w2k server sp4
sql server 2k sp3a
I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
of some size.
Yesterday night I encountered some read errors on it.
W2k suggests me to run CHKDSK /F, that I obviously do.
When system restarts that 3,34 GB MDF file is now size 0kb!!!
Now...
I know that I should have a backup but these data aren't so
important...but If I can retrieve them is better than nothing !!!!!
I'm trying to restore some files with lots of recovery tools but I
notice that all of them find thousands of files...
How can I do, if possible, to obtain my MDF back "full" of data?
Any help MUCH MUCH appreciated...
Best Regards.
--
F.Fabri,
You really shouldn't put SQL Server data files on an exernal USB drive.
Anyway, there's not much you can do in this instance unless you send the
drive off to a specialist for repair (expensive). I have heard that
putting it in the freezer for a few hours can revive it. However, if
your CHKDSK has overwritten or "fixed" sectors on the disk, it is
unlikely you will get the data back without a corrupt MDF file.
I think your only choices here are to restore from backup, or start again.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Fabri wrote:
> Scenario:
> w2k server sp4
> sql server 2k sp3a
>
> I had on USB external disk (160gb from maxtor) 3,34 GB MDF file and LDF
> of some size.
> Yesterday night I encountered some read errors on it.
> W2k suggests me to run CHKDSK /F, that I obviously do.
> When system restarts that 3,34 GB MDF file is now size 0kb!!!
> Now...
> I know that I should have a backup but these data aren't so
> important...but If I can retrieve them is better than nothing !!!!!
> I'm trying to restore some files with lots of recovery tools but I
> notice that all of them find thousands of files...
> How can I do, if possible, to obtain my MDF back "full" of data?
> Any help MUCH MUCH appreciated...
> Best Regards.
>

2012年2月17日星期五

disable log file

Hi all,
I want to distribute the mdf file with my program, but i always have
problems with the transaction log file when i try to attach
the database on some other server.
Is it possible to disable the log for the database, so the attach manager
wouldn't complain about a missing log file?
Thanks for your help,
J.Hi
No, you can't disable it. When don't you ship the LDF file too?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||Jozza
Lookup sp_attach_single_file_db system stored procedure in the BOL.
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||As stated, you can't disable logging. You should be able to attach only the
mdf file if:
The database only has one single log file.
If you properly detached the database.
If above holds, you should be able to attach only the mdf file using sp_atta
ch_single_file_db. If
you can't, you should open a case with MS.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jozza" <hmm@.hmm.com> wrote in message news:%nDSe.68$h6.18283@.news.siol.net...d">
> Hi all,
> I want to distribute the mdf file with my program, but i always have probl
ems with the transaction
> log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
wouldn't complain about
> a missing log file?
> Thanks for your help,
> J.
>|||Ok, i agree with all of you, but,
when attaching the database file, the attach manager displays the previous
path of the log file, that is, the path on my computer,
which i don't want my customer to see at all. I'm using (DbaMgr2K - i don't
know about the original sql manager though).
The path to the log file is saved to the mdf and points to the physical
unexisting directory on the client's computer, and i when distribute both
mdf and log file, they are copied to the installed directory, attach manager
searches for the log in the wrong (previously saved) directory. How do i fix
that?
J.
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||Consider executing sp_attach_db rather than a GUI:
EXEC sp_attach_db 'MyDatabase',
'C:\MyInstallFolder\MyDatabase.mdf'',
'C:\MyInstallFolder\MyDatabase_Log.ldf''
Hope this helps.
Dan Guzman
SQL Server MVP
"Jozza" <hmm@.hmm.com> wrote in message
news:s0ESe.69$h6.17942@.news.siol.net...
> Ok, i agree with all of you, but,
> when attaching the database file, the attach manager displays the previous
> path of the log file, that is, the path on my computer,
> which i don't want my customer to see at all. I'm using (DbaMgr2K - i
> don't know about the original sql manager though).
> The path to the log file is saved to the mdf and points to the physical
> unexisting directory on the client's computer, and i when distribute both
> mdf and log file, they are copied to the installed directory, attach
> manager searches for the log in the wrong (previously saved) directory.
> How do i fix that?
> J.
> "Jozza" <hmm@.hmm.com> wrote in message
> news:%nDSe.68$h6.18283@.news.siol.net...
>