由于恢复数据库时需要对数据库进行独占的访问,在恢复之前你必须中止其他用户与数据库的连接。
网上的解决方法:
在恢复数据库前:
方法一.打开Management Studio.
a). 右键点击你的数据库,Task ->Take Offline.
b). 右键点击你的数据库,Task ->Bring Online.
方法二.执行如下的Query:
Use Master
Alter Database [YOURDB]
SET SINGLE_USER With ROLLBACK IMMEDIATE
在恢复数据库后如果需要恢复会普通多用户模式:
Use master;
Go
Alter Database [YOURDB]
SET MULTI_USER
Go
说下自己的总结:
直接执行:Alter Database [YOURDB]
SET SINGLE_USER With ROLLBACK IMMEDIATE
在还原bak文件即可
相关推荐
1.1You may use the SOFTWARE PRODUCT pursuant to the license grant above and subject to the following terms and the proprietary notices in the SOFTWARE PRODUCT or on the media upon which the SOFTWARE ...
For example, if the clustered index is on (lastname, firstname) and a nonclustered index is on firstname, the firstname value will not be duplicated in the nonclustered index leaf rows. Note The ...
In our example, if one transaction (T1) holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have ...
Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be...
1.9 "Authorized End User" means every individual who is not registered by Licensor but who is allowed to use the Registered Software in accordance with the terms and conditions set forth in this ...
Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be...
1. The Licensee shall be granted a single, non-exclusive right of use of the software freeware version unlimited in time, as well as, after complete and unconditional payment of the license fee, a ...
Copyright Law of the Publisher’s location, in its current version, and permission for use must always be obtained from Springer. Permissions for use may be obtained through RightsLink at the ...
Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be...
Publisher’s location, in its current version, and permission for use must always be obtained from Springer. Permissions for use may be obtained through RightsLink at the Copyright Clearance Center. ...
Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be...
exclusive use by the purchaser of the work. Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher's location, in its current ...
not install or use the SOFTWARE on a computer that is a network server or a computer at which the SOFTWARE is used by more than one Developer. You may not network the SOFTWARE or any component part ...
not install or use the SOFTWARE on a computer that is a network server or a computer at which the SOFTWARE is used by more than one Developer. You may not network the SOFTWARE or any component part ...
of being entered and executed on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication or parts thereof is permitted only under the provisions of the ...
Allround Automations warrants that it is the owner of the software product, and that it has the right and authority to convey and grant the license(s) herein and to perform this LA, and that the use ...
A Diskeeper exclusive, the Terabyte Volume Engine (TVE) is designed to efficiently defragment extremely large (larger than 60 GB) volumes. This feature is available in selected Diskeeper editions. ...
The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this LICENSE does not cover ...
If and to the extent that the Software is designed to be compliant with any published communications standard (including, without limitation, DOCSIS, HomePNA, IEEE, and ITU standards), Licensee may ...
The RAR/WinRAR unlicensed trial version may be freely distributed, with exceptions noted below, provided the distribution package is not modified in any way. No person or company may distribute ...