Creating a DB System Clone

When you create a clone from an existing DB system, a new DB system is created by copying the source DB system data to the new DB system.

Cloning creates a new DB system directly from an existing source DB system instead of using a DB system backup as the source. The new DB system retains the administrator credentials of the source DB system. You can clone a source DB system in the same region or from another region, and you can optionally create a replication channel between the source DB system and the new DB system during the clone operation.

Cloning is supported from a standalone or high availability DB system, with or without a HeatWave cluster, to a new standalone or high availability DB system, with or without a HeatWave cluster. When you clone a DB system, only InnoDB data is cloned. If the source DB system has MySQL HeatWave Lakehouse enabled, the Lakehouse data is not cloned. If you add a HeatWave cluster to the cloned DB system later, the data is not loaded automatically into the HeatWave cluster, and you must load it manually.

Note

You cannot create a clone DB system that has the same IP address as a running source DB system. You can let Oracle select an unused IP address from the subnet or define a new IP address for the new DB system using the IP address field on the Networking tab of the Advanced options. See Advanced Option: Connections.
This task requires the following:
  • To create a clone DB system, you must have an existing DB system in the same tenancy and compartment that you can use as the source DB system.
  • A policy that permits you to create DB systems in the compartment or tenancy. See IAM Policies.
  • In the source DB system region, policies that permit you to read MySQL instances and configurations and create, read, and delete backups. If you create the clone DB system in a different region from the source DB system, you also need permission to copy backups in the source DB system region. See mysql-instances, mysql-configurations, and mysql-backups.
  • In the destination region, which can be the same or different from the source DB system region, policies that permit you to create, read, and delete backups. If you create a replication channel during the clone operation, you also need permission to create replication channels in the destination region. See mysql-backups and mysql-channels.
  • A properly configured VCN. See Creating a Virtual Cloud Network.
  • If you want to create a replication during the clone operation, ensure the following:
    • A replication user exists on the source DB system and that you have the required credentials available. See Creating a Replication User On a Source Server.
    • The source DB system uses a configuration wherein the binlog_expire_logs_seconds variable is set to:
      • 259200 (72 hours) source DB system and the new cloned DB system are in the same region.
      • 345600 (96 hours) source DB system and the new cloned DB system are in different regions.
    • If you use VERIFY_CA or VERIFY_IDENTITY for the replication channel, the CA X509 certificate of the source DB system.

You can use the following methods to clone an existing DB system to a new DB system in the same tenancy:

Using the Console

Use the Console to clone an existing DB system to a new DB system.

Do the following to clone an existing DB system to a new DB system:
  1. On the DB Systems list page, select the DB system that you want to work with. If you need help finding the list page or the DB system, see Listing DB Systems Using the Console.

    The Details page opens and displays information about the DB system.

  2. From the Actions menu, select Clone DB system.

    The Clone DB system page appears.

  3. Provide DB system information:
    1. Choose target region: If you want to launch the DB system in a region other than the current region, select the region for the new DB system. If you do not select a region, the current region of the source DB system is used.
    2. Create in compartment: Select the same compartment as the source DB system.
      Note

      The DB system clone must be in the same compartment as the source DB system.

      If you do not select a compartment, the current compartment is used by default.

    3. Name: (Optional) Specify a user-friendly display name for the DB system. The name does not need to be unique. An Oracle Cloud Identifier (OCID) uniquely identifies the DB system.
    4. Description: (Optional) Specify a user-friendly description of the DB system and its purpose.
  4. Select the type of DB system:
    1. Standalone: Select for a single-instance DB system.
    2. High availability: Select for a three-instance DB system that contains one primary instance and two secondary instances. If you select a regional subnet, the instances are spread across the availability domains. If you do not select a regional subnet, or your region comprises a single availability domain, the instances are spread across the fault domains. See High Availability.
  5. Replication channel: Replication is enabled by default, which means that a replication channel is created between the source DB system and the new DB system by default. However, you need to configure the replication channel. If you do not want to create a replication channel between the source DB system and the new DB system, turn the Enable replication toggle off.
    Note

    If a replication channel is created during the clone operation and the source DB system and the new cloned DB system are in different VCNs or regions, ensure that connectivity is configured between the source DB system VCN and the new cloned DB system VCN. For more information, see VCN Peering.
  6. Replication channel configuration: To configure the replication channel if replication is enabled:
    1. Select Configure Replication Channel. The Configure replication channel panel appears.
    2. Username: Specify the replication username on the source DB system.
    3. Password: Specify the replication user password on the source DB system.
    4. Applier username: (Optional) Specify a username for the replication applier on the new DB system. If you do not specify a value, the administrator account of the new DB system is used.
    5. SSL mode: Select a secure socket layer (SSL) mode for the replication channel:
      • Disabled: SSL mode disabled.
      • Required: SSL certificate required.
      • Verify certificate authority: SSL certificate required with an additional verification of the CA certificate configured on the source against the Certificate Authority (CA) certificate. This option requires you to upload your Certificate Authority's X509 certificate in the field below.
      • Verify identity: SSL certificate required with an additional verification of the CA certificate configured on the source against the Certificate Authority (CA) certificate and verification of the source's hostname defined in the source's security certificate. This option requires you to upload your Certificate Authority's X509 certificate.
    6. Certificate Authority's X509 certificate (PEM): Displayed only when the selected SSL mode requires certificate validation. Upload the CA X509 certificate of the source DB system.
    7. To save the configuration and exit the Configure replication channel panel, select Update.
  7. Configure networking:
    1. Virtual cloud network: Select the VCN in which to launch the DB system.
    2. Subnet: Select the required subnet of the selected VCN.
    3. Network security groups (NSGs): (Optional) Select to expand and configure network security groups.
      • Compartment: Select a compartment in which the network security group is configured.
      • Network security group: Select a network security group that you want to use.
      • To add multiple network security groups, select the Add network security group button to add another row. You can add up to a maximum of 5 network security groups.
  8. Configure placement:
    1. Availability domain: Select the availability domain in which to launch the DB system.
    2. Choose a fault domain: Select this option to enable you to choose a fault domain. If you do not choose a fault domain, Oracle chooses one for you. See Fault Domains.
  9. Configure hardware:
    1. Enable HeatWave cluster: Select this option if you want to enable a HeatWave cluster for the new DB system.
    2. Select a shape: Select Change shape. In the Browse all shapes panel, select the compute model and the shape that you want to use. See Supported Shapes.
    3. HeatWave cluster configuration: This option is shown when Enable HeatWave cluster is selected. If you want to change the default configuration, select Configure HeatWave cluster and define the required shape and number of nodes.
    4. Storage size: Configure the storage size of the DB system. The data storage size is independent of the shape you select.
      • Initial data storage size (GB): Specify the initial data storage size, in GB, to allocate to the DB system. The value should be greater than or equal to the size of the source DB system and less than 131072.
      • Automatic storage expansion: Enable automatic data storage expansion when space usage grows near the database instance Health Monitor read-only limits for any instance in the DB system.
      • Maximum data storage size (GB): Specify the maximum data storage size, in GB, to which the storage size can be expanded. The value must be greater than the initial data storage size.
  10. Configure backup plan: Automatic backup is enabled by default. It is recommended to keep automatic backups enabled. Specify the following to configure automatic backup:
    1. Backup retention period: (Optional) Specify how many days you want to retain the backup. By default, the DB system retains the backup for seven days.
    2. Enable point-in-time recovery: Select the option to enable you to restore a DB system at a point-in-time to a new DB system.
    3. Select backup window: Select the option to enable you to select the backup window start time. If you do not enable this option, a default window start time is chosen based on your region.
    4. Soft delete: Enable this option if you want to retain the backup in delete scheduled state for 7 days before permanently deleting it, if required.
    5. Cross-region copy: Select this option to schedule cross-region copy for automatic backups, if required.
    To disable automatic backups, turn the Enable automatic backups toggle off. If you disable automatic backups, you must manage your backups manually.
  11. MySQL Studio: Enable MySQL Studio and, optionally, specify a port number to assign to the MySQL Studio endpoint. Supported port numbers are: 443 and all port numbers from 1024 to 65535. If a port number is not specified, port number 8443 is assigned to the MySQL Studio endpoint by default. The specified port number must not be the same as the database port, database X protocol port, or the MRS port, if MRS is enabled. To learn more about MySQL Studio, see MySQL Studio Documentation.
  12. Provide contacts for operational notifications and announcements: (Optional) Enter one or more contact emails to receive operational notices and announcements as well as unplanned maintenance notifications. Select Add contact to add more contacts. You can add up to a maximum of 10 contacts. Duplicate and invalid email addresses are not allowed.
  13. Show advanced options: Select to open a group of tabs that enable you to further configure the DB system. See Advanced Options.
    The database mode is set to Read-only and the access mode to restricted (Allow administrators access only), unlike the default value when creating a new DB system from the scratch (appears under Advanced Options >Management).
  14. To create the clone DB system, select Clone.
The clone DB system is created.

Using the CLI

Use the command-line interface to clone a DB system to a new DB system.

In addition to the requirements for creating a clone DB system, this task requires the following:
  • A compartment, subnet, and source DB system Oracle Cloud Identifier (OCID).
  • The name of a shape and availability domain.
  • If you want to clone from another region, the source region identifier.
Do the following to clone a DB system:
  1. Open a command prompt and run the following:
    oci mysql db-system create
        --compartment-id=<CompartmentOCID>
        --subnet-id=<SubnetOCID>
        --availability-domain=<AvailabilityDomain>
        --shape-name=<ShapeName>
        --configuration-id=<ConfigurationOCID>
        --data-storage-size-in-gbs=<Number>
        --display-name=<DisplayName>
        --source='
        {
            "dbSystemId": "<SourceDbSystemOCID>",
            "sourceType": "DBSYSTEM",
            "region": "<SourceRegion>",
            "channel": 
            {
                "sourceUsername": "<SourceReplicationUser>",
                "sourcePassword": "<SourceReplicationPassword>",
                "sslMode": "<SslMode>",
                "sslCaCertificate": "<SourceCACertificate>",
                "applierUsername": "<ApplierUser>"
            }
        }'
    • compartment-id: Specify the OCID of the compartment in which you want the clone DB system to be created.
    • subnet-id: Specify the OCID of the VCN subnet the DB system should use.
    • availability-domain: Specify the name of the availability domain in which you want the DB system to be created.
    • shape-name: Specify the name of the shape.
    • configuration-id: (Optional) Specify the OCID of the configuration that you want to apply to the DB system. If you do not specify a configuration ID, the DB system uses the default configuration associated with the selected shape.
    • data-storage-size-in-gbs: (Optional) Specify the amount of data storage, in GB, for the DB system.
    • display-name: (Optional) Specify the display name of the DB system. If you do not define a display name, one is generated for you in the format mysqldbsystemYYYYMMDDHHMMSS.
    • source: Specify the details of the DB system from which you want to clone data.
      • dbSystemId: Specify the OCID of the source DB system.
      • sourceType: Set to DBSYSTEM for cloning from a DB system.
      • region: (Optional) Only when you want to create the clone DB system in a different region, specify the region identifier for the clone DB system.
        Note

        You must omit this attribute if you want to create the clone in the same region as the source DB system.
      • channel: (Optional) Specify the replication channel details to create a replica relationship during clone.
        • sourceUsername: Specify the replication user on the source DB system.
        • sourcePassword: Specify the password for the replication user.
        • sslMode: Specify the SSL mode for the replication channel.
        • sslCaCertificate: (Optional) Specify the CA certificate of the source DB system when the selected SSL mode requires certificate validation, such as VERIFY_CA or VERIFY_IDENTITY.
        • applierUsername: (Optional) Specify the replication applier username for the new DB system.