概览:Oracle GoldenGate 的实现原理是通过抽取源端的 redo log 或者 archive log, 然后通 过
Oracle GoldenGate 的实现原理是通过抽取源端的 redo log 或者 archive log, 然后通 过 TCP/IP 投
递到目标端,再在目标端进行解析并还原,使目标端数据库实现与源端数据库的实 时数据同步。
Oracle GoldenGate 重要组件:Manager 进程、Extract 进程、Checkpoint 文件、Pump 进程、
Replicat 进程、Trail 文件、GGSCI。
实验环境准备:
设置参数
GoldenGate 环境变量设置:vim ~/.bash_profile
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/gg/11.2:$LD_LIBRARY_PATH
export GG_HOME=/u01/gg/11.2
export PATH=/u01/gg/11.2:$PATH
GoldenGate 的安装:
在源端和目标端分别启动./ggsci,执行create subdirs命令
源端数据库的配置
创建 GoldenGate 复制用户
create user gg_user identified by gg_user default tablespace users temporary tablespace temp;
grant connect, resource, dba, unlimited tablespace to gg_user;
grant execute on utl_file to gg_user;
exec dbms_GoldenGate_auth.grant_admin_privilege('gg_user');
commit;
打开数据库归档、辅助日志功能
shutdown immediate
startup mount
alter database archivelog;
alter database add supplemental log data;
alter system set recyclebin=off scope=spfile;
alter database force logging;
查看并确认设置结果
shutdown immediate;
startup;
show parameter recyclebin;
select log_mode, supplemental_log_data_min, force_logging from v$database;