Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Problem

Status
Not open for further replies.

IBACFII

Programmer
Sep 2, 2004
76
US
Ok I decided to break up my Sql db into ndf files to improve performance. All was going well as I was progessing however as I Finalized this change it crashed.
The server is a SS 7.0 on a win 2000 machine. Now I cannot get my Db back up becuse the ndf files are not there but the db thinks that they should be. any help would be great.

i tried sp_attach and sp_attach_single file with no luck. This is a new db and has no formal back up as of yet so that is not an option.
 
OK ... you said "becuse the ndf files are not there but the db thinks that they should be."

If you in deed mean NDF, which are secondary database file, and NOT LDF, which is your transaction log ... the error is absolutley correct!!!

Reattaching a database, which I am assuming you did to move the physical files to their new locations, can in most cases be done without the LDF/transaction log BUT it I believe it cannot be attached if it is missing any of the secondary database files if they were used.

SO ... you may need to get all of the files back in some fashion. That being a minimum of your MDF and all the NDFs that we were created for the database. Once again, you may be able to reattach the DB without the LDF/transaction log.

Good Luck!

Thanks

J. Kusch
 
Ok. That what I figured. I have tried to make a new db and name the files the same and put them in the same folder moving the old ones of course and then tried resotring the db using the newer NDF files still no luck. How can I "fashion" some new ones?.
btw I dont care about any data in the DB just the DB itself and a couple of USP's

Thanks,
IBACFII
 
Do you have an .mdf file to go along with those .ndf files?

Move the .mdf and all related .ndf files to the same folder on the local drive of the SQL Server. Then do an Attach Database (rename the DB you're attaching so you don't try and attach to the DB you made) on the .mdf file and the .ndf files *should* follow suit. Try this through Enterprise Manager & right click the Databases folder. You should be able to see Attach Database there.

Does that help?





Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
 
Yes I have the MDF and the log file. However, I do not have the ndf files. There is my problem. It wants the ndf in order to do any kind of attachdb. I was thinking that there maybe a way to fabricate these ndf files inorder to get the db back up? Thoughts?


IBACFII
 
You can't fabric data. That's the problem. The .ndf files have the rest of your database data on them. So, if you don't have the .ndf files, you don't have a database.

You're going to have to start all over with no data unless you can find a complete database backup to do a restore from.



Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
 
Thanks.
Thats what I ended up doing sort of. I did in fact save most of the text to script the important parts and then I just had to tweak it to get it back to the most current version.

Thanks for the help anyway.

IBACFII

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top