Files
notes/Golden_Gate/ogg_01.txt
2026-03-12 22:01:38 +01:00

75 lines
1.7 KiB
Plaintext

https://www.dbi-services.com/blog/setting-up-a-sample-replication-with-goldengate/
# source: 19c database, schema OTTER, NON-CDB //togoria:1521/ANDOPRD
# target: 21c database, schema BEAVER, PDB //bakura:1521/WOMBAT
-- on source DB
create user OTTER identified by "K91@9kLorg1j_7OxV";
grant connect,resource to OTTER;
alter user OTTER quota unlimited on USERS;
-- on target DB
create user BEAVER identified by "Versq99#LerB009aX";
grant connect,resource to BEAVER;
alter user BEAVER quota unlimited on USERS;
# on BOTH databases
###################
# check if ARCHIVELOG mode is ON
archive log list;
# activate integrated OGG replication
alter system set enable_goldengate_replication=TRUE scope=both sid='*';
# put databases in FORCE LOGGING mode
alter database force logging;
# add suplimental log
alter database add supplemental log data;
# create a GoldenGate admin user
create user OGGADMIN identified by "eXtpam!ZarghOzVe81p@1";
grant create session to OGGADMIN;
grant select any dictionary to OGGADMIN;
exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE ('OGGADMIN');
grant flashback any table to OGGADMIN;
# test GoldenGate admin user connections
sqlplus /nolog
connect OGGADMIN/"eXtpam!ZarghOzVe81p@1"@//togoria:1521/ANDOPRD
connect OGGADMIN/"eXtpam!ZarghOzVe81p@1"@//bakura:1521/WOMBAT
# create tables to repliacate on source DB
create table OTTER.T1(d date);
ggsci
create wallet
add credentialstore
alter credentialstore add user OGGADMIN@//togoria:1521/ANDOPRD password "eXtpam!ZarghOzVe81p@1" alias ANDOPRD
info credentialstore
dblogin useridalias ANDOPRD
add trandata OTTER.T1
# cleanup
#########
# on source DB
drop user OTTER cascade;
drop user OGGADMIN cascade;
# on target DB
drop user WOMBAT cascade;
drop user OGGADMIN cascade;