Oracle Cloud Infrastructure Documentation

Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud

Note

This topic is not applicable to Exadata DB systems.

You can migrate an on-premises database to Oracle Cloud Infrastructure by creating a backup of your on-premises database in Oracle Cloud Infrastructure's Database service. This backup is called a standalone backup because it is independent of any existing cloud-based databases you might have in Oracle Cloud Infrastructure.

Oracle provides a Python script to create a standalone backup of your database. The script invokes an API call to create the backup and then places the backup in Oracle Cloud Infrastructure. You can then use the Console or the API to create a new database or DB system from that standalone backup.

The Python script is bundled as a part of the Oracle Cloud Infrastructure CLI installation. Oracle provides the migration script and associated files at no cost. Normal Object Storage charges apply for the storage of your backup in Oracle Cloud Infrastructure.

Compatibility

The scripted migration process is compatible with the following bare metal and virtual machine DB system configurations:

Configuration Version or Type Notes
Database Version

18.x

12.2.0.1

12.1.0.2

11.2.0.4

  • For versions 18c, 12.2.0.1, and 12.1.0.2:
    • Only Container Databases (CDBs) are supported. The scripted migration process may work with non-CDB databases for these database versions, but Oracle does not provide support for the migration of non-CDB databases using the script described in this topic.

      For information on creating an on-premises pluggable database (PDB) by cloning a non-CDB in Oracle Database 18c, see About Cloning a Non-CDB. For an overview of multitenant architecture in Oracle Database 18c, see Introduction to the Multitenant Architecture.

      For information on creating an on-premises pluggable database (PDB) from a non-CDB database in Oracle Database 12c Release 2 (12.2), see Upgrading a Non-CDB Oracle Database To a PDB on a CDB. For an overview of multitenant architecture in 12c Release 2, see Overview of Managing a Multitenant Environment.

    • The Oracle Cloud Infrastructure Database service will attempt to run datapatch, which requires read/write mode. If there are pluggable databases (PDBs), they should also be in read/write mode to ensure that datapatch runs on them.
  • For version 11.2.0.4, depending on the source database patch level, you may need to roll back patches prior to migrating. See Rolling Back Patches on a Version 11.2 Database for more information.
  • If your on-premises database has an interim patch (previous known as a one-off patch), see Applying Interim Patches for details on applying the patch in Oracle Cloud Infrastructure.
Source Database Platform

Oracle Enterprise Linux / Red Hat Enterprise Linux 5.x

Oracle Linux / Red Hat Enterprise Linux 6.x

Oracle Linux / Red Hat Enterprise 7.x

  • The scripted migration described in this topic may work in Microsoft Windows environments, but Oracle currently does not provide support for this script in Windows.
  • For Oracle Linux 6.x users, see Configuring Oracle Linux 6 to install Python for details on configuring the operating system to install a compatible version of Python. See Installing the CLI for more information regarding Oracle Linux 6.
Encryption

TDE

Non-TDE

  • In a non-TDE configuration, the RMAN encryption password is required.
  • Unencrypted on-premises databases remain unencrypted when restored to Oracle Cloud Infrastructure. The stored RMAN standalone backups are always encrypted.
Target Database Edition

Standard Edition

Enterprise Edition

Enterprise Edition - High Performance

Enterprise Edition - Extreme Performance

 
Cluster

Single

RAC

 

Prerequisites

On the source database host:

  • Outbound internet connectivity for installing Python packages, running yum install, and access to the Oracle Cloud Infrastructure API and Object Storage.
  • RMAN configuration to autobackup controlfile and spfile:

    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

    Note

    RMAN configuration changes must be completed prior to running the script. The script may modify RMAN parameters as required to complete the backup and migration tasks.

To Migrate an On-Premises Database Using a Standalone Backup

Perform the following tasks on the source database host:

  1. Create a directory named /home/oracle/migrate.

    Tip

    You can name the migrate portion of the directory path anything you want. If you use a different name, you must adjust all of the paths that appear in this task accordingly. The following examples assume the name migrate for simplicity and clarity.

  2. As root, run the CLI installer in the directory you created in step 1. (For example, /home/oracle/migrate.) See Installing the CLI: Windows for instructions on running the installer script in Windows. See Installing the CLI: MacOS, Linux, and Unix for instructions on running the installer script in the Bash environment.

    The installer installs Python 3.6.0 if either Python 2.7 or Python 3.6 does not exist on the machine. The installer also installs the Python script required to create and migrate a standalone backup from an on-premises database.

    On Oracle Linux 6, a newer version of Python (such as Python 3.6.0) is usually required. Use the following instructions to configure Oracle Linux 6 before running the backup script.

    Configuring Oracle Linux 6 to install Python
  3. Copy the following files into the new directory:

  4. Respond to the prompts as follows:

    (yum install)
    Is this ok [y/N]: y
    
    ===> Missing native dependencies. Continue and install the following dependencies: gcc, libffi-devel, python36u-devel, openssl-devel? (Y/n): Y
    
    ===> In what directory would you like to place the install? (leave blank to use '/root/lib/oracle-cli'): /home/oracle/migrate/lib/oracle-cli
    
    ===> In what directory would you like to place the 'oci' executable? (leave blank to use '/root/bin'): /home/oracle/migrate/bin
    
    ===> In what directory would you like to place the OCI scripts? (leave blank to use '/root/bin/oci-cli-scripts'): /home/oracle/migrate/bin/oci-cli-scripts
    
    ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): Y
    
    ===> Enter a path to an rc file to update (leave blank to use '/root/.bashrc'): /home/oracle/.bashrc
  5. Perform the following file operations:

    # chown -R oracle:oinstall /home/oracle/migrate
  6. Edit the /home/oracle/migrate/config.txt file

    [DEFAULT]
    tenancy=<your_tenancy_OCID>
    user=<your_user_OCID>
    fingerprint=<fingerprint>
    key_file=/home/oracle/migrate/<your_api_key>.pem
    region=<region>

    If you do not know your API signing key's fingerprint, see How to Get the Key's Fingerprint.

  7. As oracle user (not root), run one of the following sets of commands, depending on the type of database you are migrating.

    For a non-TDE database:

    export AD=<destination_availability_domain>
    export C=<destination_compartment_OCID>
    export ORACLE_SID=<ORACLE_SID>
    export ORACLE_HOME=<ORACLE_HOME>
    export PATH=$PATH:$ORACLE_HOME/bin
    export LC_ALL=en_US.UTF-8
    export ORACLE_UNQNAME=<source_DB_unique_name>
    rm -rf /home/oracle/migrate/onprem_upload
    cd /home/oracle/migrate/bin/oci-cli-scripts/
    ./create_backup_from_onprem --config-file /home/oracle/migrate/config.txt --display-name <example_display_name> --availability-domain $AD --edition ENTERPRISE_EDITION_EXTREME_PERFORMANCE --opc-installer-dir /home/oracle/migrate --tmp-dir /home/oracle/migrate/onprem_upload --compartment-id $C --rman-password <password>

    For a TDE-enabled database:

    export AD=<destination_availability_domain>
    export C=<destination_compartment_OCID>
    export ORACLE_SID=<ORACLE_SID>
    export ORACLE_HOME=<ORACLE_HOME>
    export PATH=$PATH:$ORACLE_HOME/bin
    rm -rf /home/oracle/migrate/onprem_upload
    cd /home/oracle/migrate/bin/oci-cli-scripts/
    ./create_backup_from_onprem --config-file /home/oracle/migrate/config.txt --display-name <example_display_name> --availability-domain $AD --edition ENTERPRISE_EDITION_EXTREME_PERFORMANCE --opc-installer-dir /home/oracle/migrate --tmp-dir /home/oracle/migrate/onprem_upload --compartment-id $C

    See the following list of parameters used by the script for more details.

    Parameters used by the script

    The script will produce a standalone backup of your on-premises database in your Oracle Cloud Infrastructure tenancy. You can check the Console for your backup by viewing the Standalone Backups page in the Database service, under Bare Metal, VM, and Exadata.

    Tip

    To access command line help for the backup script, run the following command in the /home/oracle/migrate/bin/oci-cli-scripts/ directory:
    create_backup_from_onprem --help

  8. Create a new database or launch a new DB system using the standalone backup you created in the preceding step. See the following instructions to perform these tasks: