另外使用sql语句的处理 类似,比如: backup database Northwind to disk = 'c:\Northwind.bak' restore database Northwind from disk = 'c:\Northwind.bak'我的库 备份会提示 有问题,真是 很奇怪
我觉得是群殴红色圈出部分的 在作怪,因为圈出的地方的这个是备份机上的实例名,另外一个还原到另一台机的数据库的server name 不知道这个如何处理呢?
使用 sql语句还原方式: backup database North to disk = 'c:\North.bak' restore database North from disk = 'c:\North.bak' 还原提示报错: Msg 3102, Level 16, State 1, Line 1 RESTORE cannot process database 'North' because it is in use by this session. It is recommended that the master database be used when performing this operation. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.
类似,比如:
backup database Northwind to disk = 'c:\Northwind.bak'
restore database Northwind from disk = 'c:\Northwind.bak'我的库 备份会提示 有问题,真是 很奇怪
我觉得是群殴红色圈出部分的 在作怪,因为圈出的地方的这个是备份机上的实例名,另外一个还原到另一台机的数据库的server name 不知道这个如何处理呢?
backup database North to disk = 'c:\North.bak'
restore database North from disk = 'c:\North.bak'
还原提示报错:
Msg 3102, Level 16, State 1, Line 1
RESTORE cannot process database 'North' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
1) Use WITH REPLACE while using the RESTORE command. View Example
2) Delete the older database which is conflicting and restore again using RESTORE command.参考 http://blog.sqlauthority.com/2007/09/27/sql-server-fix-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/
选择了,方法1:我先直接手动的备份一份,然后在我想备份的机子上新建一个同名的数据库,然后还原.bak文件的,选择如上图中的选项来自文件下的.bak后,勾选,点击确定,就是如上的图例的错误
我就是感觉是这个实例的(server name )的不同造成的不能还原,有什么方法处理么?
我是备份的库机子上是一个实例名(server name):SURMOUNT\SURMOUNTTEST , 还原的机子上的实例名(SURMOUNT-GROUP\SURMOUNT)
2、
我的服务器是10.20.30.120,库是从ys-mssql01中备份的,还原成功
方案2:删除surmount库,然后再还原,库名依旧用surmount
您说的方案一 我操作明白了,就是不知道为啥不能命名一个同名的,然后还原再覆盖?
您说的方案2:删除surmount库,然后再还原,库名依旧用surmount,这个是什么意思?是指新建一个surmount库后,再删除?然后再使用方式1的方式还原?
方案2中,因为删除了那个库,所以本身就等于没有这个库了,直接还原就可以了。不需要使用方案1
我只之前也是碰到这种问题,这样做是可以的。