The following section describes the steps required to test replication.
Create a test table.
Grant permissions to the test table.
Mark the table for replication.
Insert data into the test table and commit it.
To test replication
Connect to the primary Oracle instance as a regular user.
To create a test table to replicate (unless it already exists) enter the following command:
create table T1( a int b char(10), primary key(a,b));
This statement is replicated by the user defined in the MRO configuration parameter ddl_user. After the elapsed time referenced by the MRO setting, in scan_sleep_max, the T1 table should be replicated to the target Oracle instance.
Grant permissions to any new or existing object to be replicated, so that the Rep Server maintenance user can update this table:
grant all on T1 to public;
This statement is also replicated to the standby database by the ddl_user defined in the MRO configuration.
Mark the table for replication using the pdb_setreptable command and the mark keyword. For example:
isql -Usa -P -Smy_mro
pdb_setreptable T1, markgo
For additional information about pdb_setreptable, see the Mirror Replication Agent Administration Guide, Chapter 2, “Troubleshooting Mirror Replication Agent”, the section titled, “Marking objects in the primary database.”
After the table is marked and the MRO 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 will not be replicated. The userID used to insert transactions cannot be the same as the maintenance user defined in the primary connection. See the section titled “Step 3. Configure Rep Server for replication from the primary database”.
MRO only applies 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;
Using your preferred Oracle query tool, examine the standby site for results and compare the contents of your test table from both the primary and standby sites.
If replication fails, refer to the Mirror Replication Agent Administration Guide, in Chapter 2, “Troubleshooting Mirror Replication Agent,” the section titled, “Examining the Mirror Replication Agent when replication failure occurs.”