Testing replication

After you finish setting up the replication system, you can test replication.

StepsTesting replication

  1. Connect to the primary Oracle instance as a regular user, not the maintenance user. Make sure the regular user also exists in the standby database.

  2. Create a test table to replicate in the primary database:

    create table T1( a int, b char(10));
    

    This statement is replicated by the user defined by the ddl_username Mirror Replication Agent configuration parameter. After the elapsed time referenced by the scan_sleep_max Mirror Replication Agent setting, the T1 table should be replicated to the standby database.

  3. Grant permissions to any new or existing object to be replicated in the standby database so that the Replication Server maintenance user can update this table:

    grant all on T1 to public;
    

    This statement is also replicated to the standby database by the user defined by the ddl_username Mirror Replication Agent configuration parameter.

  4. After the table is marked and the Mirror Replication Agent is in a REPLICATING state, insert test data into the test table and commit it.

    By default, the work performed by the maintenance user of the primary connection is not replicated. The user ID used to insert transactions cannot be the same as the maintenance user defined in the primary connection. See “Configuring Replication Server for replication from the primary database”.

    Mirror Replication Agent applies only committed transactions to a standby database. However, because Oracle expects a commit command to be issued, follow simple test commands with an explicit commit command:

    insert into T1 values ( 42, ‘foo’ );
    commit;
    
  5. Use your preferred Oracle query tool to examine the standby site for results and compare the contents of your test table from both the primary and standby sites.