Monday, March 26, 2012

Log Shipping restore problem

I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.Before you restore, you need to make sure there's no one in the database.
You will have to kill all user connections in the database, if there are
any. More info can be found at:
http://vyaskn.tripod.com/administration_faq.htm#q16
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Vic" <vduran@.specpro-inc.com> wrote in message
news:017e01c3d93f$dd6bc360$a401280a@.phx.gbl...
I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.

No comments:

Post a Comment