Prepare Services in the Cloud to Accept Migrated Data

Prepare your Oracle Cloud Infrastructure account to accept migrated data by adding the source database's public key in your account, creating a storage bucket to store the data, provisioning a compatible database in your region, and copying the source database's wallet to the new database in the cloud.

Add the Public Key to Your Oracle Cloud Infrastructure Account Profile

Add the wallet public key that you created on the source database to your Oracle Cloud Infrastructure account. The public key will be used to access your Oracle Cloud Infrastructure Object Storage.

  1. Go to your Oracle Cloud Infrastructure Console and click the Profile icon.
  2. Select User Settings, Resources, then Api Keys.
  3. Click Add Public Key, then select Paste Public Key.
  4. Paste the public key text into the field. Click Add.
    This is the public key, including the header and footer statements, that you saved when you created the wallet on the source database.
  5. Make note of the fingerprint for the Public Key uploaded. You'll need it later.

Create a Bucket in Object Storage

Buckets are used to store and organize data. The bucket that you create will be the container for the data that's backed up to Oracle Cloud Infrastructure Object Storage.

  1. In the Oracle Cloud Infrastructure Console, under Core Infrastructure, click Object Storage.
  2. Select the compartment from the Compartments list on the left side of the page.
    The compartment is where you deployed the resources.
  3. Click Create Bucket.
  4. Name the bucket.
    The system generates a default bucket name that reflects the current year, month, day, and time, for example bucket-20210210-1359. When changing the default to any other bucket name, use letters, numbers, dashes, underscores, and periods. Avoid entering confidential information. For example, name the bucket atp-upload.
  5. Use the default values for the bucket attributes.
    For example, select the Standard Storage Tier. Standard is the primary, default storage tier used for storing data that requires fast and immediate access.
  6. Click Create Bucket.

Provision a Database in Oracle Cloud Infrastructure

Provision a compatible database in Oracle Cloud Infrastructure. The database can be either a bare metal or virtual machine, but the version must be at least the same version as the source database.

The container database (CDB) or system identifier (SID) name in the cloud must be the same as the source database CDB or SID name. Depending on the type of database system and the number of nodes provisioned, it can take over an hour to provision a database system.

Before you begin, the compartment must have a Virtual Cloud Network (VCN) setup with a private subnet to provision the Database System. To access the database, you must either provision a bastion host in a public subnet in the VCN (so that it has a public IP), or you'll need direct access to the private network through VPN or Oracle Cloud Infrastructure FastConnect. Create a Security List rule on the database private subnet giving access to the database port (1521) from the public subnet CIDR block.

  1. In the Oracle Cloud Infrastructure Console, click Database , then click Bare Metal, VM and Exadata.
  2. Click Create Database System.
  3. Select the Compartment where the database system will reside.
  4. Name your Database System.
  5. Select the Availability Domain.
  6. Select the Shape Type.
  7. Select the Compute Shape that matches the database requirements.
  8. Select the number of nodes for multi-core shapes.
    If selecting more than one node, the Logical Volume Manager storage option is not available.
  9. Choose Storage management option: Oracle Grid Infrastructure (OGI) or Logical Volume Manager (LVM). OGI allows management of storage spanning multiple nodes seamlessly and is recommended for resilience. Version 11g is only available when using Oracle Grid Infrastructure.
  10. Configure storage: select the amount of storage required for this database.
  11. Upload your SSH public key for access.
  12. Choose the License Type: License Included to use Universal credits, or Bring Your Own License if you own Oracle Database Licenses.
  13. Choose VCN and subnet for the database system.
  14. Choose a host name prefix.
  15. Click Next.
  16. Enter the Database Name that corresponds to the source CDB name, or the source Database SID.
    The source and target database names must match in order for the restore phase to work seamlessly.
  17. Select the database version.
    The target database version must be the same or higher than the source database version.

    The target database can be a higher patch level. If it's a higher version, then an upgrade is required before migrating.

  18. Set a password for the SYS user matching the password requirements.
  19. Click Create.

Copy the Wallet to the Target Database

Copy the wallet to the /home/oracle/ directory on the target database host by using the IP addresses to open an SSH tunnel between the bastion host and the target database host.

  1. Get the public IP address of the bastion host.
    1. In the Console, click Compute Instances.
    2. Click the bastion host. The public IP address appears in the bastion host details.
  2. Get the private IP address of the Database System node.
    For a multi-node DB System, get the IP address of the master node.
    1. In the Console, click Databases, then Bare Metal, VM and Exadata
    2. Select the Database System.
    3. On the left menu, click Nodes.
    4. Go to Private IP Address & DNS Name for the IP address or the host name in the node list.
  3. Using the IP addresses, open an SSH tunnel between the bastion host and the database host, then copy the wallet to the /home/oracle/ directory on the target database host.
    The file must be owned by the user oracle.
    #copy files over to target DB host through Bastion Host
    BASTION_IP=192.0.2.1 # public IP
    DB_HOST=10.0.1.11 # private IP
    
    scp -o ProxyCommand="ssh -W %h:%p opc@${BASTION_IP}" wallet.zip opc@${DB_HOST}:~/
    ssh -J opc@${BASTION_IP} opc@${DB_HOST} 'sudo chown oracle:oinstall wallet.zip; sudo mv wallet.zip /home/oracle/'
  4. Backup the current wallet, and install the wallet on the target database.
    mv $ORACLE_HOME/data/wallet $ORACLE_HOME/data/wallet_bck
    mkdir -p $ORACLE_HOME/data/wallet
    unzip wallet.zip -d $ORACLE_HOME/data/wallet/