Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Replication objects are created with the CREATE REPLICATION statement and define information related to replication such as replication mode, replication server information, and replication target table.
  • Two servers to be replicated are paired.
  • Replication objects must each be created with the same object name on the paired replication server.

    Code Block
    titleFor creating replicaiton object
    themeDJango
    languagesql
    CREATE REPLICATION replication_name                   -- Define the name of the replication object.
    WITH remote_host_ip, remote_replication_port_no       -- In the WITH clause, specify the IP and PORT of the remote server to be paired with.
    FROM user_name.table_name TO user_name.table_name,    -- List the tables to be duplicated in the FROM ~ TO clause. 
    FROM ... 
    ; 
  • Refer to Replication Manual -> 3. Using Replication -> Create Replication (CREATE REPLICATION) for additional options of the replication object creation syntax.
  • Manual page: http://support.altibase.com/en/manual 

 

Expand
titleProcedure for creating replication objects-Example 1 (when there are 2 replication target servers)

This is an example of creating a replication object when the conditions for creating a replication object are as follows.

  • The target server for replication is two A and B servers.
  • The replication object name is created as REP1.
  • The IP address of the target server A is 192.168.1.112 and the port number is 25524.
  • The IP address of the target server B is 192.168.1.113 and the port number is 35524.

  • The target tables for replication are the SYS user's employees table and departments table.
  1. Server A: IP 192.168.1.112, replication port: 25524

    Code Block
    languagesql
    CREATE REPLICATION rep1 WITH '192.168.1.113', 35524 
    FROM sys.employees TO sys.employees,
    FROM sys.departments TO sys.departments; 
    Create success.
  2. Server B: IP 192.168.1.113, replication port: 35524

    Code Block
    languagesql
    CREATE REPLICATION rep1 WITH '192.168.1.112', 25524
    FROM sys.employees TO sys.employees,
    FROM sys.departments TO sys.departments; 
    Create success.

     

     

  3. Check whether the replication object was created

    Code Block
    titleCheck on replication target server A
    languagesql
     iSQL> SELECT REPLICATION_NAME, HOST_IP, PORT_NO FROM SYSTEM_.SYS_REPL_HOSTS_;
    REPLICATION_NAME                HOST_IP                         PORT_NO     
    --------------------------------------------------------------------------------
    REP1                            192.168.1.113                   35524       
    1 row selected.
    
    iSQL> SELECT REPLICATION_NAME, LOCAL_USER_NAME, LOCAL_TABLE_NAME FROM SYSTEM_.SYS_REPL_ITEMS_;
    REPLICATION_NAME                LOCAL_USER_NAME                 LOCAL_TABLE_NAME                
    ----------------------------------------------------------------------------------------------------
    REP1                            SYS                             EMPLOYEES                       
    REP1                            SYS                             DEPARTMENTS                     
    2 rows selected.
    Code Block
    titleCheck on replication target server B
    languagesql
    iSQL> SELECT REPLICATION_NAME, HOST_IP, PORT_NO FROM SYSTEM_.SYS_REPL_HOSTS_;
    REPLICATION_NAME                HOST_IP                         PORT_NO     
    --------------------------------------------------------------------------------
    REP1                            192.168.1.112                   35524       
    1 row selected.          
    
    iSQL> SELECT REPLICATION_NAME, LOCAL_USER_NAME, LOCAL_TABLE_NAME FROM SYSTEM_.SYS_REPL_ITEMS_;
    REPLICATION_NAME                LOCAL_USER_NAME                 LOCAL_TABLE_NAME                
    ----------------------------------------------------------------------------------------------------
    REP1                            SYS                             EMPLOYEES                       
    REP1                            SYS                             DEPARTMENTS                     
    2 rows selected. 

...