Thursday, 4 May 2017

Database Migration Assistant for Unicode (DMU) in Oracle Database 12c

The Database Migration Assistant for Unicode (DMU) is listed as a 12c new feature, but it is actually a separate tool that supports a number of different database versions.

  • Download


Version 1.2 of the DMU is shipped with the 12c database. You can see it by running the following commands.

$ cd $ORACLE_HOME/dmu
$ sh dmu.sh
Oracle recommend you always download the latest release before starting a migration. At the time of writing, version 2.0 is available at OTN.


Once you've downloaded it, it can be unzipped and run from anywhere, but I prefer to unzip it under a new directory in the ORACLE_HOME.

$ mkdir $ORACLE_HOME/dmu-2.0
$ cd $ORACLE_HOME/dmu-2.0
$ unzip /tmp/dmu-2.0.zip

  • Prepare


Make sure the SYS.DBMS_DUMA_INTERNAL package is installed.

$ sqlplus / as sysdba

SQL> @?/rdbms/admin/prvtdumi.plb

Library created.

Package created.

No errors.

Package body created.

No errors.
SQL>

It's a good idea to create a separate tablespace for the repository, rather than using the SYSAUX tablespace.

SQL> CREATE TABLESPACE unicode_repo DATAFILE SIZE 100M AUTOEXTEND ON NEXT 10M;

If you are running against a database version prior to 11.2.0.3, you will probably need to patch your database

  • Migrate


We are now ready to start the migration.

$ export JAVA_HOME=$ORACLE_HOME/jdk
$ cd $ORACLE_HOME/dmu-2.0/dmu
$ sh dmu.sh

Right-click on the "Databases" node in the Navigator pane and select the "New Database Connection" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Enter the connection details and click the "Test Connection" button. Once you get a successful test, click the "Save" button to return to the previous screen.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

When you return to the previous screen, expand the new connection node in the tree to start the Repository Configuration Wizard. Accept the "Install the repository in migration mode" option by clicking the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Accept the "ALT32UTF8" option by clicking the "Next" button

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Select the tablespace to hold the repository, then click the "Finish" button. Wait for the repository to be created, then click the "OK" button on the subsequent message box.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Right-click on the database connection and select the "Scan Database" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Next" button

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Alter any parameters as required, then click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Select the objects to scan, then click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Check the scan details, then click the "Finish" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Wait while the scan takes place. Once complete, click the "OK" button on the message box.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Right-click on the database connection and select the "Database Scan Report" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Check the report for possible problems.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Right-click on the database connection and select the "Bulk Cleansing" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Accept the "Migrate to character length semantics" option by clicking the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Decide if you want column changes to happen immediately, or during the conversion. Click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Select the objects to be converted, then click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Finish" button. Wait for the bulk cleansing to complete, then click the "OK" button on the resulting message box.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Check the results of the bulk cleansing.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Right-click on the database connection and select the "Convert Database" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Convert" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Yes" button to start the conversion.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

The conversion will initiate the Scan Wizard again. Accept all the defaults by clicking the "Next" and "Finish" buttons where appropriate. Once the "Finish" button is clicked, the conversion will start. Wait for it to complete, then click the "OK" button on the final message box. You are presented with a screen showing you the outcome of the conversion.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

The Migration Status tab also shows the conversion is complete.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Right-click on the database connection and select the "Configure DMU Repository" option from the popup menu.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Select the "uninstall the repository" option and click the "Next" button.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Click the "Finish" button. Once complete, click on the "OK" button on the message box.

DMU, Oracle Database Tutorials, Oracle Database Certifications, Oracle Database Guide

Exit the Database Migration Assistant for Unicode (DMU) using the "File > Exit" menu option.

The conversion is complete.

  • Tidy Up


If you created a new tablespace for the migration, you can drop it now.

sqlplus / as sysdba

SQL> DROP TABLESPACE unicode_repo INCLUDING CONTENTS AND DATAFILES;