HOW TO CHECK SYNCHRONISATION BETWEEN DATABASES WHICH ARE CONNECTED BY FORWARD2CENTER

Find and share HowTos to various installations / configurations!
1 post • Page 1 of 1
cprett
Posts:12
Joined: Tue Mar 14, 2017 1:09 pm

HOW TO CHECK SYNCHRONISATION BETWEEN DATABASES WHICH ARE CONNECTED BY FORWARD2CENTER

Post by cprett »

Sometimes we were asked by the customer how to check the synchronization state between two existing Oracle Databases which are synchronized with the FWD Option.

In such a configuration RDB is actively writing data into one Oracle Database. The data which has been written to the Database will then be forwarded to a second site. This is helpful for maintenance windows
and provides also redundancy on Oracle Database LEVEL.

The synchronization will be handled by an oracle scheduled job, which is running as per default every 3 minutes, and it's pushing the data to the 2nd Oracle Database over an exisiting DATABASE LINK (DBFWDLINK) which will be
installed automatically during synchronization setup.

Sometimes it is necessary to check if the synchronization is running fine within the Oracle Database.

Lets assume that you have an event group configured which holds all event data. So to check synchronization it is necessary to use the eventhistory view which holds the whole bunch of online available data in the database for this group.

Another important table is the STATUSFWD table which can be found in the RDB - Schema after synchronization setup. The contents of the table represents the to do list, which data has to be transferred to the 2nd Oracle Database.

STATUSFWD
BULK_ID,
SYS_ID,
GROUP_NAME,
STATUS,
STATUS_TIME,
FROM_TIME,
END_TIME

In the STATUSFWD you have the END_TIME column which tells you the last timestamp synchronized for the Archive Group.

The contents of the END_TIMEcolumn can be taken as a basic information for the time period to check. Time periods which need to be checked must be before the END_TIME column of the ARCHIVE_GROUP.

Be aware that you will get UTC Times as a result. So you have to keep the local UTC Offset in mind.

Synchronization can be checked for the whole archive group in a certain time period :

Code: Select all


select 
       a."LocalCT",  
       d."RemoteCT"
       from 
     (select 
            count(*) "LocalCT"
        from 
           eventhistory b
           where b.TS 
           between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF') 
                 and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')
       ) a
    ,  (select  
          count(*) "RemoteCT"
            from evethistory@DBFWDLINK c
            where c.TS 
       between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF') 
       and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')
       ) d
/  
or

Synchronization can be checked within a certain time period grouped by element_id

Code: Select all


select a.element_id "LocalElement",
         a."LocalCT",  
        d.Element_id "RemoteElement",
        d."RemoteCT"
       from 
    (select b.element_id,
              count(*) "LocalCT"
              from 
       eventhistory b
       where b.TS 
          between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  -- Starting Time Local 
          and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  -- Ending Time Local
       group by b.element_id) a
    ,  (select c.element_id 
                , count(*) "RemoteCT"
            from 
       eventhistory@DBFWDLINK c
       where c.TS 
         between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  --Starting Time Remote
         and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  - Ending Time Remote
       group by 
       c.element_id) d
       where a.element_id = d.element_id
      order by a.element_id
/  
Synchronization can be checked within a certain time period grouped by element_id for a certain element_id

Code: Select all

select a.element_id "LocalElement",
         a."LocalCT",  
        d.Element_id "RemoteElement",
        d."RemoteCT"
       from 
    (select b.element_id,
              count(*) "LocalCT"
              from 
       eventhistory b
       where b.TS 
          between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  -- Starting Time Local 
          and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  -- Ending Time Local
          and element_id=123456789
       group by b.element_id) a
    ,  (select c.element_id 
                , count(*) "RemoteCT"
            from 
       eventhistory@DBFWDLINK c
       where c.TS 
         between to_timestamp ('15.10.18 13:30:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  --Starting Time Remote
         and to_timestamp ('15.10.2018 13:40:00:000000000','DD.MM.RRRR HH24:MI:SS:FF')  - Ending Time Remote
         and element_id = 123456789   
     group by 
       c.element_id) d
       where a.element_id = d.element_id
      order by a.element_id

/ 

1 post • Page 1 of 1