Oracle RAC环境下配置与管理goldengate HA主备服务

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1012

Oracle RAC环境下配置与管理goldengate HA主备服务

[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,](转载)在本文中将介绍在oracle 11g r2 rac环境下使用grid infrastructure来管理ogg服务,在开始之前,请先按照前文的步骤配置好rac(source)同单实例(target)数据库之间的ogg单向同步,同时确保rac数据库各项服务运行正常,同时启动target端的数据库实例和ogg的mgr,replicat进程,source端ogg的mgr,extract,extract dump进程可以关闭![p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]一:查看rac各服务是否online,这里3个gsd服务offline属于正常情况![list=1]
[*][backcolor=inherit][root@rac1 bin]# ./crs_stat -t -v
[*][backcolor=inherit]Name Type R/RA F/FT Target State Host
[*][backcolor=inherit]----------------------------------------------------------------------
[*][backcolor=inherit]ora.ACFS.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.CRS.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.FRA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora....N2.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora....N3.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
[*][backcolor=inherit]ora....network ora....rk.type 1/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.rac.db ora....se.type 0/1 0/1 ONLINE ONLINE rac1
[*][backcolor=inherit]ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE
[*][backcolor=inherit]ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE
[*][backcolor=inherit]ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac1
[*][backcolor=inherit]ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]ora.scan2.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]ora.scan3.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1
[*][backcolor=inherit]

[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]二:在source端添加VIP,并赋权限,检查vip是否能正常启动,在本例中运行grid infrastructure的操作系统用户为grid,运行ogg的操作系统用户为oracle[list=1]
[*][backcolor=inherit][root@rac1 bin]# ./crsctl stat res -p |grep -ie .network -ie subnet |grep -ie name -ie [backcolor=inherit]subnet
[*][backcolor=inherit]NAME[backcolor=inherit]=[backcolor=inherit]ora[backcolor=inherit].net1.network
[*][backcolor=inherit]USR_ORA_SUBNET[backcolor=inherit]=[backcolor=inherit]192[backcolor=inherit].168.1.0
[*][backcolor=inherit]
[*][backcolor=inherit][root@rac1 bin]# ./appvipcfg create [backcolor=inherit]-network[backcolor=inherit]=[backcolor=inherit]1[backcolor=inherit] \
[*][backcolor=inherit]-ip[backcolor=inherit]=[backcolor=inherit]192[backcolor=inherit].168.1.150 \
[*][backcolor=inherit]-vipname[backcolor=inherit]=[backcolor=inherit]oggvip[backcolor=inherit] \
[*][backcolor=inherit]-user[backcolor=inherit]=[backcolor=inherit]root[backcolor=inherit]
[*][backcolor=inherit]
[*][backcolor=inherit][root@rac1 bin]# ./crsctl setperm resource oggvip -u user:oracle:r-x
[*][backcolor=inherit][root@rac1 bin]# ./crsctl status resource oggvip
[*][backcolor=inherit]NAME[backcolor=inherit]=[backcolor=inherit]oggvip[backcolor=inherit]
[*][backcolor=inherit]TYPE[backcolor=inherit]=[backcolor=inherit]app[backcolor=inherit].appvip_net1.type
[*][backcolor=inherit]TARGET[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit]
[*][backcolor=inherit]STATE[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit]
[*][backcolor=inherit]
[*][backcolor=inherit][root@rac1 bin]# ./crsctl start resource oggvip
[*][backcolor=inherit]CRS-2672: Attempting to start 'oggvip' on 'rac1'
[*][backcolor=inherit]CRS-2676: Start of 'oggvip' on 'rac1' succeeded
[*][backcolor=inherit][root@rac1 bin]# ip a |grep 192.168.1.150
[*][backcolor=inherit] inet 192.168.1.150/24 brd 192.168.1.255 scope global secondary eth0:2
[*][backcolor=inherit][root@rac1 bin]# ./crsctl status resource oggvip
[*][backcolor=inherit]NAME[backcolor=inherit]=[backcolor=inherit]oggvip[backcolor=inherit]
[*][backcolor=inherit]TYPE[backcolor=inherit]=[backcolor=inherit]app[backcolor=inherit].appvip_net1.type
[*][backcolor=inherit]TARGET[backcolor=inherit]=[backcolor=inherit]ONLINE[backcolor=inherit]
[*][backcolor=inherit]STATE[backcolor=inherit]=[backcolor=inherit]ONLINE[backcolor=inherit] on rac1
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]三:配置action脚本,该脚本必须包含start,stop,check,clean,abort几个函数,才能用于后续的grid infrastructure调用,这里把脚本直接放在acfs文件系统上,以便节点间共享[list=1]
[*][backcolor=inherit][root@rac1 bin]# chmod +x /vol2/ogg/11gr2_ogg_action.scr
[*][backcolor=inherit][root@rac1 bin]# ll /vol2/ogg/11gr2_ogg_action.scr
[*][backcolor=inherit]-rwxr-xr-x 1 oracle oinstall 2483 Jul 17 21:01 /vol2/ogg/11gr2_ogg_action.scr
[*][backcolor=inherit]
[*][backcolor=inherit][root@rac1 bin]# cat /vol2/ogg/11gr2_ogg_action.scr
[*][backcolor=inherit]#!/bin/sh
[*][backcolor=inherit]#set the Oracle Goldengate installation directory
[*][backcolor=inherit]export [backcolor=inherit]GGS_HOME[backcolor=inherit]=/vol2/ogg
[*][backcolor=inherit]#set the oracle home to the database to ensure GoldenGate will get the
[*][backcolor=inherit]#right environment settings to be able to connect to the database
[*][backcolor=inherit]export [backcolor=inherit]ORACLE_HOME[backcolor=inherit]=/u01/app/oracle/product/11.2.0/db1
[*][backcolor=inherit]#specify delay after start before checking for successful start
[*][backcolor=inherit]start_delay_secs[backcolor=inherit]=[backcolor=inherit]5[backcolor=inherit]
[*][backcolor=inherit]#Include the GoldenGate home in the library path to start GGSCI
[*][backcolor=inherit]export [backcolor=inherit]LD_LIBRARY_PATH[backcolor=inherit]=$ORACLE_HOME/lib:${GGS_HOME}:${LD_LIBRARY_PATH}
[*][backcolor=inherit]#check_process validates that a manager process is running at the PID
[*][backcolor=inherit]#that GoldenGate specifies.
[*][backcolor=inherit]
[*][backcolor=inherit]check_process () {
[*][backcolor=inherit]if ( [ -f "${GGS_HOME}/dirpcs/MGR.pcm" ] )
[*][backcolor=inherit]then
[*][backcolor=inherit] [backcolor=inherit]pid[backcolor=inherit]=`cut -f8 "${GGS_HOME}/dirpcs/MGR.pcm"`
[*][backcolor=inherit] if [ ${pid} = `ps -e |grep ${pid} |grep mgr |cut -d " " -f2` ]
[*][backcolor=inherit] then
[*][backcolor=inherit] #manager process is running on the PID exit success
[*][backcolor=inherit] exit 0
[*][backcolor=inherit] else
[*][backcolor=inherit] if [ ${pid} = `ps -e |grep ${pid} |grep mgr |cut -d " " -f1` ]
[*][backcolor=inherit] then
[*][backcolor=inherit] #manager process is running on the PID exit success
[*][backcolor=inherit] exit 0
[*][backcolor=inherit] else
[*][backcolor=inherit] #manager process is not running on the PID
[*][backcolor=inherit] exit 1
[*][backcolor=inherit] fi
[*][backcolor=inherit]fi
[*][backcolor=inherit]else
[*][backcolor=inherit] #manager is not running because there is no PID file
[*][backcolor=inherit] exit 1
[*][backcolor=inherit]fi
[*][backcolor=inherit]}
[*][backcolor=inherit]
[*][backcolor=inherit]#call_ggsci is a generic routine that executes a ggsci command
[*][backcolor=inherit]call_ggsci () {
[*][backcolor=inherit] [backcolor=inherit]ggsci_command[backcolor=inherit]=$1
[*][backcolor=inherit] [backcolor=inherit]ggsci_output[backcolor=inherit]=`${GGS_HOME}/ggsci[color=rgb(0, 102, 153)][backcolor=inherit]<[color=rgb(0, 102, 153)][backcolor=inherit]<[color=rgb(0, 102, 153)][backcolor=inherit]EOF[backcolor=inherit] [*][backcolor=inherit] ${ggsci_command} [*][backcolor=inherit] exit [*][backcolor=inherit] EOF` [*][backcolor=inherit]} [*][backcolor=inherit] [*][backcolor=inherit]case $1 in [*][backcolor=inherit]'start') [*][backcolor=inherit] #start manager [*][backcolor=inherit] call_ggsci 'start manager' [*][backcolor=inherit] #there is a small delay between issuing the start manager command [*][backcolor=inherit] #and the process being spawned on the OS. wait before checking [*][backcolor=inherit] sleep ${start_delay_secs} [*][backcolor=inherit] #check whether manager is running and exit accordingly [*][backcolor=inherit] check_process [*][backcolor=inherit] ;; [*][backcolor=inherit]'stop') [*][backcolor=inherit] #attempt a clean stop for all non-manager processes [*][backcolor=inherit] #call_ggsci 'stop er *' [*][backcolor=inherit] #ensure everything is stopped [*][backcolor=inherit] call_ggsci 'stop er *!' [*][backcolor=inherit] #call_ggsci 'kill er *' [*][backcolor=inherit] #stop manager without (y/n) confirmation [*][backcolor=inherit] call_ggsci 'stop manager!' [*][backcolor=inherit] #exit success [*][backcolor=inherit] exit 0 [*][backcolor=inherit] ;; [*][backcolor=inherit]'check') [*][backcolor=inherit] check_process [*][backcolor=inherit] ;; [*][backcolor=inherit]'clean') [*][backcolor=inherit] #attempt a clean stop for all non-manager processes [*][backcolor=inherit] #call_ggsci 'stop er *' [*][backcolor=inherit] #ensure everything is stopped [*][backcolor=inherit] #call_ggsci 'stop er *!' [*][backcolor=inherit] #in case there are lingering processes [*][backcolor=inherit] call_ggsci 'kill er *' [*][backcolor=inherit] #stop manager without (y/n) confirmation [*][backcolor=inherit] call_ggsci 'stop manager!' [*][backcolor=inherit] #exit success [*][backcolor=inherit] exit 0 [*][backcolor=inherit] ;; [*][backcolor=inherit]'abort') [*][backcolor=inherit] #ensure everything is stopped [*][backcolor=inherit] call_ggsci 'stop er *!' [*][backcolor=inherit] #in case there are lingering processes [*][backcolor=inherit] call_ggsci 'kill er *' [*][backcolor=inherit] #stop manager without (y/n) confirmation [*][backcolor=inherit] call_ggsci 'stop manager!' [*][backcolor=inherit] #exit success [*][backcolor=inherit] exit 0 [*][backcolor=inherit] ;; [*][backcolor=inherit]esac [p=28, null, left][color=rgb(44, 44, 44)][font=宋体,] [p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]四:使用oracle用户添加oggapp,并授权给oracle用户管理[list=1] [*][backcolor=inherit][oracle@rac1 ~]$ crsctl add resource oggapp -type cluster_resource \ [*][backcolor=inherit]-attr "[backcolor=inherit]ACTION_SCRIPT[backcolor=inherit]=/vol2/ogg/11gr2_ogg_action.scr, \ [*][backcolor=inherit]CHECK_INTERVAL[backcolor=inherit]=[backcolor=inherit]30[backcolor=inherit], [backcolor=inherit]START_DEPENDENCIES[backcolor=inherit]='hard(oggvip,ora.asm) \ [*][backcolor=inherit]pullup(oggvip)', [backcolor=inherit]STOP_DEPENDENCIES[backcolor=inherit]=[backcolor=inherit]'hard(oggvip)'[backcolor=inherit]" [*][backcolor=inherit] [*][backcolor=inherit][oracle@rac1 ~]$ crsctl status resource oggapp [*][backcolor=inherit]NAME[backcolor=inherit]=[backcolor=inherit]oggapp[backcolor=inherit] [*][backcolor=inherit]TYPE[backcolor=inherit]=[backcolor=inherit]cluster_resource[backcolor=inherit] [*][backcolor=inherit]TARGET[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit] [*][backcolor=inherit]STATE[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit] [*][backcolor=inherit] [*][backcolor=inherit][root@rac1 bin]# pwd [*][backcolor=inherit]/u01/app/11.2.0/grid/bin [*][backcolor=inherit][root@rac1 bin]# ./crsctl setperm resource oggapp -o oracle [p=28, null, left][color=rgb(44, 44, 44)][font=宋体,] [p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]五:检查target端的数据库是否可以正常连接,ogg进程是否运行正常[list=1] [*][backcolor=inherit][root@dg3 ~]# su - oracle [*][backcolor=inherit][oracle@dg3 ~]$ sqlplus test/test [*][backcolor=inherit]SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 18 20:41:13 2012 [*][backcolor=inherit]Copyright (c) 1982, 2011, Oracle. All rights reserved. [*][backcolor=inherit] [*][backcolor=inherit]Connected to: [*][backcolor=inherit]Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production [*][backcolor=inherit]With the Partitioning, OLAP, Data Mining and Real Application Testing options [*][backcolor=inherit] [*][backcolor=inherit]SQL[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] exit
[*][backcolor=inherit]
[*][backcolor=inherit][oracle@dg3 ~]$ cd /u01/app/oracle/ogg/
[*][backcolor=inherit][oracle@dg3 ogg]$ ./ggsci
[*][backcolor=inherit]
[*][backcolor=inherit]Oracle GoldenGate Command Interpreter for Oracle
[*][backcolor=inherit]Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
[*][backcolor=inherit]Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
[*][backcolor=inherit]Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
[*][backcolor=inherit]
[*][backcolor=inherit]GGSCI (dg3.yang.com) 1[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] info all
[*][backcolor=inherit]
[*][backcolor=inherit]Program Status Group Lag at Chkpt Time Since Chkpt
[*][backcolor=inherit]MANAGER RUNNING
[*][backcolor=inherit]REPLICAT RUNNING TESTRPT 00:00:00 00:00:03
[*][backcolor=inherit]
[*][backcolor=inherit]GGSCI (dg3.yang.com) 2[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] exit
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]六:检查source端的数据库是否可以正常连接,ogg进程未启动[list=1]
[*][backcolor=inherit][root@rac1 ~]# su - oracle
[*][backcolor=inherit][oracle@rac1 ~]$ sqlplus test/test@rac
[*][backcolor=inherit]SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 18 20:42:40 2012
[*][backcolor=inherit]Copyright (c) 1982, 2011, Oracle. All rights reserved.
[*][backcolor=inherit]
[*][backcolor=inherit]Connected to:
[*][backcolor=inherit]Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
[*][backcolor=inherit]With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle
[*][backcolor=inherit]
[*][backcolor=inherit]Label Security,
[*][backcolor=inherit]OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
[*][backcolor=inherit]
[*][backcolor=inherit]SQL[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] select * from tab;
[*][backcolor=inherit]
[*][backcolor=inherit]TNAME TABTYPE CLUSTERID
[*][backcolor=inherit]------------------------------ ------- ----------
[*][backcolor=inherit]T1 TABLE
[*][backcolor=inherit]
[*][backcolor=inherit]SQL[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] exit
[*][backcolor=inherit]Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit
[*][backcolor=inherit]
[*][backcolor=inherit]Production
[*][backcolor=inherit]With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle
[*][backcolor=inherit]
[*][backcolor=inherit]Label Security,
[*][backcolor=inherit]OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
[*][backcolor=inherit]
[*][backcolor=inherit][oracle@rac1 ~]$ cd /vol2/ogg/
[*][backcolor=inherit][oracle@rac1 ogg]$ ./ggsci
[*][backcolor=inherit]Oracle GoldenGate Command Interpreter for Oracle
[*][backcolor=inherit]Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
[*][backcolor=inherit]Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
[*][backcolor=inherit]Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
[*][backcolor=inherit]
[*][backcolor=inherit]GGSCI (rac1.yang.com) 1[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] info all
[*][backcolor=inherit]
[*][backcolor=inherit]Program Status Group Lag at Chkpt Time Since Chkpt
[*][backcolor=inherit]MANAGER STOPPED
[*][backcolor=inherit]EXTRACT ABENDED TESTEXT 00:00:00 22:54:53
[*][backcolor=inherit]EXTRACT ABENDED TESTPUMP 00:00:00 22:55:41
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]七:使用oracle用户启动oggapp resource,检查source(rac1)上的ogg进程是否成功启动[list=1]
[*][backcolor=inherit][oracle@rac1 ~]$ crsctl status resource oggapp
[*][backcolor=inherit]NAME[backcolor=inherit]=[backcolor=inherit]oggapp[backcolor=inherit]
[*][backcolor=inherit]TYPE[backcolor=inherit]=[backcolor=inherit]cluster_resource[backcolor=inherit]
[*][backcolor=inherit]TARGET[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit]
[*][backcolor=inherit]STATE[backcolor=inherit]=[backcolor=inherit]OFFLINE[backcolor=inherit]
[*][backcolor=inherit]
[*][backcolor=inherit][oracle@rac1 ~]$ crsctl start resource oggapp
[*][backcolor=inherit]CRS-2672: Attempting to start 'oggapp' on 'rac1'
[*][backcolor=inherit]CRS-2676: Start of 'oggapp' on 'rac1' succeeded
[*][backcolor=inherit]
[*][backcolor=inherit][oracle@rac1 ~]$ cd /vol2/ogg/
[*][backcolor=inherit][oracle@rac1 ogg]$ ./ggsci
[*][backcolor=inherit]Oracle GoldenGate Command Interpreter for Oracle
[*][backcolor=inherit]Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
[*][backcolor=inherit]Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
[*][backcolor=inherit]Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
[*][backcolor=inherit]
[*][backcolor=inherit]GGSCI (rac1.yang.com) 1[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] info all
[*][backcolor=inherit]
[*][backcolor=inherit]Program Status Group Lag at Chkpt Time Since Chkpt
[*][backcolor=inherit]MANAGER RUNNING
[*][backcolor=inherit]EXTRACT RUNNING TESTEXT 00:00:00 00:00:07
[*][backcolor=inherit]EXTRACT RUNNING TESTPUMP 00:00:00 23:18:23
[*][backcolor=inherit]
[*][backcolor=inherit][oracle@rac1 ~]$ crs_stat -t -v oggapp
[*][backcolor=inherit]Name Type R/RA F/FT Target State Host
[*][backcolor=inherit]----------------------------------------------------------------------
[*][backcolor=inherit]oggapp clus...esource 0/1 0/0 ONLINE ONLINE rac1
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]八:测试failover[list=1]
[*][backcolor=inherit][oracle@rac1 ~]$ crsctl relocate resource oggapp -f
[*][backcolor=inherit]CRS-2673: Attempting to stop 'oggapp' on 'rac1'
[*][backcolor=inherit]CRS-2677: Stop of 'oggapp' on 'rac1' succeeded
[*][backcolor=inherit]CRS-2673: Attempting to stop 'oggvip' on 'rac1'
[*][backcolor=inherit]CRS-2677: Stop of 'oggvip' on 'rac1' succeeded
[*][backcolor=inherit]CRS-2672: Attempting to start 'oggvip' on 'rac2'
[*][backcolor=inherit]CRS-2676: Start of 'oggvip' on 'rac2' succeeded
[*][backcolor=inherit]CRS-2672: Attempting to start 'oggapp' on 'rac2'
[*][backcolor=inherit]CRS-2676: Start of 'oggapp' on 'rac2' succeeded
[*][backcolor=inherit][oracle@rac1 ~]$ crs_stat -t -v oggapp
[*][backcolor=inherit]Name Type R/RA F/FT Target State Host
[*][backcolor=inherit]----------------------------------------------------------------------
[*][backcolor=inherit]oggapp clus...esource 0/1 0/0 ONLINE ONLINE rac2
[*][backcolor=inherit]
[*][backcolor=inherit][root@rac2 ~]# su - oracle
[*][backcolor=inherit][oracle@rac2 ~]$ cd /vol2/ogg/
[*][backcolor=inherit][oracle@rac2 ogg]$ ./ggsci
[*][backcolor=inherit]
[*][backcolor=inherit]Oracle GoldenGate Command Interpreter for Oracle
[*][backcolor=inherit]Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
[*][backcolor=inherit]Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
[*][backcolor=inherit]Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
[*][backcolor=inherit]
[*][backcolor=inherit]GGSCI (rac2.yang.com) 1[color=rgb(0, 102, 153)][backcolor=inherit]>[backcolor=inherit] info all
[*][backcolor=inherit]Program Status Group Lag at Chkpt Time Since Chkpt
[*][backcolor=inherit]
[*][backcolor=inherit]MANAGER RUNNING
[*][backcolor=inherit]EXTRACT RUNNING TESTEXT 00:00:00 00:00:05
[*][backcolor=inherit]EXTRACT ABENDED TESTPUMP 00:00:00 23:24:30
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]
[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]九:排错与停止oggapp服务,view report testpump查看日志报错如下[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]2012-07-18 21:05:59 ERROR OGG-01031 There is a problem in network communication, a remote file problem, encryption keys for target and source do not match (if using ENCRYPT) or an unknown error.(Reply received is Unable to open file "/vol2/ogg/dirdat/rt000001" (error 11, Resource temporarily unavailable)).[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]2012-07-18 21:05:59 ERROR OGG-01668 PROCESS ABENDING.
GGSCI (rac2.yang.com) 15> alter extract testpump etrollover[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]2012-07-18 21:20:40 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically.
EXTRACT altered.[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]GGSCI (rac2.yang.com) 18> info all[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING TESTEXT 00:00:00 00:00:00
EXTRACT RUNNING TESTPUMP 00:00:00 00:00:10 [p=28, null, left][color=rgb(44, 44, 44)][font=宋体,][oracle@rac2 ogg]$ crsctl stop resource oggapp
CRS-2673: Attempting to stop 'oggapp' on 'rac2'
CRS-2677: Stop of 'oggapp' on 'rac2' succeeded[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,][oracle@rac2 ogg]$ crsctl status resource oggapp
NAME=oggapp
TYPE=cluster_resource
TARGET=OFFLINE
STATE=OFFLINE[p=28, null, left][color=rgb(44, 44, 44)][font=宋体,]如果停止使用grid infrastructure来管理ogg进程,只需要使用crsctl命令删除oggapp和oggvip服务即可!需要值得注意的是,如果使用grid infrastructure来管理ogg,则mgr进程的参数文件中必须要配置autostart和autorestart选项!参考文档:(感谢作者分享)
[color=#789d20]http://blog.sina.com.cn/s/blog_6f1123420100qgl8.html
[color=#789d20]http://www.rickyzhu.com/2311_config-ha-goldengate.html
[color=#789d20]http://www.oracle.com/technetwork/middleware/goldengate/overview/ha-goldengate-whitepaper-128197.pdf

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】