Creating a Read Replica

Create one or more read replicas on an active DB system.

Use the Console, a command-line interface, or the REST API to create a read replica.

Using the Console

Use the Console to create a read replica of a DB system.

This task requires the following:
  • A running DB system.
Do the following to create a read replica:
  1. On the DB systems list page, select the DB system that you want to create a read replica for. If you need help finding the list page or the DB system, see Listing DB Systems - Using the Console.
  2. On the details page, select the Read replicas tab or resource and then select Create read replica.
  3. In the Create read replica panel, enter the following information:
    • Create in compartment: The compartment in which the DB system is created. If you start from the Overview page, you can change the compartment.
    • Name: Specify the name of the read replica. If you do not define a name, MySQL HeatWave Service generates one for you in the format, MysqlReadReplicaDateTime.
    • Description: (Optional) Specify a description of the read replica.
    • DB system: The DB system from which the read replica will be created. If you start from the Overview page, select Select DB system to choose a DB system that resides in the compartment.
      Note

      If the DB system is created in another compartment, you can change the compartment in the Create in compartment field.
    • Shape: (Optional) Select Select shape to override and change the shape of the read replica. You can select any shape with at least 8 ECPUs or 4 OCPUs. By default, a read replica inherits the shape of the DB system. See Supported Shapes.
      Note

      If the DB system has a shape with less than 8 ECPUs or 4 OCPUs, you must override the read replica shape.
    • Configuration:
      • Select a configuration: (Optional) Select Select Configuration to override and change the configuration of the read replica shape.
        Note

        If you changed the shape of the read replica, you must select a configuration that matches the shape.
      • MySQL version: By default, a read replica inherits the version of its associated DB system. You can select a higher version to override the version of the read replica. See MySQL Server Versions.
    • Network security groups: (Optional) Select to enable overriding the network security groups of the DB system. When enabled, do the following to select network security groups that you want to use with this read replica:
      • 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 Another network security group button to add another row.
        Note

        You can add up to a maximum of 5 network security groups.
    • Deletion plan: (Optional) Enable Delete protected box to protect the read replica and its associated DB system against delete operations. By default, read replicas and DB systems are not delete protected. If you want to delete either the read replica or its associated DB system, Delete protected must be disabled.
      Note

      The delete protected setting applies to individual read replica. If a read replica is delete protected, the DB system cannot be deleted.
    • Tags: Use the tab to organize and track resources in the tenancy:
      • Tag namespace: Select the tag name.
      • Tag key: Select the tag key.
      • Tag value: Specify a value for the tag.
      • Add tag: Select this option to add more tags
  4. Select Create read replica.
A read replica is created.

Using the CLI

Use the command-line interface to create a read replica for a DB system.

This task requires the following:
  • The OCID of a DB system.
  • A policy that permits you to create read replicas in the compartment or tenancy.
  • A properly configured CLI installation and the requisite SSH keys. See Command Line Interface.
Do the following on the CLI to create a read replica for a DB system:
  1. Open a command prompt, and run the following command:
    oci mysql replica create 
         --db-system-id <DBSystemOCID> 
         --display-name <DisplayName>
         --description <Description>
         --is-delete-protected <Boolean>
         --replica-overrides '{ "configurationId": "<ConfigurationOCID>",
                                "mysqlVersion": "<Version>",
                                "nsgIds": [
                                  "<NSG_OCID>", ...
                                ],
                                "shapeName": "<ShapeName>"
                              }'
    
    • db-system-id: Specify the OCID of a DB system.

    • display-name: (Optional) Specify a display name for the read replica. If you do not define a display name, a default name in the format mysqlreadreplicaYYYYMMDDHHmmss is used.
    • description: (Optional) Specify a description for the read replica.
    • is-delete-protected: (Optional) Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow.
    • replica-overrides: (Optional) Specify a list of settings of the read replica which overrides the DB system settings. If you do not define any replica overrides, the read replica inherits the settings of the DB system.
      • configurationId: The OCID of a configuration to use.
      • mysqlVersion: The database version to use.
        Note

        The version of the read replica must be the same or higher than the version of the DB system.
      • nsgIds: A list of network security group OCIDs to use.
      • shapeName: A shape name to use.
MySQL HeatWave Service creates a read replica.