Amazon deals

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 */

4 comments:

  1. I find it incomplete. I think in last you can add a single line about set integrity and link it to another post where set integrity will be explained.

    ReplyDelete
  2. Dear nits,

    The above details suffice the requirements to move a db2 database across systems under normal conditions.

    ReplyDelete
  3. Thank you very much for this instruction. Simple description as I like. It was very helpful.

    ReplyDelete
  4. Wonderful site you have here but I was wanting to know if you
    knew of any user discussion forums that cover the same topics discussed here?

    I'd really love to be a part of group where I can get comments from other experienced people that share the same interest. If you have any suggestions, please let me know. Appreciate it!

    ReplyDelete