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@]
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DB2建立資料庫,建立表空間DB2資料庫
- db2 資料庫DB2資料庫
- springboot建立與資料庫關聯模組Spring Boot資料庫
- 建立資料庫資料庫
- Double Kill!! 資料聯邦修煉之路
- SQL Server資料庫建立新使用者及關聯資料庫的方法教程SQLServer資料庫
- DB2資料庫適配NC65DB2資料庫
- db2匯出資料庫定義及遷移資料DB2資料庫
- 建立資料庫表資料庫
- Mysql建立資料庫MySql資料庫
- DB2資料庫連線失敗問題DB2資料庫
- db2資料庫的啟動和關閉DB2資料庫
- DB2資料庫自動備份方法TRDB2資料庫
- XamarinSQLite教程建立資料庫aSQLite資料庫
- 建立資料mysql庫流程MySql
- 小黑框建立資料庫資料庫
- 資料庫 建立 3表資料庫
- mongodb 如何建立資料庫MongoDB資料庫
- 資料庫之建立索引資料庫索引
- DB2多分割槽資料庫的常用管理NWDB2資料庫
- DB2資料庫優化十大技巧AODB2資料庫優化
- 資料庫也可以像電腦一樣組裝:使用Kafka建立關聯式資料庫 – Robert Yokota資料庫Kafka
- Kafka聯結器建立資料管道Kafka
- oracle資料庫建立資料庫例項-九五小龐Oracle資料庫
- 帶你輕鬆接觸”DB2″資料庫中的資料型別DB2資料庫資料型別
- 2 建立和配置資料庫資料庫
- 2.8.1.4 建立資料庫服務資料庫
- 2.2.1 資料庫建立計劃資料庫
- 2.1 關於建立資料庫資料庫
- SQL建立資料庫和表SQL資料庫
- mongodb資料庫如何建立索引?MongoDB資料庫索引
- 關聯式資料庫很快會替代向量資料庫資料庫
- 關聯式資料庫與文件資料庫對比資料庫
- 某行XX系統DB2資料庫遷移實施方案DB2資料庫
- php sqlite 建立本地資料庫PHPSQLite資料庫
- 2.5.8 指定OMF方式建立資料庫資料庫
- 2.5 指定資料庫建立語句資料庫
- 2.4.10 Step 9:手工建立資料庫資料庫
- 2.3 通過DBCA建立資料庫資料庫