db2 联邦 mysql_DB2创建联邦数据库

联邦数据库配置步骤:

db2 update dbm cfg using federated yes #参数配置

db2 catalog node #编目节点

db2 catalog database #编码远程数据库

db2 connect to db #连接本地数据库

db2 create wrapper drda #创建wrapper

db2 create server   #创建服务器

db2 create user mapping #创建用户mapping

db2 create nickname  #创建远程数据库对象nickname

*********************************************************************************

1.设置数据库属性

db2 update dbm cfg using federated yes

db2stop

db2start

*********************************************************************************

2.编目节点

CATALOG TCPIP NODE db2_node REMOTE system42 SERVER db2tcp42

where:db2_node is the name that you assign to the node

system42 is the host name of the system where the data source resides

db2tcp42 is the service name or primary port number of the server database manager instance

*********************************************************************************

3.编目数据库

CATALOG DATABASE DB2DB390 AS CLIENTS390 AT NODE DB2NODE AUTHENTICATION SERVER

where:DB2DB390 is the name of the remote database to catalog

CLIENTS390 is the alias for the remote database being cataloged. If you do not specify an alias, the database manager uses the name of the remote database as the alias.

DB2NODE is the name of the node that you previously cataloged

AUTHENTICATION SERVER specifies that authentication takes place on the DB2 data source node

*********************************************************************************

4.创建wrapper

db2 create wrapper drda

*********************************************************************************

5.创建server

CREATE SERVER CRANDALL

TYPE DB2/ZOS

VERSION 7.1

WRAPPER DRDA

AUTHORIZATION "GERALD"

PASSWORD drowssap

OPTIONS

(DBNAME 'CLIENTS390',

FOLD_ID 'U',

FOLD_PW 'U',

COLLATING_SEQUENCE 'Y')

where: Register a server definition to access a DB2 for z/OS? and OS/390?, Version 7.1 data source. CRANDALL is the name assigned to the DB2 for z/OS and OS/390 server definition. DRDA is the name of the wrapper used to access this data source. In addition, specify that:

GERALD and drowssap are the authorization ID and password under which packages are bound at CRANDALL when this statement is processed.

The alias for the DB2 for z/OS and OS/390 database that was specified with the CATALOG DATABASE statement is CLIENTS390.

The authorization IDs and passwords under which CRANDALL can be accessed are to be sent to CRANDALL in uppercase.

CLIENTS390 and the federated database use the same collating sequence.

*********************************************************************************

6创建mapping

CREATE USER MAPPING FOR ETL SERVER CRANDALL

OPTIONS (REMOTE_AUTHID 'etl', REMOTE_PASSWORD 'xxxxxx');

*********************************************************************************

7创建nickname

CREATE NICKNAME SCHEMA.TABLENAME FOR SERVERNAME.SCHEMA.TABLENAME;

*********************************************************************************

相关参考:

db2 list node directory

db2 list db directory

DROP USER MAPPING FOR authorization_name SERVER server_name

DROP NICKNAME nickname

DROP WRAPPER wrapper_name

DROP SERVER server_name[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23937368/viewspace-1044147/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值