Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-02-24 : 08:23:53
|
| Geoffrey writes "I would like to restore the master database onto our DSR server every night followed by the our company database with no recovery.The databases are restored with out any problem using isql.I know that master requires the "sqlservr -c -m" to be run, this I have done but it will not continue with the next command which is the restore. I have restarted the server to no avail.The code I use is as follows:Rem Stop SQL Servernet stop sqlserveragent /Ynet stop mssqlserver /YRem ***SQL Server in single user modec:cd \program files\microsoft sql server\mssql\binnsqlservr -c -mnet start mssqlserver /Ynet start sqlserveragent /Yisql -S STR_CLS1TEST -U sa -P STR_CLS1TEST -d master -Q "Restore database Master from Masterfull with recovery"net stop sqlserveragent /Ynet stop mssqlserver /Ynet start mssqlserver /Ynet start sqlserveragent /Yisql -S STR_CLS1TEST -U sa -P STR_CLS1TEST -d master -Q "restore database DBName from DBName Full with recovery"Any pointers gratefully received.Thank you for your consideration in this matter.RegardsGeoffrey" |
|
|
MuadDBA
628 Posts |
Posted - 2004-02-24 : 10:34:33
|
| Well, there are a couple things wrong there. First, by running SQLSRVR -M, you are effectively starting the SQL server service. You don't need to do a net start for that.Second, if it's in single-user mode, if you start the agent, that will use up the one connection you need to do your other queries...so don't do that, either.Finally, the process that starts the SQLSRVR.EXE will be dedicated to running that until you end that process or stop the SQL Server service. You have to do any other queries via a different script. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-02-24 : 12:36:46
|
| And why would you want to restore master on the disaster recovery server? You should only restore the user databases. To get everything else across like logins, you should have scripts to do this.Tara |
 |
|
|
|
|
|