Prepare for Migration Using File Storage in the Cloud

Provision Oracle Database Exadata Cloud Service and Oracle Cloud Infrastructure File Storage. Then, create a data pump directory on the source database and on the target database.

Provision an Exadata DB System

Provision an Exadata DB System in an existing compartment and availability domain in an Oracle Cloud region.

The container database (CDB) or system identifier (SID) name in the cloud must be the same as the source database CDB or SID name.

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 DB System.
  3. Specify the basic information for the DB system:
    1. Select a compartment: By default, the DB system launches in your current compartment and you can use the network resources in that compartment.
    2. Name your DB System: Use a friendly display name for the DB system.
      The name doesn't need to be unique. An Oracle Cloud Identifier (OCID) will uniquely identify the DB system.
    3. Select an availability domain: The availability domain in which the DB system resides.
    4. Select the Shape Type: Select Exadata.
    5. Select a Shape: The shape determines the rack size and the resources allocated to the system.
    6. Configure the Database: Use the default settings.
    7. Configure storage: Specify storage allocation.
      The default allocation is: Percentage: 80% DATA, 20% RECO, 0% SPARSE.
      Creating a sparse disk group impacts the storage available for the ASM disk groups (DATA and RECO) and you cannot change the storage allocation configuration after you provision your DB system.
    8. Upload your SSH public key for access.
      The public key portion of each key pair you want to use for SSH access to the DB system. You can browse or drag and drop .pub files, or paste in individual public keys. To paste multiple keys, click + Another SSH Key, and supply a single key for each entry.
    9. Choose the License Type: License Included (default), or Bring Your Own License if you own Oracle Database Licenses.
  4. Specify the network information:
    1. Virtual cloud network: The VCN in which to launch the DB system. Click Change Compartment to select a VCN in a different compartment.
    2. Client subnet: The subnet to which the Exadata DB system should attach. Click Change Compartment to select a subnet in a different compartment.
      Do not use a subnet that overlaps with 192.168.16.16/28, which is used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction
    3. Backup subnet: The subnet to use for the backup network, which is typically used to transport backup information to and from Oracle Cloud Infrastructure Object Storage.
      Do not use a subnet that overlaps with 192.168.128.0/20. This restriction applies to both the client subnet and backup subnet.
    4. Network Security Groups: (Optional) You can specify one or more network security groups (NSGs) for both the client and backup networks.
      NSGs function as virtual firewalls, allowing you to apply a set of ingress and egress security rules to your DB system. A maximum of five NSGs can be specified.

      If you choose a subnet with a security list, the security rules for the DB system will be a union of the rules in the security list and the NSGs.

    5. Hostname prefix: Specify a host name for the Exadata DB system. The host name must be unique within the subnet and begin with an alphabetic character, and can contain only alphanumeric characters and hyphens (-). The maximum number of characters allowed for an Exadata DB system is 12.
    6. Host domain name: The domain name for the DB system.
      If the selected subnet uses the Oracle-provided Internet and VCN Resolver for DNS name resolution, this field displays the domain name for the subnet and it can't be changed. Otherwise, you can provide your choice of a domain name. Hyphens (-) are not permitted.If you plan to store database backups in Object Storage, Oracle recommends that you use a VCN Resolver for DNS name resolution for the client subnet because it automatically resolves the Swift endpoints used for backups.
    7. Host and domain URL: Combines the host and domain names to display the fully qualified domain name (FQDN) for the database. The maximum length is 64 characters.
  5. Click Next.
  6. Provide information for the initial database:
    1. Database name: The name for the database.
      The database name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted.
    2. Database version: Specify version 19c as the version of the initial database created on the DB system when it is launched.
      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.
      After the DB system is active, you can create additional databases on it. You can mix database versions on the DB system. Earlier database versions are supported on a 19c Exadata DB system and can be created at anytime. Exadata DB systems created with earlier Oracle Database versions will not automatically support Oracle Database 19c. The DB system must be upgraded manually.
    3. PDB name: The name of the pluggable database.
      The PDB name must begin with an alphabetic character, and can contain a maximum of 8 alphanumeric characters. The only special character permitted is the underscore ( _).
    4. Set a password for the SYS user matching the password requirements.
      The SYS password must be the same as the SYS password of the source database.
      The password must be 9 to 30 characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, #, or -. The password must not contain the username (SYS, SYSTEM, and so on) or the word "oracle" either in forward or reversed order and regardless of casing.
    5. Select workload type, either Online Transactional Processing (OLTP) or Decision Support System (DSS).
  7. Configure database backups: Specify the settings for backing up the database to Object Storage.
  8. Click Create DB System.
    After the DB system's icon turns green, with a status of Available, click the highlighted DB system name to see details about the DB system. Note the IP addresses to connect to the DB system.

Create a SQL*Net Connection Between On-Premises and the Cloud

Set up SQL*Net connectivity between the on-premises database and Oracle Database Exadata Cloud Service.

  1. Open the Console, and get the host name prefix and host domain name for the Exadata DB System.

    The host name prefix and the host domain name forms the SERVICE_NAME.

  2. Obtain the IP address or the host DNS name and DB host PORT. The port is normally 1521.
  3. Add the IP address or host DNS name and DB host port to the TNSNAMES.ora file in the source system.
    $ cat $ORACLE_HOME/network/admin/tnsnames.ora
  4. Validate connectivity against the new entries in the tnsnames.ora by either using sqlplus or tnsping.
    $ tnsping pdbname
    sh-4.2$ tnsping pdbname

Create an SCP Connection Between On-Premises and the Cloud

Upload the API signing public key to Oracle Cloud Infrastructure and create an SCP connection between the on-premises database and Oracle Cloud Infrastructure File Storage. The connection is needed to move the expdp dump file.

  1. Log into the Console and view the details for the user who will be calling the API with the key pair.
  2. If you're the signed as the user who will be calling the API with the key pair, then perform the following steps:
    1. Open the Profile menu.
    2. Click User Settings.
  3. If you're an administrator adding the key for another user, then perform the following steps:
    1. Open the navigation menu.
    2. Under Governance and Administration, go to Identity and click Users.
    3. Select the user from the list.
  4. Click Add Public Key.
  5. Paste the contents of the PEM public key in the dialog box and click Add.

Configure VCN Security List Rules for File Storage

When you create a VCN, a default security list is also created. Rules in the security list are used to allow or deny traffic to a subnet. Before you can mount a file system, you must configure security list rules to allow traffic to the mount target subnet.

File Storage requires stateful ingress to TCP ports 111, 2048, 2049, and 2050 and stateful ingress to UDP ports 111 and 2048.
  1. In the Console, expand the navigation menu. Under Core Infrastructure, click Networking, then click Virtual Cloud Networks.
  2. In the Scope section in the menu on the right, select the compartment that contains the subnet to be associated with your file system, then click the cloud network to be associated with your file system.
  3. On the details page for the cloud network, click Security Lists, and then click the security list used by the subnet to be associated with your file system.
  4. On the details page of the security list, click Edit All Rules.
  5. In the Resources menu on the left, click Ingress Rules. Click Add Ingress Rule button, then click Edit All Rules.
  6. Add an ingress rule allowing SCP traffic.
  7. ClickAdd Ingress Rules.

Create a File System and Mount Target

Provision a shared file system in the cloud using the Oracle Cloud Infrastructure File Storage service and mount target.

Network access to your file system is provided through a mount target. Exports control how NFS clients access file systems when they connect to a mount target. File systems must have at least one export in one mount target for any instance to mount and use the file system. Typically, you create your first mount target when you create your first file system.

When you use the Console to create a file system, it also creates a mount target that your compute instances use to access and write to the file system. Once a mount target is created, multiple file systems can be associated with the target.

Before creating a file system, you must have at least one Virtual Cloud Network (VCN) in a compartment and correctly configured security rules for the file system mount target. You can create security rules in the security list for the mount target subnet.
  1. In the Console, expand the navigation menu. Under Core Infrastructure, click File Storage, then click File Systems.
  2. In the left navigation, select a compartment in the List Scope section.
  3. Click Create File System.
  4. (Optional) File System Information. Click Edit Details if you want to edit the default values.
  5. (Optional) Export Information. Specify the path if you don't want to use the default export path.
  6. Mount Target Information. Click Edit Details to edit the default values.
    File systems must be associated with a mount target to be mounted by an instance. If you have one or more previously created mount targets in the availability domain, the File Storage service automatically chooses the most recently created mount target in the list. If you don't have a mount target in the selected availability domain, the File Storage service creates one using default values.
    1. Mount Target Name: File Storage service creates a default mount target name using Mount-YYYYMMDD-HHMM. Enter a name for the mount target.
    2. (Optional) Compartment. Specify the path if you don't want to use the default compartment, which is the compartment that you're currently working in.
    3. Virtual Cloud Network: Select your virtual cloud network (VCN). The default is the first VCN listed in the current compartment.
    4. (Optional) Configure Network Security Groups: Select this option to add this mount target to an NSG you've created. Choose an NSG from the list. Each mount target can belong to up to five (5) NSGs.
    5. Subnet: Select the regional public subnet for the mount target. The default is the most recently created subnet listed in the selected availability domain.
  7. Click Create.
  8. Mount the file system.
    Use the file system mount target name defined when you created the file system. For example, Mount-YYYYMMDD-HHMM.
    $ sudo yum install nfs-utils
    $ sudo mkdir –p /mnt/file system mount target name
    $ sudo mount 10.0.1.4:/file system mount target name  /mnt/file system mount target name

Create Data Pump Directories in the Source and Target Systems

Create a data pump directory in the source database pointing to the backup file for the export file and a directory in the Exadata DB System.

  1. Log into the source database system.
  2. Create a backup directory in the database that points to the backup file for the export file.
    $ create or replace directory bdir as ‘/opt/oracle/oradata/backup’
  3. Create a dpdump directory in the Oracle Database Exadata Cloud Service and set owner and permissions to opc.
    $ sqlplus system/password@pdb database name 
    $ create or replace directory dpdump as ‘/mnt/file system mount target name/dpdump’
  4. Create a sample text file and use the file to test the transfer of data from the source database to the Exadata DB System.
    $ echo test > my.txt
    $ scp -i private key my.txt opc@ip address of Exadata db system:/mnt/file system mount target name/dpdump/
  5. Use SFTP to log into the Oracle Database Exadata Cloud Service and verify that you can see the my.txt file in the /mnt/file system mount target name/dpdump/ directory.