标题 | DB2 数据库创建、表的ixf文件导出导入示例 |
内容 | 1.创建数据库 [db2inst1@localhost ~]$ db2set db2codepage=1208 #设置编码 [db2inst1@localhost ~]$ db2 create database wms automatic storage yes using codeset UTF-8territory cn pagesize 32768 #创建wms数据库 //指定db2数据库安装目录 db2 create db xxdb on /app/dbdata using CODEPAGE "GBK" country "Zh_CN" 2.导出表的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. 导入表的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 |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。