To test whether change synchronization is working, we must make some data changes on our source database and ensure that they are propagated to and applied on the target.
The following simple steps provide a basic test case that will confirm all is well.
SQL*Plus
session and connect it to the PDB1
database as the SRC
user:sqlplus src/TIGER@PDB1
SQL> @src_test_transaction.sql 1 row created. 1 row created. 1 row updated. Commit complete.
Issuing a commit
forces Oracle to write the transaction details to the database's online redo logs. These are subsequently read by the Extract process (EOLTP01
) in real time and written to the local trail. The transaction in the local trail is read by the data pump process (EPMP01
) that transfers the data via TCP/IP to the remote trail. The Replicat process (ROLAP01
) reads the remote trail, converts the transaction data to DML, and applies it to the database.
SQL*Plus
session and connect it to the PDB2
database as the TGT
user:sqlplus tgt/TIGER@PDB2
DEPT
table to see whether the new row exists:SQL> select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 50 TEST LONDON ß New row inserted
Now that we have successfully configured and tested GoldenGate real-time data replication, we can generate and view a report for a given process by issuing the following GGSCI commands:
SEND <PROCESS_TYPE> <PROCESS_GROUP_NAME>, REPORT VIEW REPORT < PROCESS_GROUP_NAME>
The following code shows the runtime statistics section of the Replicat process ROLAP01
report:
GGSCI (db12server02) 1> send REPLICAT ROLAP01, report Sending REPORT request to REPLICAT ROLAP01 ... Request processed. GGSCI (db12server02) 2> view report ROLAP01 ***************************************************************** * ** Run Time Statistics ** * ***************************************************************** Last record for the last committed transaction is the following: ___________________________________________________________________ Trail name : ./dirdat/rt000011 Hdr-Ind : E (x45) Partition : . (x04) UndoFlag : . (x00) BeforeAfter: A (x41) RecLength : 60 (x003c) IO Time : 2015-04-01 18:00:07.000451 IOType : 134 (x86) OrigNode : 255 (xff) TransInd : . (x02) FormatType : R (x52) SyskeyLen : 0 (x00) Incomplete : . (x00) AuditRBA : 80 AuditPos : 26208832 Continued : N (x00) RecCount : 1 (x01) 2015-04-01 18:00:07.000451 UnifiedUpdate Len 60 RBA 1885 Name: PDB1.SRC.EMP ___________________________________________________________________ Reading ./dirdat/rt000011, current RBA 2040, 3 records Report at 2015-04-01 18:04:32 (activity since 2015-04-01 18:02:40) From Table PDB1.SRC.DEPT to PDB2.TGT.DEPT: # inserts: 1 # updates: 0 # deletes: 0 # discards: 0 From Table PDB1.SRC.EMP to PDB2.TGT.EMP: # inserts: 1 # updates: 1 # deletes: 0 # discards: 0 Integrated Replicat Statistics: Total transactions: 1 Redirected: 0 DDL operations: 0 Stored procedures: 0 Datatype functionality: 0 Event actions: 0 Direct transactions ratio: 0%
The report confirms one record inserted into the DEPT
and EMP
tables, plus one updated record in the EMP
table. Note that the Integrated Replicat statistics shows the three DML operations as one transaction. This is important for performance and will be discussed in Chapter 9, Performance Tuning.
3.145.42.94