跨多个实例的DB2链接模式 [英] DB2 linking schemas across multiple instances
问题描述
我有几个DB2 10.5服务器实例运行在一台物理Linux机器上,我们将它们命名为INST1和INST2。
I have a few instances of DB2 10.5 server running on one physical Linux machine, let name them INST1 and INST2.
它们都包含多个模式,然而模式命名在整个机器上是唯一的,例如
INST1_SCHEMA_A,
INST2_SCHEMA_A等。
All of them contain multiple schemas, however schema-naming is unique accross whole machine, for example INST1_SCHEMA_A, INST2_SCHEMA_A etc.
我想做的是以某种方式创建一个用户,可以访问所有这些模式,因为他们是在一个实例上,所以可以进行查询像:
SELECT ID
FROM INST1_SCHEMA_A
UNION
SELECT ID
FROM INST2_SCHEMA_A
What I would like to do is to somehow create a user that can access all of those schemas as they were on one instance, so it would be possible to make a queries like: SELECT ID FROM INST1_SCHEMA_A UNION SELECT ID FROM INST2_SCHEMA_A
如何实现?我应该只链接数据库和别名模式?
How can I achieve that? Should I just link databases and alias schemas?
推荐答案
联合
Federation
是您的请求的关键字。 DB2 LUW到DB2 LUW包含在许可证中,这可以跨多个数据库完成 - 无论它们是否位于同一实例中,同一服务器上的另一个实例,甚至是不同的服务器。
is the keyword for your request. DB2 LUW to DB2 LUW is included in the license and this could be done across multiple databases - not matter if they reside within the same instance, another instance on the same server or even a different server.
在DBM CFG中设置FEDERATED = YES,定义服务器并为远程表设置昵称。有关详情,请参阅此文章或此 one 或IBM知识中心。
Set FEDERATED = YES in the DBM CFG, define a server and set up Nicknames for remote tables. For details refer to this article or this one or the IBM Knowledge Center.
这篇关于跨多个实例的DB2链接模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!