By Mouhamadou Diaw

Dealing these last days to database migration with a customer, I write this blog to describe the main tasks

The context is to migrate databases to a new infrastructure. Below the configuration

Source : Linux Suse in a non-multitenant architecture

Target : Oracle Enterprise Linux 8 with multitenant

The database version is Oracle 19c

Installing Oracle Binaries on the OEL

The first step is to install the Oracle binaries. You can do it by many ways. I created a Gold Image from the source server.

The advantage is that I will have the exact patch level than the source environment.

The steps are described below

1-Create the Gold Image on the source

[oracle@sourceserver ~]$ echo $ORACLE_HOME
[oracle@u027 ~]$ /u00/app/oracle/product/19.14/dbhome_1/runInstaller  -silent -createGoldImage -destinationLocation /u01/software/gold_image/rdbms19.14
Launching Oracle Database Setup Wizard...

Successfully Setup Software.
Gold Image location: /u01/software/gold_image/rdbms19.14/

2-Copy the Image to the OEL target server and unzip it to the new Oracle_Home

[oracle@targetserver ~]$ unzip -d /u00/app/oracle/product/19.14/dbhome_1 /u01/software/gold_image/rdbms19.14/

3-Launch the installation process on the target OEL server

The installation can be graphical or silent method. In my case I used the silent method with a response file

With Oracle Enterprise Linux 8, you will need to export the CV_ASSUME_DISTID  variable otherwise the install will fail

oracle@targetserver ~]$ export CV_ASSUME_DISTID=OEL7.8

[oracle@targetserver ~]$ /u00/app/oracle/product/19.14/dbhome_1/runInstaller -silent  -responseFile /u01/software/gold_image/db_1914.rsp
Launching Oracle Database Setup Wizard...

The response file for this session can be found at:

You can find the log of this install session at:

As a root user, execute the following script(s):
        1. /u00/app/oraInventory/
        2. /u00/app/oracle/product/19.14/dbhome_1/

Execute /u00/app/oraInventory/ on the following nodes:
Execute /u00/app/oracle/product/19.14/dbhome_1/ on the following nodes:

Successfully Setup Software.
Moved the install session logs to:
[oracle@targetserver ~]$ 

Then run the 2 scripts as asked

[root@targetserver ~]# /u00/app/oraInventory/
Changing permissions of /u00/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u00/app/oraInventory to oinstall.
The execution of the script is complete.
[root@targetserver ~]# /u00/app/oracle/product/19.14/dbhome_1/
Check /u00/app/oracle/product/19.14/dbhome_1/install/root_targetserver.sig-ge.ch_2023-02-06_10-02-03-988526328.log for the output of root script
[root@targetserver ~]#

4-Relink Oracle binaries (optional)

This step is optional but I recommend to do it when cloning your environment

[oracle@targetserver ~]$ export ORACLE_HOME=/u00/app/oracle/product/19.14/dbhome_1
[oracle@targetserver ~]$ cd $ORACLE_HOME/bin
[oracle@targetserver ~]$./relink as_installed

And that is all for the binaries. If you have different Oracle version, do the same

Migrating the Data to multitenant architecture

You have may options to do that, we can for example list following


-unplug and plug data

-Creating the PDB via DB Link

I used the third method, i.e using database link

1-On the target server create an empty container

I used the silent method. You will have to create your responsefile accordingly.

oracle@u027:/home/oracle/ [rdbms1914] /u00/app/oracle/product/19.14/dbhome_1/bin/dbca -silent -createDatabase -responseFile /home/oracle/dbca_1914.rsp

2-On the target server create a database link to the source database

Let’s say my source database is PROD and the port used is 1521

On the CDB$ROOT with SYS or a user with required privilege

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO


Database link created

And now test the DB Link

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO

SQL> select name from v$database@MIGLINK

3-On the source server, give following privilege to the user used in the DB Link (i.e SYSTEM)

SQL> grant create pluggable database to system;

Grant succeeded.


4-On the target server create the PDB using the DB Link

This can be done while the non-cdb database PROD is opened in Read Write mode but it is recommended to open the database in Read Only mode


Pluggable database created.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         5 PROD                           MOUNTED

Of course you can change the PDB name .

5-On the target server run the noncdb_to_pdb.sql on the newly created PDB

Connect as SYS

SQL> alter session set container=PROD;

Session altered.

SQL> show con_name;

SQL> @?/rdbms/admin/noncdb_to_pdb.sql
  8      END IF;
  9    END;
 10  END;
 11  /

PL/SQL procedure successfully completed.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         5 PROD                          MOUNTED

There should not be any error. And then you can now open you PDB in a R/W mode

SQL> alter pluggable database PROD open;

Pluggable database altered.


To automatically open the PDB the next time the instance is restarted.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         5 PROD                           READ WRITE NO

SQL> alter pluggable database all save state;

Pluggable database altered.



As you can see migrating a Non-CDB database to multitenant one is not very difficult. Read Oracle documentation and you will see many information about converting database to CDB architecture