我可以在 SQL 连接字符串中使用故障转移伙伴而不进行镜像吗?

发布于 2024-07-25 04:50:04 字数 311 浏览 15 评论 0原文

我承认我有点小气,但我不想通过镜像获得 SQL Server 自动故障转移所需的三台服务器,特别是因为三台服务器中的一台除了充当见证服务器之外什么也不做。

如果我设置从主服务器到备份服务器的正常 SQL 复制(例如快照),我可以在 ASP.NET 应用程序中设置连接字符串以包含“故障转移合作伙伴=备份”吗? 客户端上的 ADO.NET 似乎应该只尝试主数据库,然后在主数据库不可用时故障转移到备份数据库。

或者这只适用于镜像?

(我喜欢镜像的想法,但如果您不想为见证服务器付费,则必须手动将备份服务器切换为主服务器。)

谢谢!

I admit I'm a bit of a cheapskate, but I don't want to spring for the three servers needed to get automatic failover for SQL Server via Mirroring, especially since one of the three would do nothing other than be a witness server.

If I set up normal SQL replication (snapshot, say) from primary server to backup server, can I just set my connection string in my ASP.NET app to include 'Failover Partner=backup'? It seems like ADO.NET on the client should just try the primary, and then failover to the backup if the primary wasn't available.

Or does that only work with mirroring?

(I like the idea of mirroring, but if you don't want to pay for the witness server, you have to manually switch the backup server to be the primary.)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

物价感观 2024-08-01 04:50:04

我还在寻找有关非镜像环境中是否支持 FailoverPartner 的原始问题的答案。 在我们的环境中,有一个通过复制同步的辅助数据库。

为了测试,我在 SSIS OLEDB 源中设置了以下连接字符串:

Data Source=PRIMARY;FailoverPartner=SECONDARY;Provider=SQLNCLI10.1;
                            Network=dbmssocn;Database=myDB;User ID=user;Password=password;

当我运行时,我看到以下错误

连接尝试故障转移到不支持的数据库
配置数据库镜像。

因此,除非辅助服务器实际上处于镜像配置中,否则这似乎是不可能的。

I was also searching for an answer to the original question about whether FailoverPartner is supported in non-mirrored environments. In our environment, there is a secondary database that is synchronized via replication.

To test, I setup the following connection string within an SSIS OLEDB source:

Data Source=PRIMARY;FailoverPartner=SECONDARY;Provider=SQLNCLI10.1;
                            Network=dbmssocn;Database=myDB;User ID=user;Password=password;

When I run, I see the following error

The connection attempted to fail over to a database which is not
configured for database mirroring.

So it appears to be not possible unless the secondary server is actually in a mirror configuration.

赢得她心 2024-08-01 04:50:04

根据 Microsoft SQL Server 2005/2008 许可条款,您的主 SQL 服务器只需要一份许可证(每个 CPU)。

您不必为镜像购买额外的 SQL Server 许可证,因为镜像服务器仅与主服务器通信。

如果发生故障转移,您有 30 天的时间将故障转移回主数据库,否则您将需要购买额外的许可证。

以下是许可详细信息的链接,请参阅第 2 页的被动服务器/故障转移支持。

Microsoft 的许可概述...

Under the terms of Microsoft's licensing for SQL Server 2005/2008, you only need one license (per CPU) for your primary SQL server.

You don't have to buy an additional SQL server license for the mirror because the mirror server only communicates with the primary.

In the event of a failover, you have 30 days to failover back to the primary, otherwise you would then need to purchase additional licenses.

Here is the link to the licensing details, refer to Passive Servers / Failover Support on page 2.

Microsoft's Licensing Overview...

莳間冲淡了誓言ζ 2024-08-01 04:50:04

Gregor,如果我没记错的话,您的见证服务器可以是在非常便宜的硬件上运行的 SQL Express(即使您需要,也可以是桌面级 PC)。 据我所知,如果不使用集群或见证服务器镜像,就无法进行自动故障转移。

请参阅 http://msdn.microsoft.com/en-us/library/ms189590 .aspxhttp://msdn.microsoft.com/en -us/library/ms175191.aspx 了解更多信息。

摘自第二个 URL 的片段:“我们强烈建议见证者驻留在与合作伙伴不同的计算机上。数据库镜像合作伙伴仅受 SQL Server 2005 Standard 及更高版本以及 SQL Server 2005 Enterprise Edition 及更高版本支持。见证者,相比之下,SQL Server 2005 Workgroup 和更高版本以及 SQL Server 2005 Express Edition 和更高版本也支持见证服务器可以在支持任何这些 SQL Server 版本的任何可靠计算机系统上运行。用作见证的服务器实例对应于您正在运行的 SQL Server 标准版本所需的最低配置。”

Gregor, if I remember right, your witness server can be SQL Express running on very cheap hardware (desktop class PC even if you need). As far as I know, there is no way to do automatic failover without using either clustering or mirroring with a witness.

See http://msdn.microsoft.com/en-us/library/ms189590.aspx and http://msdn.microsoft.com/en-us/library/ms175191.aspx for more info.

Snip taken from the 2nd url: "We strongly recommend that the witness reside on a separate computer from the partners. Database mirroring partners are supported only by SQL Server 2005 Standard and later versions and by SQL Server 2005 Enterprise Edition and later versions. Witnesses, in contrast, are also supported by SQL Server 2005 Workgroup and later versions and by SQL Server 2005 Express Edition and later versions. A witness can run on any reliable computer system that supports any of these editions of SQL Server. However, we recommend that every server instance that is used as a witness correspond to the minimum configuration that is required for the SQL Server Standard version that you are running."

定格我的天空 2024-08-01 04:50:04

我正在寻找类似的东西; 是否可以将故障转移伙伴指定为一个且唯一的连接字符串;
- 显然只要存在故障转移伙伴就可以;
- 数据库引擎足够聪明,可以在主服务器上发生故障转移时进行平衡(幸运的是);

I was searching for something similar; is it possible to specify the failover partner into one and one only connectionstring;
- apparently it is as long as a failover partner exists;
- the db engine is clever enough to balance when failing over on master (fortunately);

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文