点击上方“IT那活儿”,关注后了解更多内容,不管IT什么活儿,干就完了!!!
1
迁移准备
2
db2move的适用情况
3
HADR1上进行的工作
[db2inst1@HADR1 ~]$ db2 "create table cfsource2 (name varchar(10)) "DB20000I The SQL command completed successfully.
[db2inst1@HADR1 ~]$ db2 "CREATE PROCEDURE insert_cf () DYNAMIC RESULT SETS 1 P1: BEGIN declare a int; set a=1; loop1: LOOP if(a<=1000) then insert into cfsource2(NAME) values('f'); set a=a+1; else leave loop1; end if; end loop loop1; END P1"DB20000I The SQL command completed successfully.
[db2inst1@HADR1 ~]$ db2 call insert_cfReturn Status = 0
[db2inst1@HADR1 ~]$ db2 "select count(*) from cfsource2"1-----------1000[db2inst1@HADR1 ~]$ db2 "select * from cfsource2 fetch first 1 rows only"NAME----------1
[db2inst1@HADR1 ~]$ db2look -d sample -e -l -o db2look_sample.ddl-- No userid was specified, db2look tries to use Environment variable USER-- USER is: DB2INST1-- Creating DDL for table(s)-- Output is sent to file: db2look_sample.ddl-- Binding package automatically ...-- Bind is successful-- Binding package automatically ...-- Bind is successful
[db2inst1@HADR1 backup]$ db2move sample exportApplication code page not determined, using ANSI codepage 1208***** DB2MOVE *****Action: EXPORTStart time: Thu Mar 4 06:18:50 2021Connecting to database SAMPLE ... successful! Server : DB2 Common Server V9.7.0EXPORT: 18 rows from table "DB2INST1"."ACT"EXPORT: 0 rows from table "DB2INST1"."CATALOG"
4
HADR2中的工作
[db2inst1@HADR1 ~]$ db2 -tvf db2look_sample.ddl
[db2inst1@HADR1 backup]$ cd home/db2inst1/db2inst1/backup[db2inst1@HADR1 backup]$ db2move sample load
[db2inst1@HADR1 backup]$ db2 "select * from cfsource2 fetch first 1 rows only"NAME----------11 record(s) selected.
END
本文作者:干建宇
本文来源:IT那活儿(上海新炬王翦团队)

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




