I have created a program using SQL-DMO to replace an SQL Server 2000 database by setting it OFFLINE, replacing the .MDF and .LDF and then setting the database back ONLINE.
SQL Server does permit replacing the files while offline. And when the database is back online, everything seems to have worked perfectly with the new database files.
My questions is ... What potential problems (if any) exist with this process replacing a database?
Other methods I have considered:
- Detach, replace DB files, re-attach
- Delete old database, attach-using-new-DB-files
Thanks for your input!!The problem you've followed to detach, rename and re-attach is fine. As the SQL server doesn't remember the previous database names and when you detach the name &* details will be cleared from sysdatabases table.
By any reason if there is a mismatch of filenames with .MDF and .LDF then you will have issue of re-attachign the database.
BTW can you explain why you need to this on regular basis?|||Thx for the reply,
Because I am just updating the same SQL database with 2 new database files (.mdf and .ldf) with the same file names, I figure setting the database offline in order to do the 'file replacement' would be more efficient than detaching the database.
You mentioned that the process of (Detach)-(Rename)-(ReAttach) is fine.
However, I am using the process of (Set Offline)-(Replace .mdf/.ldf)-(Set Online). Would there be any problems when this method is used?
This 'database replacement' process is needed because databases sometimes gets corrupted for various reasons, and it needs to be 'sent in' to repair. The fixed database is sent back to the user and replaces their corrupted database.
Thanks again.|||more efficient? the dettach and reattch sp's are real fast.|||As long as you carryon such rename operations during SQL offline then you will not have any issues, otherwise SQL will flag inconsistency with mismatche of files.
Any reason and investigation on why the database is corrupted?
If you can fix the problem then you can reduce round-robin method. ;-)|||The 'data corruption' problems I had previously mentioned, are only at the data-level (caused by errors in the client program) and not at the database-level. Sorry for the confusion.
And when I say 'more efficient', I had some quicker response times setting a database OFFLINE/ONLINE then DETACH/RE-ATTACH. Also in code (SQL-DMO), setting a detabase offline/online is as simple as setting a boolean flag to true/false, whereas the detach/attach method requires full path names to the .MDF and .LDF.
Thx again for your responses.|||User mappings can be lost in this sort of operation. Does the client have to re-add those?
Hopefully this is not terribly important data. Especially if the database has to be 'sent in' for repairs. Sorry, but it just rubs me the wrong way.|||Thanks for the excellent reminder... a custom database USER and ROLE is used. All 'repairs' are applied to on the same database received (which will also be the same one sent back to the client). I will definately keep this in mind when testing.
And yes, it rubs me the wrong way as well... but that is another story :)
... and I plan to add backups and restores to avoid this whole process of 'sending and receiving' of an entire database.
Thx again!
Showing posts with label ldf. Show all posts
Showing posts with label ldf. Show all posts
Wednesday, March 21, 2012
Wednesday, March 7, 2012
repairing damaged sql server MDF and LDF files
I found this program on the web...we just had the same
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>
Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of 20+), perhaps the corruption is too servere for our case. but you can try your luck.
what other program have you tried ?
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> can attach it back to sql server again ?
>
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>
Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of 20+), perhaps the corruption is too servere for our case. but you can try your luck.
what other program have you tried ?
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> can attach it back to sql server again ?
>
repairing damaged sql server MDF and LDF files
Hi All,
My SQL server's data files all corrupted during a severe power failure, we manage to get back the data files and reinstall the sql server. but unforunately we failed to attaching the database back to the server. The error message indicating it is caused b
y corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back to sql server again ?
Any help is very much appreciated.
Bernard Gh
Hi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh
|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh
|||with
EXEC sp_attach_db @.dbname = N'IMISWEB_OTHER',
@.filename1 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_Data.MDF',
@.filename2 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_LOG.LDF'
I got following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_LOG.LDF' is not a valid database file header. The PageAudit property is incorrect.
With
EXEC sp_attach_single_file_db @.dbname = 'IMISWEB_OTHER',
@.physname = 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_Data.MDF'
I got the following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.
Server: Msg 5170, Level 16, State 1, Line 1
Cannot create file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_log.LDF' because it already exists.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'IMISWEB_OTHER'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' may be incorrect.
Bernard goh
"Hari Prasad" wrote:
> Hi,
> Can you post the error you are getting while attaching the database.
> If the MDF file is corrupted you have to either contact Microsoft product
> support or restore from a valid full backup and restore the subsequent
> transaction log backups in sequence.
>
> Note:
> During this situation even if you recover the database data integrity will
> be lost. I recommend you to restore from full backup.
> Thanks
> Hari
> MCDBA
>
> "SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
> news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> manage to get back the data files and reinstall the sql server. but
> unforunately we failed to attaching the database back to the server. The
> error message indicating it is caused by corrupted MDF or LDF files.
> to sql server again ?
>
>
My SQL server's data files all corrupted during a severe power failure, we manage to get back the data files and reinstall the sql server. but unforunately we failed to attaching the database back to the server. The error message indicating it is caused b
y corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back to sql server again ?
Any help is very much appreciated.
Bernard Gh
Hi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh
|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh
|||with
EXEC sp_attach_db @.dbname = N'IMISWEB_OTHER',
@.filename1 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_Data.MDF',
@.filename2 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_LOG.LDF'
I got following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_LOG.LDF' is not a valid database file header. The PageAudit property is incorrect.
With
EXEC sp_attach_single_file_db @.dbname = 'IMISWEB_OTHER',
@.physname = 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_Data.MDF'
I got the following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.
Server: Msg 5170, Level 16, State 1, Line 1
Cannot create file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_log.LDF' because it already exists.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'IMISWEB_OTHER'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' may be incorrect.
Bernard goh
"Hari Prasad" wrote:
> Hi,
> Can you post the error you are getting while attaching the database.
> If the MDF file is corrupted you have to either contact Microsoft product
> support or restore from a valid full backup and restore the subsequent
> transaction log backups in sequence.
>
> Note:
> During this situation even if you recover the database data integrity will
> be lost. I recommend you to restore from full backup.
> Thanks
> Hari
> MCDBA
>
> "SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
> news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> manage to get back the data files and reinstall the sql server. but
> unforunately we failed to attaching the database back to the server. The
> error message indicating it is caused by corrupted MDF or LDF files.
> to sql server again ?
>
>
repairing damaged sql server MDF and LDF files
Hi All,
My SQL server's data files all corrupted during a severe power failure, we m
anage to get back the data files and reinstall the sql server. but unforunat
ely we failed to attaching the database back to the server. The error messag
e indicating it is caused b
y corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back t
o sql server again ?
Any help is very much appreciated.
Bernard GhHi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||with
EXEC sp_attach_db @.dbname = N'IMISWEB_OTHER',
@.filename1 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHE
R_Data.MDF',
@.filename2 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHE
R_LOG.LDF'
I got following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWE
B_OTHER_LOG.LDF' is not a valid database file header. The PageAudit property
is incorrect.
With
EXEC sp_attach_single_file_db @.dbname = 'IMISWEB_OTHER',
@.physname = 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_
Data.MDF'
I got the following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWE
B_OTHER_Log.LDF' is not a valid database file header. The PageAudit property
is incorrect.
Server: Msg 5170, Level 16, State 1, Line 1
Cannot create file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB
_OTHER_log.LDF' because it already exists.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'IMISWEB_OTHER'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'K:\Program Files\Microsoft
SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' may be incorrect.
Bernard goh
"Hari Prasad" wrote:
> Hi,
> Can you post the error you are getting while attaching the database.
> If the MDF file is corrupted you have to either contact Microsoft product
> support or restore from a valid full backup and restore the subsequent
> transaction log backups in sequence.
>
> Note:
> During this situation even if you recover the database data integrity will
> be lost. I recommend you to restore from full backup.
> Thanks
> Hari
> MCDBA
>
> "SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
> news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> manage to get back the data files and reinstall the sql server. but
> unforunately we failed to attaching the database back to the server. The
> error message indicating it is caused by corrupted MDF or LDF files.
> to sql server again ?
>
>
My SQL server's data files all corrupted during a severe power failure, we m
anage to get back the data files and reinstall the sql server. but unforunat
ely we failed to attaching the database back to the server. The error messag
e indicating it is caused b
y corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back t
o sql server again ?
Any help is very much appreciated.
Bernard GhHi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||with
EXEC sp_attach_db @.dbname = N'IMISWEB_OTHER',
@.filename1 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHE
R_Data.MDF',
@.filename2 = N'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHE
R_LOG.LDF'
I got following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWE
B_OTHER_LOG.LDF' is not a valid database file header. The PageAudit property
is incorrect.
With
EXEC sp_attach_single_file_db @.dbname = 'IMISWEB_OTHER',
@.physname = 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB_OTHER_
Data.MDF'
I got the following:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'K:\Program Files\Microsoft SQL Server\MSSQL\data\IMISWE
B_OTHER_Log.LDF' is not a valid database file header. The PageAudit property
is incorrect.
Server: Msg 5170, Level 16, State 1, Line 1
Cannot create file 'K:\Program Files\Microsoft SQL Server\MSSQL\Data\IMISWEB
_OTHER_log.LDF' because it already exists.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'IMISWEB_OTHER'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'K:\Program Files\Microsoft
SQL Server\MSSQL\data\IMISWEB_OTHER_Log.LDF' may be incorrect.
Bernard goh
"Hari Prasad" wrote:
> Hi,
> Can you post the error you are getting while attaching the database.
> If the MDF file is corrupted you have to either contact Microsoft product
> support or restore from a valid full backup and restore the subsequent
> transaction log backups in sequence.
>
> Note:
> During this situation even if you recover the database data integrity will
> be lost. I recommend you to restore from full backup.
> Thanks
> Hari
> MCDBA
>
> "SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
> news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> manage to get back the data files and reinstall the sql server. but
> unforunately we failed to attaching the database back to the server. The
> error message indicating it is caused by corrupted MDF or LDF files.
> to sql server again ?
>
>
repairing damaged sql server MDF and LDF files
I found this program on the web...we just had the same
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of
20+), perhaps the corruption is too servere for our case. but you can try yo
ur luck.
what other program have you tried ?
--
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
>
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> can attach it back to sql server again ?
>
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of
20+), perhaps the corruption is too servere for our case. but you can try yo
ur luck.
what other program have you tried ?
--
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
>
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> can attach it back to sql server again ?
>
repairing damaged sql server MDF and LDF files
Hi All,
My SQL server's data files all corrupted during a severe power failure, we manage to get back the data files and reinstall the sql server. but unforunately we failed to attaching the database back to the server. The error message indicating it is caused by corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back to sql server again ?
Any help is very much appreciated.
Bernard GhHi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I found this program on the web...we just had the same
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>|||Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of 20+), perhaps the corruption is too servere for our case. but you can try your luck.
what other program have you tried ?
--
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
> >--Original Message--
> >Hi All,
> >
> >My SQL server's data files all corrupted during a severe
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> >
> >Is there a way to perform a file level repair before we
> can attach it back to sql server again ?
> >
> >Any help is very much appreciated.
> >
> >Bernard Gh
> >.
> >
>
My SQL server's data files all corrupted during a severe power failure, we manage to get back the data files and reinstall the sql server. but unforunately we failed to attaching the database back to the server. The error message indicating it is caused by corrupted MDF or LDF files.
Is there a way to perform a file level repair before we can attach it back to sql server again ?
Any help is very much appreciated.
Bernard GhHi,
Can you post the error you are getting while attaching the database.
If the MDF file is corrupted you have to either contact Microsoft product
support or restore from a valid full backup and restore the subsequent
transaction log backups in sequence.
Note:
During this situation even if you recover the database data integrity will
be lost. I recommend you to restore from full backup.
Thanks
Hari
MCDBA
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I have been in the same situation with customers before. This is why you
have a fault tolerant RAID set(5, 1, 10, or 0+1), use Log Shipping and have
good backup plans. Sometimes things break and you don't get to piece them
together.
We often use a secondary IDE drive that the SCSI drives only dump
transaction backups to every 2-5 minutes. Hence, if the power goes out 1.)
the controller should have an onboard battery to complete the write or fail
it, 2.) we are never more than 2 minutes from the last 'good' state.
Plan for failure, because it will come:wether hardware, software or
intrusion.
Sorry,
Tim
"SummerCoke" <SummerCoke@.discussions.microsoft.com> wrote in message
news:C9AE06CD-460C-48C6-8510-4E1C1858FAE9@.microsoft.com...
> Hi All,
> My SQL server's data files all corrupted during a severe power failure, we
manage to get back the data files and reinstall the sql server. but
unforunately we failed to attaching the database back to the server. The
error message indicating it is caused by corrupted MDF or LDF files.
> Is there a way to perform a file level repair before we can attach it back
to sql server again ?
> Any help is very much appreciated.
> Bernard Gh|||I found this program on the web...we just had the same
thing happen and I wondered if anyone has used it (I
posted this as a topic)...it's called MSSQLRECOVERY 2.0
and can be found at www.mssqlrecovery.com
Kevin
>--Original Message--
>Hi All,
>My SQL server's data files all corrupted during a severe
power failure, we manage to get back the data files and
reinstall the sql server. but unforunately we failed to
attaching the database back to the server. The error
message indicating it is caused by corrupted MDF or LDF
files.
>Is there a way to perform a file level repair before we
can attach it back to sql server again ?
>Any help is very much appreciated.
>Bernard Gh
>.
>|||Hi there,
We have tried that, but the result isn't impressive for us (2 tables out of 20+), perhaps the corruption is too servere for our case. but you can try your luck.
what other program have you tried ?
--
Bernard goh
"Kevin" wrote:
> I found this program on the web...we just had the same
> thing happen and I wondered if anyone has used it (I
> posted this as a topic)...it's called MSSQLRECOVERY 2.0
> and can be found at www.mssqlrecovery.com
> Kevin
>
> >--Original Message--
> >Hi All,
> >
> >My SQL server's data files all corrupted during a severe
> power failure, we manage to get back the data files and
> reinstall the sql server. but unforunately we failed to
> attaching the database back to the server. The error
> message indicating it is caused by corrupted MDF or LDF
> files.
> >
> >Is there a way to perform a file level repair before we
> can attach it back to sql server again ?
> >
> >Any help is very much appreciated.
> >
> >Bernard Gh
> >.
> >
>
Repairing .mdf file.
Hi,
Because the .ldf file of my database 'FlexKIDS' had grown
beyong his limits (2,5 G) and I had no space left to do a
backup/shrink of the transaction log, I detached the
database and physically removed the transaction log.
When I re-attach the database (.mdf) with
the EnterpriseManger (sp_attach_db)I received the
following error:
error 1813:Could not open new database 'FlexKIDS'
createdatabase aborted.
Device activation error.The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\data\FlexKIDS_log.ldf' maybe incorrect.
Who can HELP me recover my database only from
the corrupted .mdf file (FlexKIDS.mdf)?
Cheers Jack. (jbonapart@.dicon.nl)Jack
What is the full sp_attach_single_file_db command you are
using?
Regards
John|||John,
EXEC sp_attach_single_file_db @.dbname = 'FlexKIDS',
@.physname = 'D:\Microsoft SQL\MSSQL\Data\FlexKIDS.mdf'
OUTPUT:
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'FlexKIDS'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.
>--Original Message--
>Jack
>What is the full sp_attach_single_file_db command you are
>using?
>Regards
>John
>.
>|||John,
I am also including the sp_attach_db command results:
EXEC sp_attach_db @.dbname = 'FlexKIDS',
@.filename1 = 'D:\Microsoft SQL
MSSSQL\Data\FlexKIDS.mdf'
OUTPUT:
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'FlexKIDS'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.|||Jack
I just tried it on my system. And it was fine. I created a
database FlexKids, detached it and deleted the log. Used
the same sp_attach_single_db comand you used .
I got one error, by default the data file was created as
FlexKids_data.mdf. When I amended the attach it worked
just fine.
Unless that is your problem, I do not know what else to
suggest, check you have no typos in your command.
Can you copy the .mdf to another server and try to attach
it, just to see if it will work.
Regards
John
>--Original Message--
>John,
>EXEC sp_attach_single_file_db @.dbname = 'FlexKIDS',
> @.physname = 'D:\Microsoft SQL\MSSQL\Data\FlexKIDS.mdf'
>
>OUTPUT:
>Server: Msg 1813, Level 16, State 2, Line 1
>Could not open new database 'FlexKIDS'. CREATE DATABASE
is
>aborted.
>Device activation error. The physical file
>name 'D:\Microsoft SQL
>Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.
>
>>--Original Message--
>>Jack
>>What is the full sp_attach_single_file_db command you
are
>>using?
>>Regards
>>John
>>.
>.
>
Because the .ldf file of my database 'FlexKIDS' had grown
beyong his limits (2,5 G) and I had no space left to do a
backup/shrink of the transaction log, I detached the
database and physically removed the transaction log.
When I re-attach the database (.mdf) with
the EnterpriseManger (sp_attach_db)I received the
following error:
error 1813:Could not open new database 'FlexKIDS'
createdatabase aborted.
Device activation error.The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\data\FlexKIDS_log.ldf' maybe incorrect.
Who can HELP me recover my database only from
the corrupted .mdf file (FlexKIDS.mdf)?
Cheers Jack. (jbonapart@.dicon.nl)Jack
What is the full sp_attach_single_file_db command you are
using?
Regards
John|||John,
EXEC sp_attach_single_file_db @.dbname = 'FlexKIDS',
@.physname = 'D:\Microsoft SQL\MSSQL\Data\FlexKIDS.mdf'
OUTPUT:
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'FlexKIDS'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.
>--Original Message--
>Jack
>What is the full sp_attach_single_file_db command you are
>using?
>Regards
>John
>.
>|||John,
I am also including the sp_attach_db command results:
EXEC sp_attach_db @.dbname = 'FlexKIDS',
@.filename1 = 'D:\Microsoft SQL
MSSSQL\Data\FlexKIDS.mdf'
OUTPUT:
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'FlexKIDS'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Microsoft SQL
Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.|||Jack
I just tried it on my system. And it was fine. I created a
database FlexKids, detached it and deleted the log. Used
the same sp_attach_single_db comand you used .
I got one error, by default the data file was created as
FlexKids_data.mdf. When I amended the attach it worked
just fine.
Unless that is your problem, I do not know what else to
suggest, check you have no typos in your command.
Can you copy the .mdf to another server and try to attach
it, just to see if it will work.
Regards
John
>--Original Message--
>John,
>EXEC sp_attach_single_file_db @.dbname = 'FlexKIDS',
> @.physname = 'D:\Microsoft SQL\MSSQL\Data\FlexKIDS.mdf'
>
>OUTPUT:
>Server: Msg 1813, Level 16, State 2, Line 1
>Could not open new database 'FlexKIDS'. CREATE DATABASE
is
>aborted.
>Device activation error. The physical file
>name 'D:\Microsoft SQL
>Server\data\MSSQL\Data\FlexKIDS_Log.ldf' may be incorrect.
>
>>--Original Message--
>>Jack
>>What is the full sp_attach_single_file_db command you
are
>>using?
>>Regards
>>John
>>.
>.
>
Repair Corrupted MDF & LDF Files ?
Hi All
I am looking for repair tools for corrupted mdf and ldf files,
( These files beeing corrupted after i restore them using Easy Recovery Profissional after formatting c drive by mistake. )
Remark : one file of my 3 databases work perfectly when i use attach database.
Any Help will Be appreciated.
thanks
What errors comes back while attaching the database ?HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
Subscribe to:
Posts (Atom)