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資料庫
- [DB2]資料庫建立實驗DB2資料庫
- db2聯邦oracle實驗 ii的安裝DB2Oracle
- Double Kill!! 資料聯邦修煉之路
- db2 資料庫DB2資料庫
- 轉:DB2聯合資料庫(FEDERATED DATABASE)配置例項DB2資料庫Database
- springboot建立與資料庫關聯模組Spring Boot資料庫
- DB2 資料庫日常管理DB2資料庫
- 建立資料庫資料庫
- SQL Server資料庫建立新使用者及關聯資料庫的方法教程SQLServer資料庫
- DB2 資料庫中的資料型別DB2資料庫資料型別
- MySQL 建立資料庫 建立表MySql資料庫
- DB2中安裝sample資料庫和TOLLSDB資料庫DB2資料庫
- DB2查詢資料庫大小DB2資料庫
- DB2資料庫配置問題??DB2資料庫
- 建立資料庫表資料庫
- Mysql建立資料庫MySql資料庫
- 建立資料庫命令資料庫
- 手工建立資料庫資料庫
- 建立ASM資料庫ASM資料庫
- Laravel 建立資料庫Laravel資料庫
- 資料庫聯盟資料庫
- DB2資料庫中的各資料型別DB2資料庫資料型別
- 常見資料庫系統之比較 - DB2資料庫(轉)資料庫DB2
- 資料庫無法建立資料庫檢視資料庫
- 監控DB2資料庫指令碼DB2資料庫指令碼
- DB2資料庫的解除安裝DB2資料庫
- Kafka聯結器建立資料管道Kafka
- mongodb 如何建立資料庫MongoDB資料庫
- 資料庫之建立索引資料庫索引
- 建立資料mysql庫流程MySql
- 手工命令建立資料庫資料庫
- 手動建立資料庫資料庫
- Oracle 手工建立資料庫Oracle資料庫
- 建立catalog 資料庫資料庫
- 建立oracle資料庫(1)Oracle資料庫
- 手工建立oracle資料庫Oracle資料庫