IBM DB2 LUW DBA Tutorial -- Federation creation (DB2 LUW 11.1)

/**

声明:此随笔为在youtube上学习‘ IBM DB2 LUW/UDB DBA Tutorial for Beginners' 课程笔记.

YouTube视频连接:https://www.youtube.com/watch?v=Pjvwm4rC5Ok&list=PLCNIKwM6iuv7g1hDWDcNkc66vZuVJmvZg

**/

Pre requisites:

  1. make sure FEDERATED DBM configuration is YES at instance level for both instances.

   After update, make sure that both instances are restarted(db2stop force, db2start)

  2. Both instances should have a port number associated and DB2COMM=TIPIP should be set. Also make sure the instance is up and running fine.

  3. db2pd -edus | grep db2tcpcm

 

 

  4. Make sure to add entries as below in /etc/hosts(Add it on both hosts)

    [server_ip server_name]

    [server_ip server_name]

    192.168.xx.xxx rhel1

    192.168.xx.xxx rhel2

  5. Make sure we are able to ping each server from other server.

  6. Make sure that firewall is stopped in both hosts. Please use below commands to stop the firewall as root user.

    service iptables status

    service iptables stop

    chkconfig iptables off

    service iptables status

Server and database information:

 

 

 To find out port number where instance is listening:

  db2 get dbm cfg | grep -i SVCE

 

 1. Set node and database catalog on RHEL2

  db2 catalog tcpip node TCPFED remote 192.168.xx.xxx server 5000

  db2 catalog db TESTDB1 as TESTDB1 at node TCPFED

2. Create federation

  db2 create wrapper drda

  Note: Wrappers are mechanisms by which the federated server interacts with data sources. The federated server uses routines stored in a library called a wrapper module to implement a wrapper.

  db2 create server FED type db2/udb version 11.1 wrapper drda authorization "db2inst1" password "password" options (DBNAME 'TESTDB1')

  Note: The CREATE SERVER statement defines a data source to a federated database.

  db2 create user mapping for db2inst1 server FED options (remote_authid 'db2inst1', remote_password 'password')

  db2 create nickname t1_rhel1 for FED.db2inst1.t1

  db2 select * from t1_rhel1 (Checking nickname data)

3.Get existing details on Federation

  db2 select substr(WRAPNAME,1,20) as WRAPNAME, WRAPTYPE, WRAPVERSION, substr(LIBRARY,1,20) as LIBRARY from syscat.wrappers

 

posted on 2020-07-16 13:09  画扇2020  阅读(143)  评论(0编辑  收藏  举报