GOLDILOCKS Database Replication

Overview

This chapter describes CYCLONE, LOGMIRROR and CYFILE.

GOLDILOCKS supports two types of replication, and they are CYCLONE and LOGMIRROR. CYCLONE replicates transactions using CDC, and LOGMIRROR replicates redo log files in the source database.

CYFILE uses CDC method to store/ record the transaction which was applied to the original database in Comma-Separated Values (CSV) format file.

Replication tool

Tool

Replication target

Description

CYCLONE

Transaction

It uses CDC method, and replicates the transaction reflected in master, then reflect it to slave.

LOGMIRROR

Redo log file

It identically replicates redo file in master database to slave.

CYFILE

Transaction

It uses CDC method to store/ record the transaction in CSV format file.

Operating Method

CYCLONE

For more information about general operating method and option, refer to CYCLONE.

Adding and Deleting Nodes

CYCLONE is performed in a group unit, and it is as same as the replication nodes. Add a group when adding nodes, drop a group when deleting nodes.

Examples of Adding Nodes

...
...
GROUP_NAME = Group1
{
    PORT = 21102
    CAPTURE_TABLE =
    (
        testTable1,
        testTable2
    )
}
GROUP_NAME = Group2
{
    PORT = 21103
    CAPTURE_TABLE =
    (
        testTable5,
        testTable6
    )
}
...
...
GROUP_NAME = Group1
{
    PORT = 21102    
    APPLY_TABLE = 
    (
        testTable1 To testTable3,
        testTable2 To testTable4
    )
}
GROUP_NAME = Group2
{
    PORT = 21103    
    APPLY_TABLE = 
    (
        testTable5 To testTable7,
        testTable6 To testTable8
    )
}
prompt> cyclone --master --start --group Group2
[GROUP2] Startup done as Master.

prompt> cyclone --master --status
======================================
|       CYCLONE STATUS - MASTER      |
======================================
 GROUP1 Running...
 GROUP2 Running...
--------------------------------------
prompt> cyclone --slave --start --group Group2
[GROUP2] Startup done as Slave.

prompt> cyclone --slave --status
======================================
        CYCLONE STATUS - SLAVE        
======================================
 GROUP1 Running...
 GROUP2 Running...
--------------------------------------

Examples of Deleting Nodes

prompt> cyclone --slave --stop --group Group2
stop done.

prompt> cyclone --slave --status
======================================
CYCLONE STATUS - SLAVE
======================================
GROUP1 Running...
--------------------------------------
prompt> cyclone --master --stop --group Group2
stop done.

prompt> cyclone --master --status
======================================
CYCLONE STATUS - MASTER
======================================
GROUP1 Running...
--------------------------------------
...
...
GROUP_NAME = Group1
{
    PORT = 21102
    CAPTURE_TABLE =
    (
        testTable1,
        testTable2
    )
}
GROUP_NAME = Group2
{
    PORT = 21103
    CAPTURE_TABLE =
    (
        testTable5,
        testTable6
    )
}
...
...
GROUP_NAME = Group1
{
    PORT = 21102    
    APPLY_TABLE = 
    (
        testTable1 To testTable3,
        testTable2 To testTable4
    )
}
GROUP_NAME = Group2
{
    PORT = 21103    
    APPLY_TABLE = 
    (
        testTable5 To testTable7,
        testTable6 To testTable8
    )
}

Initializing Replication

Initializing replication is executed when existing replication nodes or a group's table gives up execution due to DDL operation. A specific node or entire node can be initialized.

The initializing replication is performed by restarting replication being operated in slave using --reset option.
On the other hand, master does not require any operation.

Examples of Initializing Replication on a Specific Node

prompt> cyclone --slave --stop --group Group2
stop done.

prompt> cyclone --slave --status
======================================
        CYCLONE STATUS - SLAVE        
======================================
 GROUP1 Running...
--------------------------------------
prompt> cyclone --slave --start --reset --group Group2
[GROUP2] Startup done as Slave.

prompt> cyclone --slave --status
======================================
        CYCLONE STATUS - SLAVE        
======================================
 GROUP1 Running...
 GROUP2 Running...
--------------------------------------

Examples of Initializing Replication of All Nodes

prompt> cyclone --stop --slave
prompt> cyclone --slave --start --reset
[GROUP1] Startup done as Slave.
[GROUP2] Startup done as Slave.

prompt> cyclone --slave --status
======================================
        CYCLONE STATUS - SLAVE        
======================================
 GROUP1 Running...
 GROUP2 Running...
--------------------------------------

LOGMIRROR

For more information about general operation method and options, refer to LOGMIRROR.

Retrieving LOGMIRROR State

GOLDILOCKS includes the response waiting procedure of LOGMIRROR when GOLDILOCKS interworks with LOGMIRROR. If LOGMIRROR is waiting for response, GOLDILOCKS is also waiting in a blocked state. This state can be retrieved in v$system_stat.

gSQL> SELECT * FROM V$SYSTEM_STAT WHERE STAT_NAME='LOG_MIRROR_SYNC_STATE';

STAT_NAME             STAT_VALUE COMMENTS                                     
--------------------- ------ ---------------------------------------------
LOG_MIRROR_SYNC_STATE      0 logmirror sync state( 0 : sync, 1 : blocked )


1 row selected.

If STAT_VALUE is 0, it is not a standby state but an ordinary state. If STAT_VALUE is 1, it is a blocked state waiting for a response. To restart GOLDILOCKS service while LOGMIRROR is waiting for a response, LOGMIRROR service can be stopped by modifying LOG_MIRROR_TIMEOUT as follows.

gSQL> ALTER SYSTEM SET LOG_MIRROR_TIMEOUT = 20;

System altered.

Initializing Replication

Initializing replication of LOGMIRROR should be done manually. This is to prevent data dropping or the unrecoverable situation driven by the user's incorrect option usage.

Control files and redo log files are stored in LOGMIRROR slave. The required information for the operation is stored and updated in the control files.

Examples of Initializing Replication

prompt> logmirror --slave --stop 
stop done.
prompt> logmirror --master --stop 
stop done.

CYFILE

For more information about how to operate and its options, refer to CYFILE.

Starting, Stopping and Status Checking of cyfile

Example

prompt> cyfile --start --reset all
Startup done.
prompt> cyfile --stop
Stop done.
prompt> cyfile --status
cyfile --status
======================================
|          CYFILE STATUS             |
======================================
 GROUP1 Running...
======================================

Trace Log

The followings are detailed information about the trace log.

Trace log

Name

Category

File name

CYCLONE

Master

cyclone_master_GROUP_NAME.trc

Slave

cyclone_slave_GROUP_NAME.trc

LOGMIRROR

Master

LogMirror_master.trc

Slave

LogMirror_slave.trc

CYFILE

-

cyfile_GROUP_NAME.trc

Troubleshooting of CYCLONE

The followings are error messages and troubleshooting of CYCLONE.

Troubleshooting of CYCLONE

Error message

Solution

Service is not available

Ensure that GOLDILOCKS is normally running.

table does not exist

Check the table name described in the configuration file.

schema does not exist

Check the schema name described in the configuration file.

previously added. Maybe duplicated

Check if a table is duplicated in the configuration file.

table must have a primary key

Ensure that a table in the configuration file has the primary key.

internal error occurred.

Check the error details.

table must set supplemental log

Ensure that supplemental logging is executed in GOLDILOCKS.

group XXX is already running

Check if the corresponding group is already running.

GOLDILOCKS_DATA system environment is invalid

Ensure that GOLDILOCKS_DATA environment variable is set.

log file reused or invalid. restart cyclone with '--reset' option

This error occurs when the redo log file is reused or archived redo log file does not exist. In this case, initialize CYCLONE and restart it.

fail to analyze flow

This error occurs when analyzing an abnormal redo log file.

Ensure that the release version between master and slave are same.

Communication link failure

Check the network state. Restart CYCLONE.

Master disconnect abnormally

Check the network state. Restart CYCLONE.

Protocol error occurred

Check the error details.

Already slave connected

Check if the slave is already running.

Invalid group name

Check the specified group name at the startup/termination. The group name should be same as described in the configuration file.

Invalid capture information

This error occurs when the existing operating information is abnormal. In this case, initialize CYCLONE and restart it.

Redo log file read timeout

Ensure that the archived redo log files normally exist.

Invalid archive log file

The archived redo log file is not normal. In this case, initialize CYCLONE and restart it.

Fail to write file

Check the available space in the disk, and restart CYCLONE.

Invalid Meta File

This error occurs when the meta files which are managed by CYCLONE are corrupted. In this case, initialize CYCLONE and restart it.

Redo log file does not exist

Ensure that GOLDILOCKS which is operated as master is normally running.

[APPLIER-INSERT] XXX

INSERT is failed due to XXX.

[APPLIER-DELETE] XXX

DELETE is failed due to XXX.

[APPLIER-UPDATE] XXX

UPDATE is failed due to XXX.

Troubleshooting of LOGMIRROR

The followings are error messages and troubleshooting of LOGMIRROR.

Troubleshooting of LOGMIRROR

Error message

Solution

Service is not available

Ensure that GOLDILOCKS is normally running.

Invalid Protocol value

Check the error details.

file does not exist

Ensure that the corresponding file normally exists.

invalid Control file

The control file is corrupted. Initialize and restart LOGMIRROR.

Communication link failure

Check the network state. Restart LOGMIRROR.

GOLDILOCKS_DATA system environment is invalid

Ensure that GOLDILOCKS_DATA environment variable is set.

There is no Shared Memory Area for LogMirror

Ensure that LOG_MIRROR_MODE property is normally set to 'enabled' in properties of GOLDILOCKS which is operated as master.

Master disconnect abnormally

Check the network state. Restart LOGMIRROR.

Invalid Log File

Ensure that the corresponding file normally exists.

Connection Information does not exist

Ensure that GOLDILOCKS connecting information in configuration files is normal.

Archive Log File does not exist

Ensure that ARCHIVELOG_MODE in GOLDILOCKS which is operated as master is normally set.

Troubleshooting of CYFILE

The followings are error messages and troubleshooting of CYFILE.

Error message

Solution

Service is not available

Ensure that GOLDILOCKS is normally running.

table does not exist

Check the table name described in the configuration file.

schema does not exist

Check the schema name described in the configuration file.

previously added. Maybe duplicated

Check if a table is duplicated in the configuration file.

table must have a primary key

Ensure that a table in the configuration file has the primary key.

internal error occurred.

Check the error details.

table must set supplemental log

Ensure that supplemental logging is executed in GOLDILOCKS.

group XXX is already running

Check if the corresponding group is already running.

GOLDILOCKS_DATA system environment is invalid

Ensure that GOLDILOCKS_DATA environment variable is set.

log file reused or invalid. restart cyfile with '--reset' option

This error occurs when the redo log file is reused or archived redo log file does not exist. In this case, initialize cyfile and restart it.

fail to analyze flow

This error occurs when analyzing an abnormal redo log file.

Ensure that the release version between master and slave are same.

Invalid group name

Check the specified group name at the startup/termination. The group name should be same as described in the configuration file.

Invalid capture information

This error occurs when the existing operating information is abnormal. In this case, initialize cyfile and restart it.

Redo log file read timeout

Ensure that the archived redo log files normally exist.

Invalid archive log file

The archived redo log file is not normal. In this case, initialize cyfile and restart it.

Fail to write file

Check the available space in the disk, and restart cyfile.

Invalid Meta File

This error occurs when the meta files which are managed by cyfile are corrupted. In this case, initialize cyfile and restart it.

Redo log file does not exist

Ensure that GOLDILOCKS is normally running.

Control has broken(CRC Error)

The control file of cyfile is damaged. Retry it by using the mirror file.