创建链接的服务器和数据库别名 [英] Creating a Linked Server and Database Alias

查看:109
本文介绍了创建链接的服务器和数据库别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个服务器Server1和Server2

I have two servers Server1 and Server2

在两台服务器上,我都有一个名为QAI的数据库

On both servers i have a Database called QAI

有没有一种方法可以创建从Server2到Server1的别名的链接服务器,而不是 Server1.QAI.dbo.tbBlah

is there a way that i can create a linked server with an alias from Server2 to Server1 but instead of Server1.QAI.dbo.tbBlah

将其别名为 QAI.dbo.tbBlah

Have it aliased as QAI.dbo.tbBlah

这是必需的,因为server2上的QAI DB失败并且需要在修复后退回到Server1实例

This is needed due to the QAI DB on server2 failing and needing to fall back to the Server1 instance while it is fixed

谢谢

推荐答案

这有效.在SQL2012上测试过

This works. Tested on a SQL2012

http://alexpinsker.blogspot.se/2007/08/how-to-give-alias-to-sql-linked-server.html

将SQL链接服务器添加到特定主机没有问题 运行它.但是如果您需要给它一个别名而不是使用该怎么办 主机名作为链接服务器名?这样做的方法如下:

There are no problems to add SQL linked server to the specific host running it. But what if you need to give it an alias, rather than use hostname as linked server name? Here is how to do it:

1)步骤1:
•在SQL Server Management Studio中,打开链接的服务器",然后单击新建链接". 服务器".
•出现的向导内部–选择常规"选项卡.
•在链接服务器"字段中指定别名.
•选择"SQL Native Client"作为提供程序.
•在产品名称"字段中添加sql_server(这很神奇).
•在数据源"中–指定用作链接服务器的主机的名称.

1) Step 1:
• In SQL Server Management Studio open Linked Servers and then 'New Linked Server'.
• Inside of appeared wizard – Select the General tab.
• Specify alias name in "Linked server" field.
• Select SQL Native Client as provider.
• Add sql_server in "Product Name" field (that's the magic).
• In "Data Source" – specify name of the host to be used as linked server.

2)步骤2:
•在安全性"标签中-指定适当的安全性选项(例如,安全上下文)

2) Step 2:
• In Security tab – specify proper security options (e.g. security context)

3)步骤3:
•在服务器选项"选项卡中–将数据访问","RPC","Rpc输出"和使用远程协作"置为真实.

3) Step 3:
• In Server Options tab – put "Data Access", RPC, "Rpc Out" and "Use Remote Collaboration" to be true.

4)步骤4:
•享受.

4) Step 4:
• Enjoy.

这篇关于创建链接的服务器和数据库别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆