GO
alter endpoint Endpoint_Name state = stopped;
GO
alter endpoint Endpoint_Name state = started;
GO
之后除开A数据库之外,其他数据库镜像恢复正常.
之后开始解决Tfs_TFS2005Collection 数据库镜像的问题.Tfs_TFS2005Collection 镜像数据库之前的状态不是Mirror/Recovering/Pending,而是类似于正常数据库那种(后面不包含任何状态),但是当我们访问这个数据库的时候,提示该数据库不能被访问.
执行select * from sys.databases中该数据库的state_desc为Recovery_Pending.也就是说该数据库的Recovering被阻挡.
查看镜像数据库中的数据库日志:
Unable to open the physical file "D:\DATA\Tfs_TFS2005Collection\LOG\TfsVersionControl.LDF". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
A file activation error occurred. The physical file name 'D:\DATA\Tfs_TFS2005Collection\LOG\TfsVersionControl.LDF' may be incorrect. Diagnose and correct additional errors, and retry the operation.
之后尝试了以下的方法:
另外,已经尝试了的方法有如下:
1:alter database Tfs_TFS2005Collection set partner resume------无效
2:
alter endpoint endponitname state=stopped
alter endpoint endponitname state=started -----无效
3:ALTER DATABASE Tfs_TFS2005Collection SET PARTNER='TCP://Principal:5022'---无效
并且报错
Msg 945, Level 14, State 2, Line 1