使用服务器名称或 IP 地址创建本地链接服务器?

发布于 2024-08-17 05:46:01 字数 392 浏览 3 评论 0原文

根据我收到的关于这个问题的答案(https://stackoverflow.com/questions/1911969/...)我已经在 SQL Server 2008 上设置了一个链接服务器到 Pervasive 数据库。

由于两个数据库都位于同一台物理服务器上,因此建议使用服务器的 IP 地址或服务器名称来创建链接服务器的方法是什么?我的直觉告诉我使用 IP 地址以避免解析名称并避免任何不必要的查找。或者说速度真的不重要吗?

你觉得怎么样?为什么?

Based on the answer I received on this question (https://stackoverflow.com/questions/1911969/...) I have set up a Linked Server on SQL Server 2008 to a Pervasive database.

Since both databases are on the same physical server, what would be the recommended method to create the linked server, using the IP Address of the server or the Server Name? My gut tells me to use the IP address as to avoid resolving the name and avoid any unnecessary lookups. Or does it really not matter at all speed wise?

What do you think and why?

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

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

发布评论

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

评论(2

断肠人 2024-08-24 05:46:01

使用服务器名称,无论是 FQDN (SVR01.domain.tld) 还是 DNS 别名、“localhost”或“127.0.0.1”。不是实际的服务器IP。它使未来的生活更轻松。

或者称其为“普遍”并指向本地?

正如您所提到的,服务器名称在 sys.servers 中必须是唯一的,并且 SQL 本身 (@@SERVERNAME) 使用实例的名称。如果您有默认 SQL 实例并且在 SVR01 上普遍存在,则无法引用普遍链接服务器的“SVR01”。

性能既不在这里也不在那里。一旦名称被解析,它就会被缓存。

Use server name, whether FQDN (SVR01.domain.tld) or DNS alias or "localhost" or "127.0.0.1". Not the actual server IP. It makes life easier in future.

Or call it "pervasive" and point it locally?

As you mentioned, server names must be unique in sys.servers and SQL itself (@@SERVERNAME) uses the name of the instance. If you have a default SQL instance and pervasive on SVR01, you can't refer to "SVR01" for the pervasive linked server.

Performance is neither here nor there. Once the name is resolved it's cached anyway.

谈情不如逗狗 2024-08-24 05:46:01

两者都可以,但我也倾向于使用 IP 来避免名称解析问题。

使用 DNS 名称的一个好处是,如果 IP 由于某种原因发生更改,链接仍然有效。但这不是问题,因为您的数据库位于同一服务器上。

Either is fine, but I too lean towards using the IP to avoid name resolution issues.

A benefit to using the DNS name is that if the IP changed for whatever reason, the link would still work. But that's not an issue, being that your databases are on the same server.

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