0% found this document useful (0 votes)
136 views13 pages

Oracle GoldenGate 18c Workshop Lab 6

The document describes configuring an integrated replicat process in Oracle GoldenGate to replicate data between two Oracle databases. It provides steps to stop existing replicat processes, add capture of a new schema to the extract, create an integrated replicat process to apply changes to the target database, and alter the replicat to start from a specific position in the remote trail. It also shows commands to monitor the replication progress and load test data to validate the changes are replicating between the databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views13 pages

Oracle GoldenGate 18c Workshop Lab 6

The document describes configuring an integrated replicat process in Oracle GoldenGate to replicate data between two Oracle databases. It provides steps to stop existing replicat processes, add capture of a new schema to the extract, create an integrated replicat process to apply changes to the target database, and alter the replicat to start from a specific position in the remote trail. It also shows commands to monitor the replication progress and load test data to validate the changes are replicating between the databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Oracle GoldenGate 18c and GoldenGate Cloud Services Workshop

Hands-on Lab Exercise 6


Configuring Integrated Replicat

Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
1
Create an integrated replicat process

Stop the replicat processes created in earlier lab exercises

[oracle@rac01 goldengate]$ ./ggsci

GGSCI (rac01.localdomain) 1> stop replicat *

Sending STOP request to REPLICAT INITREP2 ...


Request processed.

Sending STOP request to REPLICAT INITREP3 ...


Request processed.

Sending STOP request to REPLICAT REP1 ...


Request processed.

Stop the Extract and Pump process and add the capture for the DEMO schema as well

GGSCI (rac01.localdomain) 5> stop extract *

Sending STOP request to EXTRACT EXT1 ...


Request processed.

Sending STOP request to EXTRACT PUMP1 ...


Request processed.

GGSCI (rac01.localdomain) 6> edit params ext1

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.*;

GGSCI (rac01.localdomain) 7> edit params pump1

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.*;

GGSCI (rac01.localdomain) 8> start extract *

Sending START request to MANAGER ...


EXTRACT EXT1 starting

Sending START request to MANAGER ...


EXTRACT PUMP1 starting

GGSCI (rac01.localdomain) 9> info extract *

EXTRACT EXT1 Last Started 2019-01-20 08:00 Status RUNNING


Checkpoint Lag 00:00:00 (updated 00:03:32 ago)
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
3
Process ID 27885
Log Read Checkpoint Oracle Integrated Redo Logs
2019-01-20 08:56:17
SCN 0.5477617 (5477617)

EXTRACT PUMP1 Last Started 2019-01-20 08:59 Status RUNNING


Checkpoint Lag 00:00:00 (updated 00:00:00 ago)
Process ID 27886
Log Read Checkpoint File /acfs_oh/app/goldengate/dirdat/ogg1/lt000000015
2019-01-20 08:00:14.521909 RBA 1477

Create the integrated replicat process rep3

GGSCI (rac02.localdomain) 3> add replicat rep3 integrated exttrail ./dirdat/ogg2/rt


REPLICAT (Integrated) added.

GGSCI (host02.localdomain as oggadmin@prod) 4> edit params rep3

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.

GGSCI (rac01.localdomain) 3> send pump1 status

Sending STATUS request to EXTRACT PUMP1 ...


EXTRACT PUMP1 (PID 27886)
Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
4
Current status: Recovery complete: At EOF

Current read position:


Sequence #: 16
RBA: 1477
Timestamp: 2019-01-20 09:00:07.564266
Extract Trail: /acfs_oh/app/goldengate/dirdat/ogg1/lt

Current write position:


Sequence #: 23
RBA: 1598
Timestamp: 2019-01-20 09:02:43.680150
Extract Trail: ./dirdat/ogg2/rt

Alter the integrated replicat process to begin reading from that Relative Byte Address (RBA) in the trail file. Then start the
integrated replicat.

GGSCI (rac01.localdomain) 6> alter replicat rep3 extseqno 23 extrba 1598

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.

REPLICAT (Integrated) altered.

GGSCI (rac01.localdomain) 7> start rep3

Sending START request to MANAGER ...


REPLICAT REP3 starting

Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
5
GGSCI (rac01.localdomain) 8> info rep3

REPLICAT REP3 Initialized 2019-01-20 08:44 Status STARTING


INTEGRATED
Checkpoint Lag 00:00:00 (updated 00:00:32 ago)
Process ID 23880
Log Read Checkpoint File ./dirdat/ogg2/rt000000023
First Record RBA 1598

GGSCI (rac01.localdomain) 9> !


info rep3

REPLICAT REP3 Last Started 2019-01-20 08:45 Status RUNNING


INTEGRATED
Checkpoint Lag 00:00:00 (updated 00:00:36 ago)
Process ID 23880
Log Read Checkpoint File /acfs_oh/app/goldengate/dirdat/ogg2/rt000000022
First Record RBA 1598

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

Target database (PDB2)

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.

SQL> alter session set container=pdb2;

Session altered.

SQL> col apply_name format a20

SQL> select apply_name,server_id,state,total_messages_applied from v$gg_apply_server;

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


-------------------- ---------- -------------------- ----------------------
OGG$REP3 2 IDLE 0
OGG$REP3 1 IDLE 0

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

[oracle@rac01 goldengate]$ sqlplus demo/oracle@pdb1

SQL> truncate table myobjects;

Table truncated.

SQL> conn demo/oracle@pdb2


Connected.

SQL> /

Table truncated.

Source database (PDB1)

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.

[oracle@rac01 goldengate]$ sqlplus demo/oracle@pdb1

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

GGSCI (rac01.localdomain) 30> stats pump1 latest

Sending STATS request to EXTRACT PUMP1 ...

Start of Statistics at 2019-01-20 09:06:58.

Output to ./dirdat/ogg2/rt:

Extracting from PDB1.DEMO.MYOBJECTS to PDB1.DEMO.MYOBJECTS:

*** Latest statistics since 2019-01-20 09:06:30 ***


Total inserts 136420.00
Total updates 68210.00
Total deletes 68210.00
Total discards 0.00
Total operations 272840.00

End of Statistics.

Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
9
GGSCI (rac01.localdomain) 31> stats rep3 latest

Sending STATS request to REPLICAT REP3 ...

Start of Statistics at 2019-01-20 09:07:09.

Integrated Replicat Statistics:

Total transactions 0.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 45300.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 45300.00

End of Statistics.

GGSCI (rac01.localdomain) 32>

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> /

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


-------------------- ---------- -------------------- ----------------------
OGG$REP3 1 IDLE 0
OGG$REP3 2 IDLE 0

SQL> /

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


-------------------- ---------- -------------------- ----------------------
OGG$REP3 1 EXECUTE TRANSACTION 49962
OGG$REP3 2 IDLE 0

SQL> /

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


-------------------- ---------- -------------------- ----------------------
OGG$REP3 1 IDLE 68490
OGG$REP3 2 EXECUTE TRANSACTION 8134

SQL> /

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


Oracle Goldengate 18c and GoldenGate Cloud Services Workshop Lab Exercise 6
11
-------------------- ---------- -------------------- ----------------------
OGG$REP3 1 IDLE 68490
OGG$REP3 3 IDLE 0
OGG$REP3 2 EXECUTE TRANSACTION 86260

SQL> /

APPLY_NAME SERVER_ID STATE TOTAL_MESSAGES_APPLIED


-------------------- ---------- -------------------- ----------------------
OGG$REP3 1 IDLE 479430
OGG$REP3 3 INACTIVE 0
OGG$REP3 2 IDLE 547920

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.

GGSCI (rac01.localdomain) 34> send rep3 status


Sending STATUS request to REPLICAT REP3 ...
Current status: At EOF
Sequence #: 23
RBA: 332,607,505
0 records in current transaction.

Verify the number of rows processed by the integrated replicat via the STATS command

GGSCI (rac01.localdomain) 35> stats rep3 latest


Sending STATS request to REPLICAT REP3 ...
Start of Statistics at 2019-01-20 09:14:26.

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

You might also like