点击上方“IT那活儿”,关注后了解更多内容,不管IT什么活儿,干就完了!!!
1
2
3
db2 "create db db1 on '/db2data/db1' using codeset UTF-8 territory CN"db2 connect to db1db2 "create table db1_t1 (name varchar(50))"db2 "insert into db1_t1 values ('aaa')"db2 "insert into db1_t1 values ('bbb')"db2 "insert into db1_t1 values ('ccc')"db2 commit;db2 "select * from db1_t1"NAME--------------------------------------------------aaabbbccc3 record(s) selected.
db2 "create db db2 on '/db2data/db2' using codeset UTF-8 territory CN"db2 connect to db2db2 "create table db2_t2 (name varchar(50))"db2 "insert into db2_t2 values ('111')"db2 "insert into db2_t2 values ('222')"db2 "insert into db2_t2 values ('333')"db2 commit;db2 "select * from db2_t2"NAME--------------------------------------------------1112223333 record(s) selected.
4
db2 update dbm cfg using FEDERATED YESdb2 force applications alldb2stop forcedb2startdb2 get dbm cfg |grep FEDERATED
5
db2 catalog tcpip node db2 remote 192.168.1.22 server 50000db2 catalog db db2 at node db2db2 connect to db2 user db2inst1 using db2inst1
6
db2 connect to db1db2 create wrapper drda
7
db2 "create server db2srv type DB2/UDB version 11.5 wrapper "DRDA" authorization \"db2inst1\" password \"db2inst1\" options( NODE 'db2', DBNAME 'db2')"
8
db2 "create user mapping for \"db2inst1\" server db2srv options
(remote_authid 'db2inst1',remote_password 'db2inst1')"
9
db2 "create nickname db2inst1.db2_t2_bm for db2srv.db2inst1.db2_t2"
--db2 "create nickname db2inst1.表3 for db2srv.db2inst1.别名表"
10
db2 "select * from db2inst1.db2_t2_bm ";
db2 connect to db2db2 "insert into db2_t2 values ('bbb')"db2 "insert into db2_t2 values ('ccc')"
db2 "select * from db2inst1.db1_t1 a1,db2inst1.db2_t2_bm a2
where a1.name=a2.name";
END
本文作者:戚传海
本文来源:IT那活儿(上海新炬王翦团队)
文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。