Monday, March 19, 2012

Help! How can I attach a DB with Corrupted Log Files

I have a backup of a Database files that its log files are damaged ( so I
can't attach it to SQL Server) please tell me if there is a way to attach a
database when its log files are corrupted? ( this DB has two ndf files so I
couldn't use the sp_attach_single_db_file)Look at
Syntax
sp_attach_single_file_db [ @.dbname = ] 'dbname'
, [ @.physname = ] 'physical_name'
in BOL
"Par" <beatles1692@.yahoo.com> wrote in message
news:#$q3$tcdDHA.656@.tk2msftngp13.phx.gbl...
> I have a backup of a Database files that its log files are damaged ( so I
> can't attach it to SQL Server) please tell me if there is a way to attach
a
> database when its log files are corrupted? ( this DB has two ndf files so
I
> couldn't use the sp_attach_single_db_file)
>|||You might try to
1. save off the good mdf and ndf files.
2. recreate the database with the same structure.
3. detach the new empty db,
and try using THAT log to re-attach the originals...
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
"Par" <beatles1692@.yahoo.com> wrote in message
news:%23$q3$tcdDHA.656@.tk2msftngp13.phx.gbl...
> I have a backup of a Database files that its log files are damaged ( so I
> can't attach it to SQL Server) please tell me if there is a way to attach
a
> database when its log files are corrupted? ( this DB has two ndf files so
I
> couldn't use the sp_attach_single_db_file)
>|||This may be of interest:
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
--
Andrew J. Kelly
SQL Server MVP
"Par" <beatles1692@.yahoo.com> wrote in message
news:%23$q3$tcdDHA.656@.tk2msftngp13.phx.gbl...
> I have a backup of a Database files that its log files are damaged ( so I
> can't attach it to SQL Server) please tell me if there is a way to attach
a
> database when its log files are corrupted? ( this DB has two ndf files so
I
> couldn't use the sp_attach_single_db_file)
>

No comments:

Post a Comment