oracle ogg 单实例双向复制搭建(oracle-oracle)--Oracle GoldenGate
发布日期:2025-04-29 12:28:20 浏览次数:14 分类:精选文章

本文共 3248 字,大约阅读时间需要 10 分钟。

Oracle GoldenGate?OGG????????

Oracle GoldenGate?OGG?????

???????????? Oracle GoldenGate?OGG??????????????????orcl????????ogg????????????????????????????????????

1. Oracle GoldenGate?OGG?????

??????????????????????????????

  • ?????????????orcl????????ogg??? Oracle 11.2.0.4?
  • ??????????? CentOS 6.5?
  • Oracle GoldenGate ?????? /u01/app/ogg ???

2. DDL ????

Oracle GoldenGate ?? DDL ????????????????

2.1 DDL ??????

?? Oracle GoldenGate ???ogg????????? DDL ????????? SQL ???

grant CONNECT, RESOURCE to ogg;grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;grant ALTER ANY TABLE to ogg;grant FLASHBACK ANY TABLE to ogg;grant EXECUTE on DBMS_FLASHBACK to ogg;grant INSERT ANY TABLE to ogg;grant UPDATE ANY TABLE to ogg;grant DELETE ANY TABLE to ogg;grant EXECUTE on UTL_FILE to ogg;grant CREATE TABLE, CREATE SEQUENCE to ogg;grant CREATE VIEW to ogg;grant CREATE PROCEDURE to ogg;grant CREATE INDEX to ogg;grant CREATE TRIGGER to ogg;

2.2 ????

????????? DDL ?????

# Marketer SetupSYS@ orcl > @/u01/app/ogg/marker_setup.sql# DDL SetupSYS@ orcl > @/u01/app/ogg/ddl_setup.sql# Role SetupSYS@ orcl > @/u01/app/ogg/role_setup.sql# Enable DDL ReplicationSYS@ orcl > @/u01/app/ogg/ddl_enable.sql

2.3 ??????

????????????????????

# ???? 1SYS@ orcl > @/u01/app/ogg/ddl_setup.sqlLine/pos: 126/9, PL/SQL: SQL ?????

??????????????????????????

3. ??????

??? DDL ????????????????????????????????

3.1 ??????

??????? archive mode??????????????

# ??????mkdir -p /u01/app/oracle/dump

3.2 ??????

?????????????

# ?????????expdp scott@orcl /orcl schemas=scott directory=/u01/app/oracle/dump dumpfile=scott_schemas_%Y%m%d.dmp# ??????impdp scott@ogg /orcl schemas=scott directory=/u01/app/oracle/dump dumpfile=scott_schemas_%Y%m%d.dmp

4. Oracle GoldenGate Manager ??

?? Oracle GoldenGate Manager????????????

# ?? params ??> edit params mgrport 7839> DYNAMICPORTLIST 7840-7850> AUTOSTART EXTRACT *> AUTORESTART EXTRACT *> RETRIES 5> WAITMINUTES 3> PURGEOLDEXTRACTS ./dirdat/*> usecheckpoints> minkeepdays 7> LAGREPORTHOURS 1> LAGINFOMINUTES 30> LAGCRITICALMINUTES 45

5. Extract ? Replicat ??

?? Extract ? Replicat ?????

5.1 Extract ??

# ?? Extract ????> add extract ext1, tranlog, begin now> edit param ext1> MEGABYTES 100> REPORTCOUNT EVERY 1 MINUTES> DISCARDFILE ./dirrpt/ext1.dsc> APPEND> MEGABYTES 1024> DISCARDROLLOVER AT 3:00> exttrail ./dirdat/r1,megabytes 100> include all ddl & include mapped objtype 'table' & include mapped objtype 'index'> table scott.emp_ogg; table scott.dept_ogg; table scott.dept

5.2 Replicat ??

# ?? Replicat ????> add replicat rep1> edit param rep1> MEGABYTES 1000> REPORTCOUNT EVERY 30 MINUTES> DISCARDFILE ./dirrpt/rep1.dsc> APPEND> DISCARDROLLOVER AT 3:00> checkpointtable ogg.ggschkpt> map scott.emp_ogg, target scott.emp_ogg> map scott.dept_ogg, target scott.dept_ogg> map scott.dept, target scott.dept> start rep1

6. ?? Extract ? Replicat

# ?? Extract> start ext1# ?? Pump> start pump1# ?? Replicat> start rep1

7. ????

???????????????

# ?? Extract ??GGSCI (DSI) 5 > info all

8. ????

?????????????????

  • ??????? /u01/app/ogg/ggserr.log ???
  • ??????? Oracle GoldenGate ???ogg????????
  • ??????????????????

??

?????????????????? Oracle GoldenGate?OGG???????????????Oracle GoldenGate ????????????????????????????????????????????????? Oracle ????????????

上一篇:Oracle ora-12514报错解决方法
下一篇:ORACLE MERGE INTO (2)

发表评论

最新留言

很好
[***.229.124.182]2026年06月04日 01时22分03秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章