Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Attach MDF without LDF or some how get this workin

Author  Topic 

Matti Kalijarvi
Starting Member

5 Posts

Posted - 2011-10-18 : 22:23:57
So im attempting to fix a screw up from a client.
long story short
server died, old IT guy ....long gone

Recovered the MDF and LDF but.....
i get the "log scan number passed to log scan in database is not valid."

So i attach an old Backup, turn off sql service and copy over the MDF and LDF files.

Then i get the DB attached but stuck in suspect mode.

Then put the database in Emergency mode using this command.
1.ALTER DATABASE dbname SET EMERGENCY

The next step was to run DBCC CHECKDB against that database.
1.DBCC CHECKDB (dbname) WITH ALL_ERRORMSGS

bam


screwed

Cannot open database 'dbname' version 655. Upgrade the database to the latest version.

Im sure im using the same sql version as they were as their old sql errorlog from the recovered server shows 10.50.1600.1

and im using sql2008 r2 express
which im sure is 10.50.1600.1

How can i get this db restored, not to concerned with minor data loss at this point

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-18 : 22:31:30
Do you not have real backups? Using the mdf/ldf files is a crap shoot.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Matti Kalijarvi
Starting Member

5 Posts

Posted - 2011-10-18 : 22:37:08
no dude ... i wouldn't be doing this if i had a Bak....

well i have a bak file.... but from 2009
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-10-18 : 23:26:49
Lovely. Is complete loss of the database acceptable?

What version was this database on? 2005 or 2008? You should not ever try to upgrade a damaged database, it generally doesn't work.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Matti Kalijarvi
Starting Member

5 Posts

Posted - 2011-10-18 : 23:33:17
The database was on 2008r2

but the strange thing is im using sql2008r2
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-10-18 : 23:36:27
Are you absolutely, completely sure of that? Because version 655 is SQL 2008, not SQL 2008 R2. R2 is 660.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-19 : 00:00:57
Install SQL 2008 (R1) and see if you can attach it there.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Matti Kalijarvi
Starting Member

5 Posts

Posted - 2011-10-19 : 01:04:04
So you were both right it was R1
But..... now .....

I trick it by creating a dummmy database, turning off sql coppying over the med and ldf

In suspect mode now so i try

ALTER DATABASE DBName SET EMERGENCY;
GO
ALTER DATABASE DBName SET SINGLE_USER;
GO
DBCC CHECKDB (DBName, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS;
GO

BAM ---- TRAIN WRECKED AGAIN :(


Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file 'c:\SQL DATABASE\DMNAME_1.LDF'.
Msg 5024, Level 16, State 2, Line 1
No entry found for the primary log file in sysfiles1. Could not rebuild the log.
Msg 5028, Level 16, State 2, Line 1
The system could not activate enough of the database to rebuild the log.
Msg 7909, Level 20, State 1, Line 1
The emergency-mode repair failed.You must restore from backup.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-10-19 : 01:59:24
quote:
Originally posted by Matti Kalijarvi

Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file 'c:\SQL DATABASE\DMNAME_1.LDF'.



Does the path exist?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Matti Kalijarvi
Starting Member

5 Posts

Posted - 2011-10-19 : 08:28:43
Yes the path does exist....
that's why im so confused.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-10-19 : 10:24:05
In that case...
quote:
Msg 7909, Level 20, State 1, Line 1
The emergency-mode repair failed.You must restore from backup.
Pretty much says it all. Restore to your last good backup or declare the DB a complete loss and recreate completely.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -