ITPub博客

使用GI Agent(XAG)实现GoldenGate的高可用性(二)

原创 Oracle 作者:hooca 时间:2016-07-08 17:03:52 0 删除 编辑
OS:Oracle Linux 6.6 x64,Windows Server 2008 R2 x64
DB:Oracle 12.1.2.0

参考:使用GI Agent(XAG)实现GoldenGate的高可用性(一) 

一、XAG
从11.2.0.3以后,XAG作为GI安装的一部分,无需额外安装。但XAG的新版本需独立安装。
综上,建议安装新版本XAG。
下载页:http://oracle.com/goto/clusterware

解压到任意目录,在其中一个节点以grid用户执行安装:

点击(此处)折叠或打开

  1. ./xagsetup.sh --install --directory /u01/xag_v7 --all_nodes
  2. Installing Oracle Grid Infrastructure Agents on: node1
  3. Installing Oracle Grid Infrastructure Agents on: node2
  4. Done.
在所有节点为grid设置环境变量XAG_HOME,并把$XAG_HOM/binE加入PATH,置于$ORACLE_HOME/bin之前。

可以确认XAG版本:

点击(此处)折叠或打开

  1. $ agctl query releaseversion
  2. The Oracle Grid Infrastructure Agents release version is 7.1.0

二、ACFS
详见:12c ASM中创建ACFS 

三、安装GoldenGate
在ACFS上安装GoldenGate。只需在一个节点上操作。安装完成后在所有节点配置相关变量。

四、配置GoldenGate的VIP和Agent

首先,以root用户新建一个VIP

点击(此处)折叠或打开

  1. /u01/app/12.1.0/grid/bin/appvipcfg create \
  2. -network=1 \
  3. -ip=192.168.6.99 \
  4. -vipname=xag.ggs_1-vip.vip \
  5. -user=oracle
以root用户运行,使oracle用户能够管理VIP。

点击(此处)折叠或打开

  1. /u01/app/12.1.0/grid/bin/crsctl setperm resource xag.ggs_1-vip.vip -u user:oracle:r-x
接下来可以用oracle用户启动VIP:

点击(此处)折叠或打开

  1. /u01/app/12.1.0/grid/bin/crsctl start resource xag.ggs_1-vip.vip
查看结果:

点击(此处)折叠或打开

  1. /u01/app/12.1.0/grid/bin/crsctl status resource xag.ggs_1-vip.vip
  2. NAME=xag.ggs_1-vip.vip
  3. TYPE=app.appvipx.type
  4. TARGET=ONLINE
  5. STATE=ONLINE on node2
创建GoldenGate的Agent,以GoldenGate的所有者oracle用户运行:

点击(此处)折叠或打开

  1. $XAG_HOME/bin/agctl add goldengate ggs_1 \
  2. --gg_home /u01/ggs_1 \
  3. --instance_type source \
  4. --nodes node1,node2 \
  5. --vip_name xag.ggs_1-vip.vip \
  6. --filesystems ora.acfs1.acfs1.acfs \
  7. --databases ora.racdb.db \
  8. --oracle_home /u01/app/oracle/product/12.1.0/db_1 \
  9. --monitor_extracts ext1,pmp1
注意databases参数的写法。

接下来查看资源:

点击(此处)折叠或打开

  1. crsctl status resource xag.ggs_1.goldengate -f
五、配置GoldenGate
参考:12c多租户架构下部署GoldenGate 12c 

六、测试

当前状态

点击(此处)折叠或打开

  1. crsctl stat res -t

  2. xag.ggs_1-vip.vip
  3.       1 ONLINE ONLINE node2 STABLE
  4. xag.ggs_1.goldengate
  5.       1 ONLINE ONLINE node2 STABLE
尝试切换到node1

点击(此处)折叠或打开

  1. agctl relocate goldengate ggs_1 --node node1
当前状态变为:

点击(此处)折叠或打开

  1. xag.ggs_1-vip.vip
  2.       1 ONLINE ONLINE node1 STABLE
  3. xag.ggs_1.goldengate
  4.       1 ONLINE ONLINE node1 STABLE
同时也要登录ggsci,确认GoldenGate进程状态:

点击(此处)折叠或打开

  1. > info all

  2. Program Status Group Lag at Chkpt Time Since Chkpt

  3. MANAGER RUNNING
  4. EXTRACT RUNNING EXT1 00:02:34 00:00:02
  5. EXTRACT RUNNING PMP1 00:00:00 00:00:10
如果是意外中断一个节点(断电),GoldenGate在另一节点上的恢复并不理想。具体表现为:

1)Manager, Extract进程能自动启动;
2)Pump进程自启动失败,出现报错:

点击(此处)折叠或打开

  1. ERROR OGG-06601 Oracle GoldenGate Capture for Oracle, pmp1.prm: Mismatch between the length of seqno from checkpoint (9) and recovery (6) for extract trail E:\ggs_1\dirdat\rt.
3)在手动启动Pump进程后,恢复正常,日志输出如下:

点击(此处)折叠或打开

  1. 2016-07-11 17:04:47 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, pmp1.prm: EXTRACT PMP1 started.
  2. 2016-07-11 17:05:12 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info all.
  3. 2016-07-11 17:05:16 INFO OGG-01226 Oracle GoldenGate Capture for Oracle, pmp1.prm: Socket buffer size set to 27985 (flush size
  4. 27985).
  5. 2016-07-11 17:05:16 INFO OGG-01055 Oracle GoldenGate Capture for Oracle, pmp1.prm: Recovery initialization completed for target file E:\ggs_1\dirdat\rt000000006, at RBA 1505.
  6. 2016-07-11 17:05:16 INFO OGG-01055 Oracle GoldenGate Capture for Oracle, pmp1.prm: Recovery initialization completed for target file E:\ggs_1\dirdat\st000000007, at RBA 1505.
  7. 2016-07-11 17:05:16 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, pmp1.prm: Output file E:\ggs_1\dirdat\rt is using format RELEASE 12.2.
  8. 2016-07-11 17:05:17 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, pmp1.prm: Output file E:\ggs_1\dirdat\st is using format RELEASE 12.2.
  9. 2016-07-11 17:05:18 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, pmp1.prm: Rolling over remote file E:\ggs_1\dirdat\rt000000007.
  10. 2016-07-11 17:05:19 INFO OGG-01053 Oracle GoldenGate Capture for Oracle, pmp1.prm: Recovery completed for target file E:\ggs_1\dirdat\rt000000007, at RBA 807.
  11. 2016-07-11 17:05:19 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, pmp1.prm: Rolling over remote file E:\ggs_1\dirdat\st000000008.
  12. 2016-07-11 17:05:19 INFO OGG-01053 Oracle GoldenGate Capture for Oracle, pmp1.prm: Recovery completed for target file E:\ggs_1\dirdat\st000000008, at RBA 807.
  13. 2016-07-11 17:05:19 INFO OGG-01057 Oracle GoldenGate Capture for Oracle, pmp1.prm: Recovery completed for all targets.
  14. 2016-07-11 17:05:21 INFO OGG-02243 Oracle GoldenGate Capture for Oracle, pmp1.prm: Opened trail file /u01/ggs_1/dirdat/lt000000004 at 2016-07-11 17:05:21.173524.
  15. 2016-07-11 17:05:21 INFO OGG-02232 Oracle GoldenGate Capture for Oracle, pmp1.prm: Switching to next trail file /u01/ggs_1/dirdat/lt000000005 at 2016-07-11 17:05:21.639963 due to EOF. with current RBA 1,463.
  16. 2016-07-11 17:05:21 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, pmp1.prm: Rolling over remote file E:\ggs_1\dirdat\rt000000008.
  17. 2016-07-11 17:05:22 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, pmp1.prm: Rolling over remote file E:\ggs_1\dirdat\st000000009.

接上继续,鉴于以上情况,务必在Manager进程中加上AUTORESTART参数。但最好还是要人工登录查看状态。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22621861/viewspace-2121744/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 12c ASM中创建ACFS
请登录后发表评论 登录
全部评论

注册时间:2009-09-29

  • 博文量
    206
  • 访问量
    369637