If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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

Re: Partly Data Migrating

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

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

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