August 18, 2009 at 5:42 am
Hi,
One of our customer servers has crashed. they are unable to restore the c:\ drive from backup (this drive included SQL system files) but all SQL datafiles were on d:\ and are still available. SQL Server is no longer on the server. Is there are way to restore / attach the datafiles to another SQL server? these databases were not detached at the the time of the crash. I take it i cant use sp_attach, does anyone know of another method
cheers,
Shaun
August 18, 2009 at 6:04 am
It should be possible to attach the files. The 2005 replacement for sp_attach is CREATE DATABASE .... FOR ATTACH
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 18, 2009 at 6:10 am
You mentioned "system files". I'm not sure if you meant SQL binaries or system databases?
If you meant your system databases were also on C then you'll need to recreate your logins and permissions as well if you have no backups of the master database.
Not forgetting any jobs which may be lost if you have no msdb...
August 18, 2009 at 6:20 am
Also, where are the backups of all these databases?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 18, 2009 at 6:34 am
It sounds like you need to:
- install SQL Server
- attach the databases
- rebuild logins if you cannot attach master.
August 18, 2009 at 7:17 am
thanks for the replies, master database data files are on d:\ as well. i meant SQL installation files etc were all lost.
i need to install SQL server 2000 again. Can i just attach master, tempdb, model etc as well.
what i was thinking might be the best if i can attached the client application databases and recreate the login there'll be no need to attach the master etc - does this sound right?
August 18, 2009 at 7:25 am
Sure, if you only have a few logins / databases etc in the master database, then yes, you can attach your client database and quickly add the logins back in manually.
August 18, 2009 at 7:27 am
Forgot to mention, once you have added the login back in, if you try to add the user, you'll likely get a message telling you the user already exists in database X.
You'll need to run the following in the attached database:
sp_change_users_login 'auto_fix', 'UserName'
This will fix the login/user mapping for you and retain the original permissions.
August 18, 2009 at 7:31 am
Master is a parameter in the service startup, so what you'd do it make you have a copy of your current files. Install SQL, then change the startup parameter to point to your old master database.
You don't need to worry about tempdb or model (or shouldn't). Never tried attaching msdb, but I'm sure it can be done.
August 18, 2009 at 7:49 am
thanks guys, i'll give it a go
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply