how to copy a db2 database over to another machine ?

Posted on 2007-10-01
Medium Priority
Last Modified: 2011-10-03
I have windows machine with a db2 database (let's say database name is "OrgiDB"), i need to duplicate a schema (let's say schema name is "OrgiSchema") over to AIX machine. This AIX machine already has db2 in it. I used the db2move command using the COPY mode as the following :

db2move OrgiDB COPY -sn OrgiSchema -u OrgiSchema -p OrgiSchema -co TARGET_DB CopiedDB USER CopiedSchema USING CopiedSchema SCHEMA_MAP ((OrgiSchema,CopiedSchema))

But it is not working well. I managed to copy the DDL (i.e table, trigger, seq , etc ) over , however it is load the data not using from the windows machine, but from the AIX machine. It so happens that i have another schema in the AIX machine using a same database name ( i.e. database name is "Diff" and has an existing schema "OrgiSchema" ). I decided to remove the OrgiDB database and now it is giving me a lot of problems. One of it is that it is complaining it can find OrgiDB on the AIX machine ....

Can anyone help me with this ? I need a full solution with instrution also on increase heap size (i.e. MON and AP etc ..).

Question by:byte5115
LVL 37

Expert Comment

ID: 19997420
what do you mean by remove OrigDB ?
can you post here the exact output you recieve ?
LVL 46

Accepted Solution

Kent Olsen earned 500 total points
ID: 19997677
Hi byte5115,

Let's start with a status update.  Is the database on the original (Windows) machine still good?  If so it's pretty easy.

Things are going to be a little different depending on whether the AIX system is running UDB 8 or 9, but not much.

Run the following command on both Windows and AIX:

  db2 get dbm config

Near the top of each listing will be a line that indicates whether the Federated environment is enabled.

  Federated Database System Support           (FEDERATED) = YES

Make sure that they are both set to 'YES'.  If not, run the following command:

  db2 update dbm cfg using (FEDERATED YES)

You'll also need to do a db2stop / db2start on the system where the FEDERATED flag is changed.

Now the good part.  :)

Bring up Control Center.  

Work down the objects until you get to "your" database.  One of the items will be 'Federated database Objects'.  Click it.

Click on Create New Wrapper and follow the directions.  It's self explanatory.

When that completes, click on the wrapper (in the left frame) and then open the folder 'Server Definitions' underneath the wrapper name.

On the right frame will be a link to 'Create New Server Definition'.  Click that link and follow the directions.

Now click on the server definition on the left frame to open it.  Underneath it is a folder 'User Mappings'.  Click it.

On the right frame will be a link to 'Create New User Mappings'.  Click that link and follow the directions.

You've now federated your Windows DB2 database to the AIX DB2 database.  You can access both databases from DB2 so that you can simply create the schema and tables in the Windows database and load the data into AIX.

Good Luck,

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question