Detailed steps for cross-platform migration of application systems based on DB2 and PHP (II.)

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

5. Working with a self-added field in a database table

For a table with a self added field that needs to be loaded, that is, the value of the IXF data file in the table, you can add the following parameter to the load command to control the value of the self-added field:

1). Modified by Identityignore: The loaded data file has the value of the self added field, the value of the data file is ignored when load;

2. Modified by identitymissing: There is no self-added field value in the loaded data file, and automatically generates the self Increment field value when load;

3). Modified by Identityoverride: The data file is loaded with a self added field value that uses the value of the self added field in the data file when load.

To make the data in the table containing the field in the target database consistent with the data in the source database, select Use the modified by identityoverride parameter in this article instance to use the value of the field in the data file when importing data. The reader can choose the appropriate control parameters according to different circumstances.

First, find all the table names in the Srcdb1_tables.ddl file that contain the generated ALWAYS as IDENTITY field, and then modified by IdentIT in Srcdb1_load.sql The Yoverride statement fragment is inserted into the load command line for the table that contains the self-added fields.

Listing 8. Self-adding field processing in load script

DB2 load from TEST.IXF of IXF modified by identityoverride inserts into test;

6. Execute Export Script

Performs an export script that exports data from all tables.

# DB2-TVF Srcdb1_export.sql

The exported table data is stored in IXF format under the current path.

7. Save scripts and data files

Copy all DDL scripts and data file *.ixf to the site where the target system resides.

Operations on a LINUX system

1. To create an instance SRCDB1 from the command line processor (CLP):

# DB2ICRT SRCDB1

2. Create database SRCDB1 with the Create DB command, creating the necessary table spaces, and configuring the necessary database parameters.

# DB2 CREATE DATABASE SRCDB1

3. Connect to the database SRCDB1, execute SRCDB1_TABLES.DDL scripts to create buffer pools, tablespaces, UDF, tables, and index,sequence, views and other database objects.

# DB2 Connect to SRCDB1

# DB2-TVF SRCDB1_TABLES.DDL

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.