DB2 database creation, table IXF file Export Import sample _DB2

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to create database

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.