142 lines
4.3 KiB
Markdown
142 lines
4.3 KiB
Markdown
|
|
## Articles
|
||
|
|
|
||
|
|
https://www.dbi-services.com/blog/how-to-create-an-oracle-goldengate-extract-in-multitenant/
|
||
|
|
http://blog.data-alchemy.org/posts/oracle-goldengate-pluggable/
|
||
|
|
|
||
|
|
## Topology
|
||
|
|
|
||
|
|
Databases:
|
||
|
|
- source: CDB: JEDIPRD@wayland, PDB: YODA
|
||
|
|
- target: CDB: SITHPRD@togoria, PDB: MAUL
|
||
|
|
|
||
|
|
## Databases setup for Golden Gate
|
||
|
|
|
||
|
|
In **both** databases, create Golden Gate admin user in `CDB$ROOT`:
|
||
|
|
|
||
|
|
create user c##oggadmin identified by "Secret00!";
|
||
|
|
alter user c##oggadmin quota unlimited on USERS;
|
||
|
|
grant create session, connect,resource,alter system, select any dictionary, flashback any table to c##oggadmin container=all;
|
||
|
|
exec dbms_goldengate_auth.grant_admin_privilege(grantee => 'c##oggadmin',container=>'all');
|
||
|
|
alter user c##oggadmin set container_data=all container=current;
|
||
|
|
grant alter any table to c##oggadmin container=ALL;
|
||
|
|
alter system set enable_goldengate_replication=true scope=both;
|
||
|
|
alter database force logging;
|
||
|
|
alter database add supplemental log data;
|
||
|
|
select supplemental_log_data_min, force_logging from v$database;
|
||
|
|
|
||
|
|
> On **target** database I had to add extra grants:
|
||
|
|
|
||
|
|
grant select any table to c##oggadmin container=ALL;
|
||
|
|
grant insert any table to c##oggadmin container=ALL;
|
||
|
|
grant update any table to c##oggadmin container=ALL;
|
||
|
|
grant delete any table to c##oggadmin container=ALL;
|
||
|
|
|
||
|
|
Create schemas for replicated tables on source and target PDB:
|
||
|
|
|
||
|
|
alter session set container=YODA;
|
||
|
|
create user GREEN identified by "Secret00!";
|
||
|
|
alter user GREEN quota unlimited on USERS;
|
||
|
|
grant connect,resource to GREEN;
|
||
|
|
connect GREEN/"Secret00!"@wayland/YODA;
|
||
|
|
|
||
|
|
|
||
|
|
alter session set container=MAUL;
|
||
|
|
create user RED identified by "Secret00!";
|
||
|
|
alter user RED quota unlimited on USERS;
|
||
|
|
grant connect,resource to RED;
|
||
|
|
connect RED/"Secret00!"@togoria/MAUL;
|
||
|
|
|
||
|
|
## Setup `exegol` Golden Gate deployment
|
||
|
|
|
||
|
|
> My Root CA (added to truststore host) has not be recognized by `admincmient` resulting OGG-12982 error while `curl` works perfectly.
|
||
|
|
|
||
|
|
Solution: define `OGG_CLIENT_TLS_CAPATH` environement variable to my root CA certificate prior to using `admincmient`
|
||
|
|
|
||
|
|
export OGG_CLIENT_TLS_CAPATH=/etc/pki/ca-trust/source/anchors/rootCA.pem
|
||
|
|
|
||
|
|
Add in the credentialstore enteries for database connections:
|
||
|
|
|
||
|
|
adminclient
|
||
|
|
connect https://exegol.swgalaxy:2000 deployment ogg_exegol_deploy as OGGADMIN password "Secret00!"
|
||
|
|
|
||
|
|
Optionaly store credentials to connect to deployement:
|
||
|
|
|
||
|
|
add credentials admin user OGGADMIN password "Secret00!"
|
||
|
|
|
||
|
|
Now we can hide the password when conecting to deployement:
|
||
|
|
|
||
|
|
connect https://exegol.swgalaxy:2000 deployment ogg_exegol_deploy as admin
|
||
|
|
|
||
|
|
Add in the credentialstore enteries for database connections:
|
||
|
|
|
||
|
|
create wallet
|
||
|
|
add credentialstore
|
||
|
|
alter credentialstore add user c##oggadmin@wayland/JEDIPRD password "Secret00!" alias JEDIPRD
|
||
|
|
alter credentialstore add user c##oggadmin@wayland/YODA password "Secret00!" alias YODA
|
||
|
|
info credentialstore
|
||
|
|
|
||
|
|
Test database connections:
|
||
|
|
|
||
|
|
dblogin useridalias JEDIPRD
|
||
|
|
dblogin useridalias YODA
|
||
|
|
|
||
|
|
To delete a user from credential store:
|
||
|
|
|
||
|
|
alter credentialstore delete user JEDIPRD
|
||
|
|
|
||
|
|
> IMPORTANT: in a database **MULTITENANT** architecture, Golden Gate is working at `CDB$ROOT` level.
|
||
|
|
|
||
|
|
Create the checkpoint table:
|
||
|
|
|
||
|
|
dblogin useridalias JEDIPRD
|
||
|
|
add checkpointtable YODA.c##oggadmin.checkpt
|
||
|
|
|
||
|
|
Set **global** parameters:
|
||
|
|
|
||
|
|
edit GLOBALS
|
||
|
|
|
||
|
|
Put:
|
||
|
|
|
||
|
|
ggschema c##oggadmin
|
||
|
|
checkpointtable YODA.c##oggadmin.checkpt
|
||
|
|
|
||
|
|
|
||
|
|
## Setup `helska` Golden Gate deployment
|
||
|
|
|
||
|
|
adminclient
|
||
|
|
connect https://helska.swgalaxy:2000 deployment ogg_helska_deploy as OGGADMIN password "Secret00!"
|
||
|
|
|
||
|
|
Optionaly store credentials to connect to deployement:
|
||
|
|
|
||
|
|
add credentials admin user OGGADMIN password "Secret00!"
|
||
|
|
|
||
|
|
Now we can hide the password when conecting to deployement:
|
||
|
|
|
||
|
|
connect https://helska.swgalaxy:2000 deployment ogg_helska_deploy as admin
|
||
|
|
|
||
|
|
Add in the credentialstore enteries for database connections:
|
||
|
|
|
||
|
|
alter credentialstore add user c##oggadmin@togoria/SITHPRD password "Secret00!" alias SITHPRD
|
||
|
|
alter credentialstore add user c##oggadmin@togoria/MAUL password "Secret00!" alias MAUL
|
||
|
|
info credentialstore
|
||
|
|
|
||
|
|
Test database connections:
|
||
|
|
|
||
|
|
dblogin useridalias SITHPRD
|
||
|
|
dblogin useridalias MAUL
|
||
|
|
|
||
|
|
Create the checkpoint table:
|
||
|
|
|
||
|
|
dblogin useridalias SITHPRD
|
||
|
|
add checkpointtable MAUL.c##oggadmin.checkpt
|
||
|
|
|
||
|
|
Set **global** parameters:
|
||
|
|
|
||
|
|
edit GLOBALS
|
||
|
|
|
||
|
|
Put:
|
||
|
|
|
||
|
|
ggschema c##oggadmin
|
||
|
|
checkpointtable MAUL.c##oggadmin.checkpt
|
||
|
|
|