DB2 數(shù)據(jù)庫(kù)創(chuàng)建、表的ixf文件導(dǎo)出導(dǎo)入示例
1.創(chuàng)建數(shù)據(jù)庫(kù)
[db2inst1@localhost ~]$ db2set db2codepage=1208 #設(shè)置編碼
[db2inst1@localhost ~]$ db2 create database wms automatic storage yes using codeset UTF-8territory cn pagesize 32768 #創(chuàng)建wms數(shù)據(jù)庫(kù)
//指定db2數(shù)據(jù)庫(kù)安裝目錄
db2 create db xxdb on /app/dbdata using CODEPAGE "GBK" country "Zh_CN"
2.導(dǎo)出表的ixf文件(如: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
do
echo $tabTemp
db2 "export to ${toDir}/${tabTemp}.IXF of IXF select * from ${tabTemp}"
done
3. 導(dǎo)入表的ixf文件
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
相關(guān)文章:
1. Oracle的PDB數(shù)據(jù)庫(kù)創(chuàng)建DIRECTORY時(shí)遇到ORA-65254問(wèn)題及解決方法2. SQL Server數(shù)據(jù)庫(kù)創(chuàng)建表及其約束條件的操作方法3. 為DB2數(shù)據(jù)庫(kù)創(chuàng)建表空間過(guò)程4. DB2數(shù)據(jù)庫(kù)創(chuàng)建存儲(chǔ)過(guò)程時(shí)遇到的錯(cuò)誤現(xiàn)象5. DB2數(shù)據(jù)庫(kù)創(chuàng)建存儲(chǔ)過(guò)程時(shí)遇到的錯(cuò)誤6. 教你快速掌握DB2數(shù)據(jù)庫(kù)創(chuàng)建外鍵時(shí)的選項(xiàng)
