Oracle GoldenGate 18c Workshop Lab 6
Oracle GoldenGate 18c Workshop Lab 6
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
1
Create an integrated replicat process
Stop the Extract and Pump process and add the capture for the DEMO schema as well
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
2
EXTRACT ext1
SETENV (ORACLE_HOME='/acfs_oh/product/12.2.0/dbhome_1')
USERIDALIAS oggadmin_cdb1
TRANLOGOPTIONS EXCLUDEUSER PDB1.C##oggadmin
EXTTRAIL ./dirdat/ogg1/lt
SOURCECATALOG pdb1
TABLE HR.*;
TABLE DEMO.*;
EXTRACT pump1
SETENV (ORACLE_HOME='/acfs_oh/product/12.2.0/dbhome_1')
USERIDALIAS oggadmin_cdb1
RMTHOST 192.168.56.130, MGRPORT 7809
RMTTRAIL ./dirdat/ogg2/rt
SOURCECATALOG pdb1
TABLE HR.*;
TABLE DEMO.*;
REPLICAT rep3
USERIDALIAS oggadmin_pdb2
DBOPTIONS INTEGRATEDPARAMS (max_sga_size 1024, parallelism 2)
MAP pdb1.demo.myobjects TARGET pdb2.demo.myobjects ;
Note the current position in the remote trail the data pump process is writing to.
Alter the integrated replicat process to begin reading from that Relative Byte Address (RBA) in the trail file. Then start the
integrated replicat.
2019-01-20 08:44:53 INFO OGG-06594 Replicat REP3 has been altered. Even the start up position might be updated, duplicate
suppression remains active in next startup. To override duplicate suppression, start REP3 with NOFILTERDUPTRANSACTIONS option.
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
5
GGSCI (rac01.localdomain) 8> info rep3
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
6
Monitor replication progress and query data dictionary views to monitor and track log mining
server apply server process
The integrated replicat process we created will start some log mining server processes in the target database. We can use the
view V$GG_APPLY_SERVER to monitor the apply server process.
Session altered.
Note: Do not close this terminal window and keep the SQL*PLUS session open as we will re-execute this query in the next steps.
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
7
Truncate the MYOBJECTS table in both PDB1 and PDB2 databases
Table truncated.
SQL> /
Table truncated.
Execute this PL/SQL block in the source database (connected as DEMO) to generate some load in the database.
IMPORANT
Execute the RMAN DELETE ARCHIVELOG ALL command on both source and target database environments to free up space in the log
archive destination as the PL/SQL block will generate significant redo activity in the database. This should be done BEFORE executing
the PL/SQL block shown below.
begin
for i in 1 ..5
loop
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
8
insert into myobjects
select * from all_objects;
commit;
update myobjects set owner='SYS';
commit;
delete myobjects;
commit;
end loop;
end;
/
Note that the Extract and Replicat process has already started capturing and applying rows
Output to ./dirdat/ogg2/rt:
End of Statistics.
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
9
GGSCI (rac01.localdomain) 31> stats rep3 latest
End of Statistics.
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
10
Target database (PDB2)
Note: As soon as we execute the PL/SQL block on PDB1, do not wait for the procedure to complete, but go to the target
database environment and issue the same query which we had earlier run.
Note the STATE and TOTAL_MESSAGES_APPLIED column. After a while we will see that a third apply server process has
automatically been added as the log mining server determines that based on the LCR’s being processed there is more load and
additional apply server processes need to be provisioned to ensure throughput is maintained in the apply process.
SQL> /
SQL> /
SQL> /
SQL> /
SQL> /
After a while we will see that the state of the apply processes is showing as IDLE. We can also confirm via GGSCI if the replicat has
completed the processing.
Verify the number of rows processed by the integrated replicat via the STATS command
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
12
Integrated Replicat Statistics:
Total transactions 15.00
Redirected 0.00
Replicated procedures 0.00
DDL operations 0.00
Stored procedures 0.00
Datatype functionality 0.00
Event actions 0.00
Direct transactions ratio 0.00%
Replicating from PDB1.DEMO.MYOBJECTS to PDB2.DEMO.MYOBJECTS:
*** Latest statistics since 2019-01-20 09:06:48 ***
Total inserts 341050.00
Total updates 341050.00
Total deletes 341050.00
Total discards 0.00
Total operations 1023150.00
End of Statistics.
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
13