Tuesday, November 25, 2008

DB2 Export, Then Import

I was working to do a data migration and rather then doing the migration via some ETL implementation, I wanted to do a straign export, and the import. For example, if you were migrating data from a test table to somewhere else. Here is how I did it for DB2.

Export

EXPORT TO "/home/dbuser/schema.table.ixf" OF IXF MESSAGES "/home/dbuser/schema.table.msg" SELECT * FROM SCHEMA.TABLE

Import

IMPORT FROM "/home/dbuser/schema.table.ixf" OF IXF MESSAGES "/home/dbuser/schema.table.msg" INSERT INTO SCHEMA.TABLE




No comments:

Share on Twitter