Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    beijing
    Posts
    3

    Unanswered: Partly Data Migrating

    Hello,
    I'm a db2 administration, I'm using DB2 v7.1 on AIX, I need
    to export a partly (NOT WHOLE) database (with everything included DDL and data, ... ) to a PCSERVER.
    (with windows 2000 and db2 v7.1 installed )
    for testing
    I can generate a DDL file ,but I donot know how to get partly data from AIX TO PCSERVER.
    THE database include 400 tables
    (FOR EXAMPLE,ONE TABLE INCLUDE 10 ROWS,I ONLY WANT TO 3 ROWS,I CAN USE SELECT , BUT I DONOT KNOW HOW TO SELECT the other tables related to the first table and keep the data integrity IN PCSERVER!)
    please can anybody help ! pleaaaaaase

    Thanks

  2. #2
    Join Date
    Oct 2002
    Posts
    11

    Re: Partly Data Migrating

    HI,

    You can use the where clause in the select query of the export utility of DB2. Here you have to specify the select critiria for each table.

    Here you have to ensure the data integrity, as while importing data on the PCserver you have to drop the constraint and then load/import the data into the DB2 tables.

    regards

    Ashtyu

    Originally posted by shangqian
    Hello,
    I'm a db2 administration, I'm using DB2 v7.1 on AIX, I need
    to export a partly (NOT WHOLE) database (with everything included DDL and data, ... ) to a PCSERVER.
    (with windows 2000 and db2 v7.1 installed )
    for testing
    I can generate a DDL file ,but I donot know how to get partly data from AIX TO PCSERVER.
    THE database include 400 tables
    (FOR EXAMPLE,ONE TABLE INCLUDE 10 ROWS,I ONLY WANT TO 3 ROWS,I CAN USE SELECT , BUT I DONOT KNOW HOW TO SELECT the other tables related to the first table and keep the data integrity IN PCSERVER!)
    please can anybody help ! pleaaaaaase

    Thanks

  3. #3
    Join Date
    Nov 2002
    Location
    Rio de Janeiro - Brazil
    Posts
    78

    Re: Partly Data Migrating

    Hey,

    About the DDL of the table, you can export the data using the IXF and then import/load using the parameter CREATE INTO.

    Be careful when using LOAD, because it can place your DB in a pending state if Forward Recovery is enabled (Logretain and/or UserExit = on). And as you want to ensure data integrity, I suggest you use IMPORT.

    For further info on each statement above, try looking at the Data Movement Utilities Guide and Reference. There you´ll find a whole list of parameter and retrictions.

    Fernando.

    Originally posted by shangqian
    Hello,
    I'm a db2 administration, I'm using DB2 v7.1 on AIX, I need
    to export a partly (NOT WHOLE) database (with everything included DDL and data, ... ) to a PCSERVER.
    (with windows 2000 and db2 v7.1 installed )
    for testing
    I can generate a DDL file ,but I donot know how to get partly data from AIX TO PCSERVER.
    THE database include 400 tables
    (FOR EXAMPLE,ONE TABLE INCLUDE 10 ROWS,I ONLY WANT TO 3 ROWS,I CAN USE SELECT , BUT I DONOT KNOW HOW TO SELECT the other tables related to the first table and keep the data integrity IN PCSERVER!)
    please can anybody help ! pleaaaaaase

    Thanks

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Partly Data Migrating

    Export only the required rows by using the primary key in the search condition and export all rows of the child tables. IMPORT/LOAD all of them into the database ... The referential constraint on the tables will take care of the rest ...

    Yeh ... I agree, it is not the right approach ... but in the middle of my vacation, my brain refuses to think more than this .... Apologies ..

    Cheers

    Sathyaram

    Originally posted by shangqian
    Hello,
    I'm a db2 administration, I'm using DB2 v7.1 on AIX, I need
    to export a partly (NOT WHOLE) database (with everything included DDL and data, ... ) to a PCSERVER.
    (with windows 2000 and db2 v7.1 installed )
    for testing
    I can generate a DDL file ,but I donot know how to get partly data from AIX TO PCSERVER.
    THE database include 400 tables
    (FOR EXAMPLE,ONE TABLE INCLUDE 10 ROWS,I ONLY WANT TO 3 ROWS,I CAN USE SELECT , BUT I DONOT KNOW HOW TO SELECT the other tables related to the first table and keep the data integrity IN PCSERVER!)
    please can anybody help ! pleaaaaaase

    Thanks

  5. #5
    Join Date
    Jan 2002
    Location
    Manila, Philippines
    Posts
    71

    is there DB2LOOK in AIX ?

    Export and Import using IXF format will not keep RI.

    If there is DB2LOOK in AIX, then :

    I suggest you first extract DDL using DB2LOOK.
    Create a new DB in windows.
    Connect to the new DB.
    Run the the script (from DB2LOOK) to create the tables.


    As for the records, like Sathyaram_S suggested, export the records you want from the Parent tables and all records from Dependent tables then either :

    Import the parent then Import the Dependent and let import remove invalid records
    Load all these tables then set integrity to remove invalid records

    HTH,
    Oliver

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •