Disclaimer

Sunday, 8 December 2024

Oracle Goldengate Microservices Unidirectional replication Step by Step

 


================================================

Source: ORCL

================================================

SQL> create tablespace gg_tbs datafile '/data1/ORCL/gg_tbs.dbf' size 1G;

SQL> create user ggadmin identified by Welcome#123 default tablespace gg_tbs;

sql> grant connect,resource to ggadmin;

SQL> alter user ggadmin quota unlimited on gg_tbs;

SQL> grant dba to ggadmin; 

SQL> exec dbms_goldengate_auth.grant_admin_privilege ('GGADMIN');

SQL> alter database add supplemental log data (all) columns;

SQL> select supplemental_log_data_min from v$database;    

SQL> alter system set STREAMS_POOL_SIZE=200m scope=BOTH;     ----- Will not use

SQL> exec dbms_goldengate_auth.grant_admin_privilege ('GGADMIN');

SQL> alter system set enable_goldengate_replication=TRUE;

SQL> alter database force logging;


================================================

TARGET: OEMDB

================================================

SQL> create tablespace gg_tbs datafile '/data2/OEMDB/gg_tbs.dbf' size 1G;

SQL> create user ggadmin identified by Welcome#123 default tablespace gg_tbs;

sql> grant connect,resource to ggadmin;

SQL> alter user ggadmin quota unlimited on gg_tbs;

SQL> grant dba to ggadmin; 

SQL> exec dbms_goldengate_auth.grant_admin_privilege ('GGADMIN');

SQL> alter database add supplemental log data (all) columns;

SQL> select supplemental_log_data_min from v$database;    

SQL> alter system set STREAMS_POOL_SIZE=200m scope=BOTH;     ----- Will not use

SQL> exec dbms_goldengate_auth.grant_admin_privilege ('GGADMIN');

SQL> alter system set enable_goldengate_replication=TRUE;

SQL> alter database force logging;






Source ORCL DB : 

SAM user:-

SQL> CREATE TABLE large_data_table (
    id NUMBER,
    name VARCHAR2(100),
    description CLOB,
    created_date DATE
);  2    3    4    5    6

Table created.

SQL> conn sam/sam
Connected.

SQL> select count(*) from large_data_table;

  COUNT(*)
----------
      0


Target OEM DB:-

RAM user:-

SQL> conn ram/ram
Connected.
SQL>
SQL>
SQL> CREATE TABLE large_data_table (
    id NUMBER,
    name VARCHAR2(100),
    description CLOB,
    created_date DATE
);   


SQL> select count(*) from large_data_table;

  COUNT(*)
----------
         0


=========================================================================


ORCL DB Server 


Step 1: Connect to the Administration Server 

Go to Configure 

Database

Credentials +

Now you can add your details like below screenshot.

Here ggadmin is username and he connection string (alias- orcl) 

ggadmin@orcl 



Here sam is username and he connection string (alias- orcl) 

same@orcl 

















Click on Submit

After that you will be able to see 








=========================================================================


Go to Target Server  OEM DB Server :-

Create the Credentials :-






Click on Submit



Connect to the database 

















At Target you need to create Checkpoint :-







=========================================================================


Now we are going to create Extract at Source DB ( ORCL)

Here you can see that there is SAM_EXT already created but we are going to create new Extract process





Click on + 










below are default parameter file and now you need to modify it





EXTRACT EXTSAML
USERIDALIAS oggadmin DOMAIN OracleGoldenGate
EXTTRAIL LR
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
TABLE SAM.LARGE_DATA_TABLE;





Click on Create and Run





Extract process in ACTIVE now in few seconds 

























=========================================================================



Now go to Target i.e. OEM DB server and Crete Repilcate 

Go to Administration Service

Overview




















default parameters for Replicate












REPLICAT REPRAML
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
USERIDALIAS oggadmin DOMAIN OracleGoldenGate
MAP SAM.LARGE_DATA_TABLE, TARGET RAM.LARGE_DATA_TABLE;









Since we have created Extract and Replicate process 

As per below diagram, we have to connect to Distribution server at Source server.

So data will be sending from Source to Target :-





=========================================================================

VIMP

Go to Source Server 

Distribution Service 





Click on +














Click on Create and Run and you will get below output










Source DB:-







Target DB:-








Happy Learning ðŸ™‚



No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...