I am trying to restore the master database and am getting the following erro
r:
RESTORE DATABASE must be used in single user mode when trying to restore the
master database. RESTORE DATABASE is terminating abnormally.
I know a little bit about SQL, but I am no guru, so any help is appreciated.
Thanks.Hi,
(Master database can be restore while SQL server is started in Single
user Mode)
1.. Stop SQL server Service
2.. Start Microsoft SQL Server in single-user mode.
From a command prompt, enter:
sqlservr.exe -c -m
3. Login to Query analyzer as SA
4. Execute the RESTORE DATABASE statement to restore the master
database backup, specifying:
RESTORE database master from disk='c:\backup\master.bak'
Thanks
Hari
MCDBA
"Steve" <anonymous@.discussions.microsoft.com> wrote in message
news:1DB3B978-8131-4E92-8CFB-137D6582E367@.microsoft.com...
> I am trying to restore the master database and am getting the following
error:
> RESTORE DATABASE must be used in single user mode when trying to restore
the master database. RESTORE DATABASE is terminating abnormally.
> I know a little bit about SQL, but I am no guru, so any help is
appreciated. Thanks.|||You need to start SQL Server in single-user mode in order to restore master.
This is usually done by starting SQL Server in a command window using
sqlservr.exe. For example:
CD C:\Program Files\Microsoft SQL Server\MSSQL\Binn
SQLSERVR -c -m
After you execute the RESTORE (using OSQL or Query Analyzer), SQL Server
will automatically shutdown in the command window. You can then start it
normally.
See the Books Online for more information on the SQLSERVR application.
Hope this helps.
Dan Guzman
SQL Server MVP
"Steve" <anonymous@.discussions.microsoft.com> wrote in message
news:1DB3B978-8131-4E92-8CFB-137D6582E367@.microsoft.com...
> I am trying to restore the master database and am getting the following
error:
> RESTORE DATABASE must be used in single user mode when trying to restore
the master database. RESTORE DATABASE is terminating abnormally.
> I know a little bit about SQL, but I am no guru, so any help is
appreciated. Thanks.|||Thank you, the database was restored. Now I have another problem. I restor
ed the master database to a disaster recovery server and the database names
are different. How do I Point the master DB to the new databases?|||"Steve" <anonymous@.discussions.microsoft.com> wrote in message
news:9A89A18C-6F95-4066-B08E-3D5657CDF85B@.microsoft.com...
> Thank you, the database was restored. Now I have another problem. I
restored the master database to a disaster recovery server and the database
names are different. How do I Point the master DB to the new databases?
EXEC sp_attach_db or sp_attach_single_file_db
e.g.
EXEC sp_attach_db @.dbname = N'pubs',
@.filename1 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs.mdf',
@.filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs_log.ldf'
EXEC sp_attach_single_file_db @.dbname = 'pubs',
@.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'
--Outgoing mail is certified Virus Free.Checked by AVG anti-virus system
(http://www.grisoft.com).Version: 6.0.647 / Virus Database: 414 - Release
Date: 29/03/2004|||Hi,
Since the database names and Physical file names are different in the
restored database you may need to do the below steps:-
1. Execute sp_detach_db <dbname> to detach the database
2. Use sp_attach_db <actual_dbname>,'physical mdf file name with
path','physical LDF file name with path'
Note:
Not the above 2 steps for all the problematic databases.
Thanks
Hari
MCDBA
"Steve" <anonymous@.discussions.microsoft.com> wrote in message
news:9A89A18C-6F95-4066-B08E-3D5657CDF85B@.microsoft.com...
> Thank you, the database was restored. Now I have another problem. I
restored the master database to a disaster recovery server and the database
names are different. How do I Point the master DB to the new databases?
No comments:
Post a Comment