Monday, February 20, 2012

restore MASTER database ( SQL 7.0 sp4)

when I start SQL 7.0 with single user model and restore Master database

sqlservr -c -m

in QA use command:

restore database master from disk='c:\sqldbbackup\master.bak'
with move 'master' to 'e:\mssql7\data\master.mdf',
move 'mastlog' to 'f:\mssql7\log\mastlog.ldf',
replace
go

Get error message:

Server: Msg 3708, Level 16, State 4, Line 1
Cannot drop the database 'master' because it is a system database.
Server: Msg 3166, Level 16, State 1, Line 1
RESTORE DATABASE could not drop database 'master'. Drop the database and then reissue the RESTORE DATABASE statement.

How can I do with this error, try to drop the master db, but fail?

Thanks,

GuyangWhy do you want to restore the MASTER database?
Try REBUILDM utility to do so which is recommended method.|||restore master will keep the login information from previous database.
actually, we are doing a test for moving database from one location to another ( sql 7 database, Windows 2000 server).

when I do the restore, without the "with move" option, it is success.
but if add " with move " option, give me the error messsage above.

RebuildM is alternative option when master db crash, but we want to try restore master way here.

Any suggestion.

Thanks|||Do not attempt to move master database, just restore using RESTORE statement.

Any database users previously associated with logins that need to be re-created are orphaned because the login is lost. To associate an existing database user to a new SQL Server login, see sp_addlogin. To associate an existing database user with a Windows NT user, see sp_grantlogin.

No comments:

Post a Comment