Configure the Users and Environment

Create a migration repository user and environment where the migration metadata is stored by Oracle SQL Developer.

Create a User for the Migration

Create a user for the migration.

  1. Log into the Autonomous Database as an admin user.
  2. Create a migration repository user and password for the migration metadata and grant the user unlimited space quota for metadata.
    This example uses the user mwrep.
    SQL> CREATE USER MWREP 
    IDENTIFIED BY password 
    DEFAULT TABLESPACE DATA
    TEMPORARY TABLESPACE TEMP;
    ALTER USER MWREP QUOTA UNLIMITED on DATA;
  3. Grant permissions to the mwrep user.
    SQL> GRANT 
        CONNECT, 
        RESOURCE, 
        CREATE SESSION, 
        CREATE VIEW, 
        CREATE MATERIALIZED VIEW 
        TO mwrep;

Generate a Migration Script

Use Oracle SQL Developer Migration Workbench to generate the scripts.

  1. Create a user and password in Oracle Cloud Infrastructure.
    For example, db2migration. The purpose of this user is to store the database migration repository objects.
  2. Grant the following permissions to the user db2migration: CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM, UNLIMITED TABLESPACE TO db2migration.
  3. Open the Oracle SQL Developer Migration Workbench, then click Next.
    A Migration Wizard displays
  4. Repository: Select db2migration for the Repository connection, then click Next.
  5. Project: Enter a name for the project folder, then click Next.
    The project is a container for the migration entities, such as scripts. A folder with the project name is created under the output directory. For example, use db2 to oracle migration for a project name.
  6. Source Database: Select Online Mode and select the IBM Db2 database as the connection, then click Next.
  7. Capture: Select the database from the list of available databases, then click Next.
  8. Convert: Specify the conversion options, then click Next.
  9. Translate: Select from the list of available SQL Objects to translate, then click Next.
  10. Target Database: Select Offline Mode and select Drop Target Objects to create the migration object, then click Next.
  11. Move Data: Select Offline Mode to move the data to the migration object, then click Next.
  12. Summary: Review the summary. If correct, then click Finish.
Two folders appear under your project folder (db2 to oracle migration): datamove and generated.

Export the Data

Export the data from the IBM Db2 database.

  1. Copy the datamove folder to a directory for which the IBM Db2 database (db2inst1) has access.
  2. Run the DB2_data.sh script.
    [db2inst1@db2inst1 DB2INST1]$ pwd
    /database/DB2INST1[db2inst1@db2inst1 DB2INST1]
    $ sh DB2_data.sh dojo db2inst1 password
    The script generates the files into the /database/DB2INST1/data folder.