Monday, February 20, 2012

restore master database not working

When I restored the master database from another server I immediately get
the message that the restore succeeded and the (single user) instance of SQL
server ends. When I attempt to start server again in single or multi-user
mode, it looks like it is going to start, but then I just get a bunch of
errors. Most of them are refering to the database files that I didn't copy
over (and they are in a different drive on the original server anyway). Then
the server just stops again. I tried using the enterprise manager and
changing the restore to location to match the new server install, and I also
used the following T-SQL:
RESTORE DATABASE master
FROM disk = 'e:\mssql\backup\master_bk.bak'
MOVE 'master' TO 'e:\mssql\data\master.mdf','mastlog' TO
'e:\mssql\data\mastlog.ldf'
go
We have done it before on a server with the same data path. I used the move
statement. Why doesn't this work?Hi,
This problem is not because of Master database restore. After restore, the
filename column for otherdatabases
(MSDB, Model, Tempdb...and user databases) in master..sysdatabases table may
be refrerring to some other
physical folder. Due to this all the databases failed tro recover and which
will cause the SQL Service to
come down. So look into the sysdatabases table and based on that copy the
files into appropriate folders,
before the restoring Master database.
Thanks
Hari
MCDBA
"rschatz" <@.> wrote in message news:uPtz449$DHA.3452@.TK2MSFTNGP11.phx.gbl...
> When I restored the master database from another server I immediately get
> the message that the restore succeeded and the (single user) instance of
SQL
> server ends. When I attempt to start server again in single or multi-user
> mode, it looks like it is going to start, but then I just get a bunch of
> errors. Most of them are refering to the database files that I didn't copy
> over (and they are in a different drive on the original server anyway).
Then
> the server just stops again. I tried using the enterprise manager and
> changing the restore to location to match the new server install, and I
also
> used the following T-SQL:
> RESTORE DATABASE master
> FROM disk = 'e:\mssql\backup\master_bk.bak'
> MOVE 'master' TO 'e:\mssql\data\master.mdf','mastlog' TO
> 'e:\mssql\data\mastlog.ldf'
> go
> We have done it before on a server with the same data path. I used the
move
> statement. Why doesn't this work?
>|||U have restored master, however your other system databases are not being
initialized because the info in master points to another physical location,
you might want to consider rebuildm utility to help you
get all system databases in correct location. . . .once this is done, you
can go on to the other server and perform sp_detach_db (check BOL) for the
user databases, then copy the *.ldf and *.mdf files into the correct
location on the new server and then run sp_attach_db(check BOL) for all the
user databases.
moving on from this, if you wish to restore your SQL agent Jobs then you can
just resotre the msdb database from the other server with the
REPLACE/MOVE(check BOL) options
Olu Adedeji
"rschatz" <@.> wrote in message news:uPtz449$DHA.3452@.TK2MSFTNGP11.phx.gbl...
> When I restored the master database from another server I immediately get
> the message that the restore succeeded and the (single user) instance of
SQL
> server ends. When I attempt to start server again in single or multi-user
> mode, it looks like it is going to start, but then I just get a bunch of
> errors. Most of them are refering to the database files that I didn't copy
> over (and they are in a different drive on the original server anyway).
Then
> the server just stops again. I tried using the enterprise manager and
> changing the restore to location to match the new server install, and I
also
> used the following T-SQL:
> RESTORE DATABASE master
> FROM disk = 'e:\mssql\backup\master_bk.bak'
> MOVE 'master' TO 'e:\mssql\data\master.mdf','mastlog' TO
> 'e:\mssql\data\mastlog.ldf'
> go
> We have done it before on a server with the same data path. I used the
move
> statement. Why doesn't this work?
>

No comments:

Post a Comment