8 Oracle GoldenGate Classic for MySQL

8.1 Deploying Oracle GoldenGate Classic Architecture for MySQL Platforms

Using Oracle GoldenGate Classic Architecture on Marketplace, you can deploy and manage your deployment from a single location.

Here are the prerequisites which are required before deployment:

8.2 Finding Oracle GoldenGate for Non-Oracle (MySQL) within the Oracle Cloud Marketplace

The following steps help you to deploy Oracle GoldenGate for Non-Oracle (My SQL) from Oracle Cloud Marketplace:

  1. Log in to Oracle Cloud Marketplace.
  2. From the Oracle Cloud Marketplace home page, use the search box under Applications and search for the keyword GoldenGate.
  3. From the Search Results, select Oracle GoldenGate for Non-Oracle.

8.3 Launching Oracle GoldenGate Classic for Non-Oracle (MySQL)

The following steps help you to launch Oracle GoldenGate Classic for Non-Oracle (MySQL) on Oracle Cloud Marketplace:
  1. From the application page, select Get App.
  2. Select OCI Region or Log in using your OCI account login credentials.
    1. OCI Region – Select the OCI Region for which you want to install the compute node.
    2. Click Sign In.
  3. In the Sign In to the Cloud Tenant page, provide the OCI tenant details.
    You may be asked to sign in to your identity provider.
  4. On the Oracle GoldenGate for Non-Oracle (MySQL) page, find the selection box and provide the following information:
    1. Select Version – It provides a list of versions that are available in the listing. It is set to Oracle GoldenGate for Non-Oracle (MySQL) by default.
    2. Select Compartment – Specifies the compartment where the compute node will be built. It is generally the location that you have access to build the compute node.
    3. Terms of Use – This check box is selected by default. Oracle recommends to review the licenses before proceeding with the instance creation.
    4. Launch Stack – It launches the stack in the OCI environment.
  5. Fill in the required Stack information:
    • Name - Name of the Stack. It has a default name and provides a date time stamp. You can edit this detail, if required.
    • Description - Description that you provide while creating the Stack.
    • Create In Compartment – It defaults to the compartment you have selected on the Oracle GoldenGate 19c for Oracle page.
    • Tags (optional) – Tags are a convenient way to assign a tracking mechanism but are not mandatory. You can assign a tag of your choice for easy tracking. You have to assign a tag for some environments for cost analysis purposes.
    • Click Next.
  6. Fill in the required details to Configure Variables. This information is required to build the compute node for for Non-Oracle (MySQL):
    1. Name for New Resources -
      • Display Name - Display Name used to identify all new OCI resources.
      • Host DNS Name – Domain Name Service for the new compute node.
    2. Network Settings -
      • Create New Network – Select this check box, if you wish to create a new network resource.

        If you select this check box, the Create New Network wizard appears allowing you to add and edit the new network information such as:

        • Network Compartment
        • New VCN DNS Name
        • New VCN CIDR
        • New Subnet DNS Name
        • New Subnet CIDR

        If you do not select this check box, the Create New Network wizard does not appear and the compute node is created with the existing network options in the VCN.

      • Network Compartment (optional) – Compartment for new or existing network resources.
      • VCN (optional) – Existing VCN to use for the newly created instance if you are not creating a new network.
      • Subnet (optional) – Existing subnet to use for the newly created instance if you are not creating a new network. The subnet that you have selected must match the same Availability Domain set in the Instance Settings.
    3. Instance Settings -
      • Availability Domain – It specifies the availability domain for the newly created Oracle GoldenGate Instance. It must match the Subnet that you have selected in the Use Existing Network settings.
      • Compute Shape – Shape of new compute instance. Supported shapes are VM.Standard2.4, VM.Standard2.8, VM.Standard2.16, VM.Standard2.24
      • Assign Public IP – Indicates if the new VM should have a public IP address.
      • Custom Volume Sizes – Use this checkbox to customize the size of new block storage volumes.
    4. SSH Public Key - Public Key for allowing SSH access as the ‘opc’ user.
  7. Click Next.
  8. On the Review page, review the information you provided then click Create.
  9. After clicking Create, you will be taken to the Stacks page. You can monitor the creation of the compute node using this page.
  10. Upon completion, you can view the Oracle GoldenGate for Non-Oracle (MySQL) compute node under Compute -> Instances.

8.4 Connecting to Oracle GoldenGate Classic for Non-Oracle (My SQL) Compute Node

To access your new Oracle GoldenGate deployment, log in to the compute node and access Oracle GoldenGate Software Command Interface (GGSCI). For this, you need to identify the public IP address of the compute node where Oracle GoldenGate Classic for Non-Oracle (My SQL) is running. The following steps help you to identify the public IP address:
  1. Log in to your Oracle Cloud Console.
  2. Select Compute -> Instances.
  3. Select the hyperlink name of the compute node. The public IP Address is listed under Primary VNIC Information.
  4. To access the compute node where Oracle GoldenGate is running, connect as the opc account using SSH. For more information on how to access a node using the opc account refer to Connecting to an Instance.
A public SSH key is specified as a part of the deployment process and you can use the private key when you are connecting to the Oracle GoldenGate instance. The following example illustrates how you connect to the Oracle GoldenGate compute node:
ssh -i <private-key-filename> opc@<public-id-address>

8.5 Working with Oracle GoldenGate Classic for Non-Oracle (MySQL)

After deploying Oracle GoldenGate Classic for Non-Oracle (My SQL) on Oracle Cloud Marketplace, you can access the latest release of Oracle GoldenGate Classic for Non-Oracle (My SQL).

Before you can start using Oracle GoldenGate Classic for Non-Oracle (My SQL), there are a few tasks that you must perform to ensure that your environment is complete and ready to replicate your data.

Before you begin data replication, you must perform the following tasks:

Topics:

8.5.1 Establishing Connectivity

The Oracle GoldenGate Classic for Non-Oracle (My SQL) on Oracle Cloud Marketplace compute node acts as a hub where you can manage your connections to source and target My SQL databases. To establish connectivity from an Oracle GoldenGate Classic for Non-Oracle (My SQL) compute node to your on-premises My SQL database, use the following options:

  • IPSec VPN
  • FastConnect

For establishing an IPSec VPN with OCI, refer to IPSec VPN documentation. For establishing a FastConnect connection, refer to the FastConnect documentation.

8.5.2 Oracle GoldenGate for MySQL Requirements

Before you can begin replicating data, for a MySQL database, review the instance, database and user requirements available in Installing Oracle GoldenGate for MySQL chapter of Installing Oracle GoldenGate Guide and Understanding What's Supported for MySQL chapter of Using Oracle GoldenGate for Heterogeneous Databases. These sections contain important information regarding database requirements and supported features.

8.5.3 Configure Source MySQL Database for Remote Capture

To support remote capture for MySQL database, configure the MySQL database as follows:
  1. Create and grant access permissions to an Oracle GoldenGate remote capture user.

    Execute the following statements in a remote database to create a user and grant the required permissions for remote capture. The following example provides high level privileges for the created remote capture user :

    mysql > CREATE USER 'sourceuser'@'dbhostname' IDENTIFIED BY 'password'; 
    mysql > GRANT ALL PRIVILEGES ON *.* TO 'sourceuser'@'dbhostname'; 
    mysql > FLUSH PRIVILEGES;

    To know more about user permission requirements, refer to Database User for Oracle GoldenGate Processes for MySQL chapter of the Using Oracle GoldenGate for Heterogeneous Databases guide.

  2. The server_id value of the remote MySQL server should be greater than 0. You can verify this value by executing the following statement on the MySQL remote server:
    mysql > show variables like 'server_id';

    If the server_id value is 0, modify the my.cnf configuration file to set it to a value greater than 0.

8.5.4 Configure Target MySQL Database for Remote Apply

To support remote delivery for MySQL database, create a remote apply user for the Oracle GoldenGate Replicat:

Create and grant access permissions to an Oracle GoldenGate remote apply user. Execute the following statements in a remote database to create a user and grant the required permissions for remote apply. The following example provides high level privileges for the created remote apply user :

mysql > CREATE USER 'targetuser'@'dbhostname' IDENTIFIED BY 'password'; 
mysql > GRANT ALL PRIVILEGES ON *.* TO 'targetuser'@'dbhostname'; 
mysql > FLUSH PRIVILEGES;

To know more about user permission requirements, refer to Database User for Oracle GoldenGate Processes for MySQL chapter of the Using Oracle GoldenGate for Heterogeneous Databases guide.

8.5.5 Starting GGSCI

Oracle GoldenGate Classic for Non-Oracle (MySQL) allows you to quickly access the GoldenGate Service Command Interface (GGCSI) and is preconfigured with a running Manager process. After logging in to the compute node, you can find GGCSI from the mysql directory (/home/opc/mysql).
To start GGSCI, execute the following command:
$ cd mysql
$ ./ggsci

8.5.6 Configuring and Creating a Remote Extract for MySQL

To capture transactional data from a source MySQL database, you must configure a capture process, also known as an Extract. To build an Extract, you can perform the following steps with Oracle GoldenGate for Non-Oracle.
  1. Create an Extract parameter file.
    
    GGSCI> EDIT PARAMS extmysql

    Sample Extract parameter file:

    EXTRACT extmysql
    SOURCEDB sourcedb@dbhostname:port, USERIDALIAS name
    TRANLOGOPTIONS ALTLOGDEST REMOTE
    EXTTRAIL ./dirdat/et
    TABLE sourcedb.*;

    Save and close the file.

  2. Add the Extract and Extract’s local trail.

    Note:

    While adding the Extract with the BEGIN NOW option, ensure to check if, both the database server and the server running Oracle GoldenGate have the same system time.
    
    GGSCI> ADD EXTRACT extmysql, TRANLOG, BEGIN NOW
    GGSCI> ADD EXTTRAIL ./dirdat/et, EXTRACT extmysql
  3. Verify the connectivity to MySQL source database and start the Extract.
    GGSCI> DBLOGIN SOURCEDB sourcedb@dbhostname:port USERIDALIAS name
    GGSCI> START EXTRACT extmysql

8.5.7 Configuring and Creating a Remote Replicat for MySQL

The apply process for replication, also known as Replicat, is used to deliver data to a target database. To build a Replicat, perform the following steps with Oracle GoldenGate for Non-Oracle.
  1. From GGSCI, log in to the target database and create a checkpoint table.
    GGSCI> DBLOGIN targetdb@dbhostname:port, USERIDALIAS name
    GGSCI> ADD CHECKPOINTTABLE targetdb.ggcheck
  2. Create a Replicat parameter file.
    GGSCI > EDIT PARAMS repsql

    Sample Replicat parameter file:

    REPLICAT repmysql
    TARGETDB targetdb@dbhostname:port, USERIDALIAS name
    MAP sourcedb.table1, TARGET targetdb.table1;
    MAP sourcedb.table2, TARGET targetdb.table2;

    Save and close the file.

  3. Add and start the Replicat.
    GGSCI> ADD REPLICAT repmysql, EXTTRAIL ./dirdat/et, CHECKPOINTTABLE targetdb.ggcheck
    GGSCI> START REPLICAT repmysql