Amazon deals

Showing posts with label db2 export. Show all posts
Showing posts with label db2 export. Show all posts

Monday, July 28, 2008

Moving a db2 database

You must have encountered this problem sometime while working on db2. It doesn't have a proper GUI for direct moving of a database from one system to another. Here are the detailed steps.

Step1:
Export using following command sequence

/>db2move databasename export

Commet: this generates files Export.out - ASCI info about export db2move.lst - has table info tabn.ixf - info exchange format, holds data .msg -message files tabna.nnn - large object data

/>db2look -d databasename -e -a -o outputfilename.sql

Comment: generates the sql file holding DDL data

Step2:
move all files to the target system

Step3:
Import using following command sequence

/>db2 create databasename
comment: creates the database
/>db2 -tvf sqlfile.sql
comment: structure the generated database with the sql file from the export
/>db2move databasename load

/*HURRAY DATABASE MOVED */