Go to main content

Oracle® Solaris Cluster Data Replication Guide for Oracle GoldenGate

Exit Print View

Updated: June 2021
 
 

Preparing the MySQL Database for Oracle GoldenGate

Follow the instructions in this section to prepare the MySQL database for Oracle GoldenGate Usage on both clusters.

  1. On cluster nyc, add the following information to the my.cnf configuration file:

    log-bin=/mys/data/logs/bin-log
      
    # additional Oracle GoldenGate requirements
    log-bin-index=/mys/data/logs/bin-log.index
    max_binlog_size=4096
    binlog-format=ROW
    
    # for active-active configurations, set auto-increment
    auto-increment-increment=2
    auto-increment-offset=1
    
    # additional Oracle GoldenGate requirements end
    
  2. Restart the MySQL server.

    pnycb# clrs disable mys-rs
    pnycb# clrs enable mys-rs
  3. On cluster sfo, add the following information to the my.cnf configuration file.

    log-bin=/mys/data/logs/bin-log
      
    # Additional Oracle GoldenGate requirements
    log-bin-index=/mys/data/logs/bin-log.index
    max_binlog_size=4096
    binlog-format=ROW
    
    # For active-active configurations, set auto-increment
    auto-increment-increment=2
    auto-increment-offset=2
    
    # Additional Oracle GoldenGate requirements end
  4. Restart the MySQL server.

    psfob# clrs disable mys-rs
    psfob# clrs enable mys-rs
  5. On both clusters, create a database to be replicated and a database user gg for Oracle GoldenGate.

    In this example, make the Oracle GoldenGate user gg as a database administrator.

    Cluster nyc:
    
    root@pnycb:~# /usr/local/mysql/bin/mysql -S /tmp/mysql.sock -uroot -proot
    mysql> use mysql
    mysql> GRANT ALL ON *.* TO 'gg'@'localhost' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnyca' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnycb' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfoa' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfob' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'nyc-gg' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'sfo-gg' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfo' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnyc' IDENTIFIED BY 'gg';
    mysql> create database golden;
    mysql> exit
  6. Create a table to test your replication.

    Once Oracle GoldenGate is configured, just manipulate data in this table and check the content on both sites.

    Cluster nyc
    
    root@pnycb:~# /usr/local/mysql/bin/mysql -h nyc-gg -ugg -pgg
    mysql> use golden
    mysql> create table tab1 (row1 int not null, row2 char(64));
    mysql> create unique index ind1 on tab1(row1);
    mysql> exit;
      
    Cluster sfo
        
    root@psfob:~# /usr/local/mysql/bin/mysql -S /tmp/mysql.sock -uroot -proot
    mysql> use mysql
    mysql> GRANT ALL ON *.* TO 'gg'@'localhost' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnyca' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnycb' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfoa' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfob' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'nyc-gg' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'sfo-gg' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'psfo' IDENTIFIED BY 'gg';
    mysql> GRANT ALL ON *.* TO 'gg'@'pnyc' IDENTIFIED BY 'gg';
    mysql> create database golden;
    mysql> exit
  7. Create a table to test your replication.

    Once GoldenGate is configured just manipulate data in this table and check the content on both sites.

        root@psfob:~# /usr/local/mysql/bin/mysql -h sfo-gg -ugg -pgg
        mysql> use golden
        mysql> create table tab1 (row1 int not null, row2 char(64));
        mysql> create unique index ind1 on tab1(row1);
        mysql> exit
  8. On both clusters, set the MySQL database socket in the my.cnf file.

    socket=/tmp/mysql.sock
        
    # Restart the mysql database.
    # clrs disable mys-rs
    # clrs enable mys-rs