## 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: `NABOOPRD@togoria, PDB: EREP` - target: CDB: `GENOSISPRD@wayland, PDB: GERISS` ## Databases setup for Golden Gate In **both** databases, create Golden Gate admin user in `CDB$ROOT`: ```sql 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: ```sql 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: ```sql alter session set container=EREP; create user R2D2 identified by "Secret00!"; alter user R2D2 quota unlimited on USERS; grant connect,resource to R2D2; connect R2D2/"Secret00!"@togoria/EREP; alter session set container=GERISS; create user C3PO identified by "Secret00!"; alter user C3PO quota unlimited on USERS; grant connect,resource to C3PO; connect C3PO/"Secret00!"@wayland/GERISS; ``` For both Golden Gate hosts (`exegol` and `helska`) `depl26ai` the password of Service Manager administrator has been defined: - username: `oggadmin` - password: `Alabalaportocala00_` and `depl26ai` deployement has been created. > Both username/password are case sensitive. ## 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 depl26ai as oggadmin password "Alabalaportocala00_" Optionaly store credentials to connect to deployement: add credentials admin user oggadmin password "Alabalaportocala00_" Now we can hide the password when conecting to deployement: connect https://exegol.swgalaxy:2000 deployment depl26ai as admin Add in the credentialstore enteries for database connections: add credentialstore alter credentialstore add user c##oggadmin@togoria/NABOOPRD password "Secret00!" alias NABOOPRD alter credentialstore add user c##oggadmin@togoria/EREP password "Secret00!" alias EREP info credentialstore Test database connections: dblogin useridalias NABOOPRD dblogin useridalias EREP To delete a user from credential store: alter credentialstore delete user NABOOPRD > IMPORTANT: in a database **MULTITENANT** architecture, Golden Gate is working at `CDB$ROOT` level. In an Oracle Multitenant architecture (Oracle 19c through 23c), the placement of the Oracle GoldenGate checkpoint table depends on whether you are configuring the Extract (source) or the Replicat (target): 1. Target Side (Replicat): Inside the PDB 2. Source Side (Extract): Root Container (CDB$ROOT) > Integrated Extracts store their recovery checkpoints primarily in the database's internal logmining server metadata and in .cpe checkpoint files on the GoldenGate file system. You do not manually create a standard "checkpoint table" for an Extract in the same way you do for a Replicat > In an Oracle Multitenant environment, the rule is: One Checkpoint Table per PDB, but that table can be shared by multiple Replicats operation in the **same** PDB > When you are using a shared checkpoint table within each PDB, you can set a default in your GLOBALS file to make your life easier. If `EREP` PDB will be a replication target, create the checkpoint table: dblogin useridalias NABOOPRD add checkpointtable EREP.c##oggadmin.checkpt Set **global** parameters: edit GLOBALS Put: ggschema c##oggadmin checkpointtable c##oggadmin.checkpt ## Setup `helska` Golden Gate deployment adminclient connect https://helska.swgalaxy:2000 deployment depl26ai as oggadmin password "Alabalaportocala00_" Optionaly store credentials to connect to deployement: add credentials admin user oggadmin password "Alabalaportocala00_" Now we can hide the password when conecting to deployement: connect https://helska.swgalaxy:2000 deployment depl26ai as admin Add in the credentialstore enteries for database connections: alter credentialstore add user c##oggadmin@wayland/GENOSISPRD password "Secret00!" alias GENOSISPRD alter credentialstore add user c##oggadmin@wayland/GERISS password "Secret00!" alias GERISS info credentialstore Test database connections: dblogin useridalias GENOSISPRD dblogin useridalias GERISS If `GERISS` PDB will be a replication target, create the checkpoint table: dblogin useridalias GENOSISPRD add checkpointtable GERISS.c##oggadmin.checkpt Set **global** parameters: edit GLOBALS Put: ggschema c##oggadmin checkpointtable c##oggadmin.checkpt