Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Thursday, March 29, 2012

Help with corrupt mdf file

I really hope someone out there can help me with this one... My company
recently acquired another company that was using SQL Server 7. The machine
that the database was housed on began to have hard drive issues. We were
able to extract the mdf and ldf files before the hard drives crashed
completely. When attempting to load these files into a SQL Server 2k
database, we hit a wall. SQL Server 2k refuses to attach the mdf file,
saying that the file is not an mdf file. We also received a similar error
in Query Analyzer, using both sp_attach_db and sp_attach_single_file_db;
this error claimed that the file name might be incorrect.
After this failure, we created a new database, stopped the services, and
switched the mdf files with the new databases. This brought the database up
in suspect mode. We were then able to switch it to suspect/emergency mode.
From here, we attempted a dbcc checkdb, which errored out with an version
error. We also attempted to import the data from the new emergency db into
a newer clean db. This failed with a login error, even though we were
logged in under sa.
I realize that we will probably not be able to retrieve all of the records
from the corrupt file, but does anyone know a way to access any of the data?
Any ideas or suggestions are welcome.
P.S. all of the servers that we manage are backed up daily... just trying
to fix another company's error
Thanks,
JoeOne of the things you might try to do is to attach it to a SQL 7 server..
Then the upgrade will not have to occur...
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Joe" <joe@.nospam.com> wrote in message
news:uFAJlKCwDHA.1888@.TK2MSFTNGP10.phx.gbl...
> I really hope someone out there can help me with this one... My company
> recently acquired another company that was using SQL Server 7. The
machine
> that the database was housed on began to have hard drive issues. We were
> able to extract the mdf and ldf files before the hard drives crashed
> completely. When attempting to load these files into a SQL Server 2k
> database, we hit a wall. SQL Server 2k refuses to attach the mdf file,
> saying that the file is not an mdf file. We also received a similar error
> in Query Analyzer, using both sp_attach_db and sp_attach_single_file_db;
> this error claimed that the file name might be incorrect.
> After this failure, we created a new database, stopped the services, and
> switched the mdf files with the new databases. This brought the database
up
> in suspect mode. We were then able to switch it to suspect/emergency
mode.
> From here, we attempted a dbcc checkdb, which errored out with an version
> error. We also attempted to import the data from the new emergency db
into
> a newer clean db. This failed with a login error, even though we were
> logged in under sa.
> I realize that we will probably not be able to retrieve all of the records
> from the corrupt file, but does anyone know a way to access any of the
data?
> Any ideas or suggestions are welcome.
>
> P.S. all of the servers that we manage are backed up daily... just
trying
> to fix another company's error
> Thanks,
> Joe
>|||Wayne,
I think your system clock or time zone is a bit off..., not sure if you have
noticed.
--
- Anith
( Please reply to newsgroups only )|||thanks... my region was wrong... sorry.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Joe" <joe@.nospam.com> wrote in message
news:uFAJlKCwDHA.1888@.TK2MSFTNGP10.phx.gbl...
> I really hope someone out there can help me with this one... My company
> recently acquired another company that was using SQL Server 7. The
machine
> that the database was housed on began to have hard drive issues. We were
> able to extract the mdf and ldf files before the hard drives crashed
> completely. When attempting to load these files into a SQL Server 2k
> database, we hit a wall. SQL Server 2k refuses to attach the mdf file,
> saying that the file is not an mdf file. We also received a similar error
> in Query Analyzer, using both sp_attach_db and sp_attach_single_file_db;
> this error claimed that the file name might be incorrect.
> After this failure, we created a new database, stopped the services, and
> switched the mdf files with the new databases. This brought the database
up
> in suspect mode. We were then able to switch it to suspect/emergency
mode.
> From here, we attempted a dbcc checkdb, which errored out with an version
> error. We also attempted to import the data from the new emergency db
into
> a newer clean db. This failed with a login error, even though we were
> logged in under sa.
> I realize that we will probably not be able to retrieve all of the records
> from the corrupt file, but does anyone know a way to access any of the
data?
> Any ideas or suggestions are welcome.
>
> P.S. all of the servers that we manage are backed up daily... just
trying
> to fix another company's error
> Thanks,
> Joe
>|||I'm with Wayne. A secondary option can be to try
http://www.officerecovery.com/mssql/, not sure how much help such a tool can
be, though.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:OSKheOCwDHA.1680@.TK2MSFTNGP12.phx.gbl...
> One of the things you might try to do is to attach it to a SQL 7 server..
> Then the upgrade will not have to occur...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Joe" <joe@.nospam.com> wrote in message
> news:uFAJlKCwDHA.1888@.TK2MSFTNGP10.phx.gbl...
> > I really hope someone out there can help me with this one... My company
> > recently acquired another company that was using SQL Server 7. The
> machine
> > that the database was housed on began to have hard drive issues. We
were
> > able to extract the mdf and ldf files before the hard drives crashed
> > completely. When attempting to load these files into a SQL Server 2k
> > database, we hit a wall. SQL Server 2k refuses to attach the mdf file,
> > saying that the file is not an mdf file. We also received a similar
error
> > in Query Analyzer, using both sp_attach_db and sp_attach_single_file_db;
> > this error claimed that the file name might be incorrect.
> >
> > After this failure, we created a new database, stopped the services, and
> > switched the mdf files with the new databases. This brought the
database
> up
> > in suspect mode. We were then able to switch it to suspect/emergency
> mode.
> > From here, we attempted a dbcc checkdb, which errored out with an
version
> > error. We also attempted to import the data from the new emergency db
> into
> > a newer clean db. This failed with a login error, even though we were
> > logged in under sa.
> >
> > I realize that we will probably not be able to retrieve all of the
records
> > from the corrupt file, but does anyone know a way to access any of the
> data?
> > Any ideas or suggestions are welcome.
> >
> >
> > P.S. all of the servers that we manage are backed up daily... just
> trying
> > to fix another company's error
> >
> > Thanks,
> >
> > Joe
> >
> >
>sql

Friday, February 24, 2012

Help Restore Database

The drive where my SQL backup were being backed up had filled up last
wednesday. The drive that the MDF was on crashed but I still have the LDF on
a different drive and wednesday's backup on it. Will it still be possible to
get the data back if I restore its last complete backup and then some how
restore the current LDF?
> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
|||Did the transaction log contain all transactions since the last full
database backup? If not, is the database set to FULL or BULK LOAD RECOVERY
or SIMPLE RECOVERY? Have there been transaction log backups?
Do as Dejan says and attempt a BACKUP LOG ... WITH NO_TRUNCATE to get all
committed transactions out.
You will need the database to NOT be in SIMPLE RECOVERY. You will need the
full transaction log and all log backups from the time of the last GOOD FULL
DATABASE backup.
You might be able to use a tool like Lumigent's Log Explorer to rewrite
transactions from the transaction log and replay against a restored
database.
Sincerely,
Anthony Thomas

"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
message news:O6fE$$SAFHA.2676@.TK2MSFTNGP12.phx.gbl...
> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

Help Restore Database

The drive where my SQL backup were being backed up had filled up last
wednesday. The drive that the MDF was on crashed but I still have the LDF on
a different drive and wednesday's backup on it. Will it still be possible to
get the data back if I restore its last complete backup and then some how
restore the current LDF?> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Did the transaction log contain all transactions since the last full
database backup? If not, is the database set to FULL or BULK LOAD RECOVERY
or SIMPLE RECOVERY? Have there been transaction log backups?
Do as Dejan says and attempt a BACKUP LOG ... WITH NO_TRUNCATE to get all
committed transactions out.
You will need the database to NOT be in SIMPLE RECOVERY. You will need the
full transaction log and all log backups from the time of the last GOOD FULL
DATABASE backup.
You might be able to use a tool like Lumigent's Log Explorer to rewrite
transactions from the transaction log and replay against a restored
database.
Sincerely,
Anthony Thomas
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:O6fE$$SAFHA.2676@.TK2MSFTNGP12.phx.gbl...
> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com

Help Restore Database

The drive where my SQL backup were being backed up had filled up last
wednesday. The drive that the MDF was on crashed but I still have the LDF o
n
a different drive and wednesday's backup on it. Will it still be possible t
o
get the data back if I restore its last complete backup and then some how
restore the current LDF?> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Did the transaction log contain all transactions since the last full
database backup? If not, is the database set to FULL or BULK LOAD RECOVERY
or SIMPLE RECOVERY? Have there been transaction log backups?
Do as Dejan says and attempt a BACKUP LOG ... WITH NO_TRUNCATE to get all
committed transactions out.
You will need the database to NOT be in SIMPLE RECOVERY. You will need the
full transaction log and all log backups from the time of the last GOOD FULL
DATABASE backup.
You might be able to use a tool like Lumigent's Log Explorer to rewrite
transactions from the transaction log and replay against a restored
database.
Sincerely,
Anthony Thomas
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:O6fE$$SAFHA.2676@.TK2MSFTNGP12.phx.gbl...
> The drive where my SQL backup were being backed up had filled up last
> wednesday. The drive that the MDF was on crashed but I still have the LDF
on
> a different drive and wednesday's backup on it. Will it still be possible
to
> get the data back if I restore its last complete backup and then some how
> restore the current LDF?
Try to backup the last log with NO_TRUNCATE option first, and then do the
restore, including the last log backup. This way you might be able to
restore everything up to crash. Check the option mentioned in Books OnLine.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com