1. Create a database
[Db2inst1@localhost ~]$ db2set db2codepage=1208 #设置编码
[Db2inst1@localhost ~]$ DB2 CREATE DATABASE WMS Automatic Storage Yes using CodeSet utf-8territory cn pagesize 32768 #创建wm s database
Specify the DB2 database installation directory
DB2 Create DB xxdb On/app/dbdata using CODEPAGE "GBK" Country "ZH_CN"
2. Export the ixf file of the table (for example: exportreportdata.sh)
todir=/home/cpsinst/bup/
tab= "Unteck_attachment_his unteck_busi_log unteck_dict_entry unteck_dict_type unteck_login_log UNTECK_MENU UNTECK_ OPERATION unteck_organization unteck_primarykey unteck_resource unteck_role unteck_role_resource UNTECK_USER UNTECK_ User_role "
DB2 Connect to Cpsdb
DB2 set schema= ' Odsuser '
For tabtemp in $tab
Todo
Echo $tabTemp
DB2 "Export to ${todir}/${tabtemp}. IXF of IXF Select * from ${tabtemp} "
Done
3. Import the Ixf file of the table
DB2 Connect to MYETLDB;
DB2 set Schema=odsuser;
DB2 IMPORT from Etl_busi_type. IXF of IXF MODIFIED by Forcecreate commitcount 10000 replace_create into Etl_busi_type
DB2 IMPORT from Etl_busi_type_tosend. IXF of IXF MODIFIED by Forcecreate commitcount 10000 replace_create into Etl_busi_type_tosend
DB2 IMPORT from Etl_contact_pepole. IXF of IXF MODIFIED by Forcecreate commitcount 10000 replace_create into Etl_contact_pepole