码迷,mamicode.com
首页 > 数据库 > 详细

SQL restore

时间:2015-05-18 18:23:47      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Restore failed for Server ‘sacsql204‘.  (Microsoft.SqlServer.SmoExtended)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Exclusive access could not be obtained because the database is in use.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3101)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.2480&EvtSrc=MSSQLServer&EvtID=3101&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

解决方案:

disconnect other users by scripts belowe:

 

USE master

GO

ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE

GO

ALTER DATABASE YourDatabaseName SET OFFLINE WITH ROLLBACK IMMEDIATE

GO

ALTER DATABASE YourDatabaseName SET MULTI_USER

GO

ALTER DATABASE YourDatabaseName SET ONLINE WITH ROLLBACK IMMEDIATE

GO

 

SQL restore

标签:

原文地址:http://www.cnblogs.com/ritaandrita/p/4512321.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!