【发布时间】:2010-02-04 15:13:20
【问题描述】:
我设置了一个数据库镜像,然后用这个connectionstring连接到它:
Data Source={0};Failover Partner={1};Initial Catalog=AdventureWorks;
Integrated Security=True;
将一些数据添加到数据库后,我关闭了主体服务器,因此镜像服务器成为主体服务器。我再次打开连接,得到这个错误:
System.Data.SqlClient.SqlException: A transport-level error has
occurred when sending the request to the server. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.)
我认为通过在连接字符串中指定故障转移伙伴,ADO.NET 将为我完成这项工作。那我现在该怎么办?
【问题讨论】:
-
您应该指定是否有见证人或者这是手动故障转移配置(如果您有见证人,您只会获得自动故障转移。请参阅technet.microsoft.com/en-us/library/ms189852(SQL.90).aspx)。您还应该检查 Principal 和 Failover 上的数据库状态。
-
@doug_w:我通过 T-SQL 手动检查,一切正常 :) @gbn:我正在使用 ADO.NET
标签: sql-server ado.net connection-string failover high-availability