Oracle by Example brandingMigrate an On-Premises Oracle Database to Database Cloud Service

section 0Before You Begin

This tutorial shows you how to migrate an Oracle database to a database in Oracle Database Cloud Service. You first back up the Oracle database to a Cloud storage container by using Database Backup Cloud Service. You then use the backup to create a new Database Cloud Service database deployment. This tutorial takes approximately 30 minutes to complete.

Background

Oracle Database Cloud Service provides you the ability to deploy Oracle databases in the Cloud, with each database deployment containing a single Oracle database. You have full access to the features and operations available with Oracle Database, but with Oracle providing the computing power, physical storage and (optionally) tooling to simplify routine database maintenance and management operations.

Oracle Database Backup Cloud Service is a secure, scalable, on-demand storage solution for backing up Oracle databases to Oracle Cloud. You can also use the backup to create an Oracle Database Cloud Service database deployment.

What Do You Need?

  • A supported Oracle Database version and operating system. See Supported Databases and Operating Systems.
  • An Oracle Database Backup Cloud Service account and storage capacity.
  • An Oracle Database Cloud Service account.
  • Install the Oracle Database Cloud Backup Module on your server before starting this tutorial.

section 1Configure RMAN Settings

  1. Log in to Recovery Manager (RMAN).
    [oracle@host01 opc]$ rman target /
    Recovery Manager: Release 12.1.0.2.0 - Production on Fri Sep 8 19:06:05 2017
    Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: ORCL (DBID=1481873977)

    Be sure to note the value of DBID because you will need it when you create your Database Cloud Service database deployment.

  2. Configure RMAN for a backup to the cloud as shown in this example. When you installed the Database Cloud Backup Module, the opcorcl.ora file was created in the $ORACLE_HOME/dbs directory.
    RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt
    PARMS='SBT_LIBRARY=/u01/app/oracle/product/12.1.0/dbhome_1/lib/libopc.so,
    SBT_PARMS=(OPC_PFILE=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/opcorcl.ora)';
  3. Verify that autobackup of the control file and server parameter file (SPFILE) is configured.
    RMAN> show controlfile autobackup;
    RMAN configuration parameters for database with db_unique_name ORCL are:
    CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
    
  4. If autobackup is not configured, then configure it.
    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

section 2Configure Backup Compression

You can optionally use compression when backing up Oracle databases to Oracle Database Backup Cloud Service. Compression conserves bandwidth by reducing the size of your backups before they are sent to the cloud.

If you have the Oracle Advanced Compression option, Recovery Manager (RMAN) supports binary compression using one of the following compression levels: HIGH, MEDIUM, BASIC, and LOW. The recommended level for cloud backups is MEDIUM.

  1. If you have the Oracle Advanced Compression option, configure MEDIUM level compression
    RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
  2. If you do not have the Oracle Advanced Compression option, configure default compression.
    RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC';
  3. Configure RMAN to create compressed backup sets by default on the SBT device type.
    RMAN> CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;

section 3Back Up the Database

A default storage container is created automatically when you install the Oracle Database Cloud Backup Module, and backups are stored as objects in this default container.

  1. Log in to RMAN if you are not logged in.
  2. Set the encryption password as shown in this example:
    RMAN> SET ENCRYPTION ON IDENTIFIED BY 'my_pswd' ONLY;
  3. Create a backup of the entire database:
    RMAN> BACKUP DEVICE TYPE sbt DATABASE PLUS ARCHIVELOG;
  4. After the backup completes, log out of RMAN.

section 4View the Backup

  1. Sign in to Oracle Cloud.
  2. Expand the navigation menu on the Dashboard page.
  3. Click Storage to open the service console.
  4. On the Containers tab you can view the container that was created when you backed up the database, as shown in this example:
    Description of the illustration Storage_ContainerList.png
  5. Return to the My Services Dashboard.

section 5Create a Database Deployment

  1. Expand the navigation menu on the Oracle Cloud My Services Dashboard and select Database.
    Description of the illustration MyServices_Menu_Database.png
  2. Click Create Service.
    Description of the illustration DBCS_ServiceConsole.png
  3. The Create Service wizard starts and the Service page is displayed. On the Service page, provide a name and description for the database deployment, and provide information about its high-level characteristics. For Software Release, be sure to select the same Oracle Database release that your on-premises system is using.
    Description of the illustration Service.png
  4. Click Next to advance to the Service Details page.
  5. On the Service Details page, complete the Database Configuration section by providing information about the Oracle Database you want to create.
    Description of the illustration ServiceDetails_DBConfig.png
  6. Click Edit for the SSH Public Key field. Select Create a New Key and click Enter.
    Description of the illustration SSHPublicKey.png
  7. Click Download to download the SSH key pair zip file.
  8. Select Save File and click OK.
  9. Select a location to store the zip file and click Save.
  10. Click Done after you’ve downloaded the zip file.
  11. You can see the SSH Public Key field has been filled in with the generated key value.
    Description of the illustration SSHKey_Value.png
  12. On the Service Details page, complete the Backup and Recovery Configuration section, choosing a backup option for the database deployment and, depending on your choice, providing information about the Oracle Storage Cloud Service container where cloud backups are to be stored. If you choose to back up to Cloud storage, then you must specify a Cloud Storage Container name, and the username and password of your Oracle Cloud account. If the container does not exist, select Create Cloud Storage Container.
    Description of the illustration ServiceDetails_BackupRec.png
  13. On the Service Details page, Select Yes in the Create Instance from Existing Backup menu.
  14. Click OK for the informational message about storage.
  15. Enter the Database ID of your on-premises database and click Edit.
    Description of the illustration InitFromBackup.png
  16. Select Paste RMAN Key Value and enter the password you specified when you created the backup. Click Enter.
    Description of the illustration Decryption.png
  17. Enter the name of the Cloud Storage container where your on-premises backup is stored. Enter the Cloud account username and password.
    Description of the illustration InitFromBackup_Complete.png
  18. Click Next to advance to the Confirmation page.
  19. On the Confirmation page, review the information listed. Notice that the Cloud Storage container for backups was created. If you are satisfied with the information, click Create.
    Description of the illustration Confirm.png
  20. You receive a message that the service creation request was accepted and the creation begins.
    Description of the illustration CreatingService.png
  21. You can monitor the database deployment creation by click the refresh icon. You may see a status of “Service Maintenance.” This is normal for a database deployment that is created from an existing backup.
    Description of the illustration CreatingService_Maint.png
  22. After the database deployment is created, you can begin administering your database in Oracle Database Cloud Service.

more informationWant to Learn More?