Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Simple DML operations:

Before we start, we should ensure, that replication is setup correctly and is running. Connect to dbvrep console using script start-console.sh on either source or target machine:

If everything went fine, you should see at the top of the console output that MINE and APPLY processes are running and applying changes from PLOG files:

MINE IS running. Currently at plog 32 and SCN 573985 (01/22/2015 23:06:56).
APPLY IS running. Currently at plog 32 and SCN 573979 (01/22/2015 23:06:55)

Lets insert some simple row and check in console, how did the replication work.

We are going to insert a row to the table REPOE.CARD_DETAILS. We will create a unique value of CARD_TYPE column in order to be able to check, whether the row was replicated or not.

Check on target database that the row does not exist on the target:

select count(*) from REPOE.CARD_DETAILS where card_type='REPOE_TEST';
  COUNT(*)
----------
         0

Now insert a row into REPOE.CARD_DETAILS table.

Open any SQL tool, connect as repoe/repoe@SOURCE to source database and run following command:

[oracle@source replicate]$ sqlplus repoe/repoe@SOURCE
SQL> insert into REPOE.CARD_DETAILS (card_id, customer_id, card_type, card_number, expiry_date, is_valid, security_code) values (CARD_DETAILS_SEQ.nextval, 1287, 'REPOE_TEST', 9102450385, sysdate, 'Y', 1000 );

1 row created.

SQL> commit;
Commit complete.

Now look at the dbvrep console, if the row was successfully replicated;

Progress of replication repoe:MINE->APPLY: total/this execution
------------------------------------------------------------------------------------------------------------------
REPOE.CARD_DETAILS:           100%  Mine:1/1             Unrecov:0/0         Applied:1/1         Conflicts:0/0       
Last:22/01/2015 23:23:54/OK
------------------------------------------------------------------------------------------------------------------

When we see in the console, that the row was sucessfully replicated to the target database, we should check, if it is correctly replicated. Connect to target database as user repoe/repoe and run following command:

[oracle@source replicate]$ sqlplus repoe/repoe@TARGET
SQL> set lines 200 pages 999
SQL> select * from REPOE.CARD_DETAILS where card_type='REPOE_TEST';

   CARD_ID CUSTOMER_ID CARD_TYPE                      CARD_NUMBER EXPIRY_DATE        I SECURITY_CODE
---------- ----------- ------------------------------ ----------- ------------------ - -------------
    750004        1287 REPOE_TEST                      9102450385 25-MAY-17          Y          1000

  • No labels