how to copy a db2 database over to another machine ?

Posted on 2007-10-01
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

    what do you mean by remove OrigDB ?
    can you post here the exact output you recieve ?
    LVL 45

    Accepted Solution

    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

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    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…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now