日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

11gR2 RAC GoldenGate的HA配置

發(fā)布時(shí)間:2024/8/26 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 11gR2 RAC GoldenGate的HA配置 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
第一步 Add VIP resource for OGG


1. Create new VIP resource, use IP address 10.245.48.47 as example, login as root and run:
# /u01/app/11.2.0/grid/bin/appvipcfg create -network=1 -ip=10.245.48.47 -vipname=ggatevip -user=root
?
NOTE 1: '/u01/app/11.2.0/grid' is the default Oracle GRID infrastructure software directory.
NOTE 2: The example VIP resource name is 'ggatevip' and will be used in the rest of this document.
NOTE 3: -network refers to the network number, default value is '1'.
?
And you can find the network number using this command:
?
# /u01/app/11.2.0/grid/bin/crsctl stat res -p |grep -ie .network -ie
subnet |grep -ie name -ie subnet
NAME=ora.net1.network
USR_ORA_SUBNET=10.245.48.0
net1 indicates this is network 1, and the second line indicates the subnet on which the VIP will be created.
?
2. Allow oracle user to start the VIP, run this command as root:
# /u01/app/11.2.0/grid/bin/crsctl setperm resource ggatevip -u user:oracle:r-x
?
3. Log on as oracle user, start the VIP resource:
$ /u01/app/11.2.0/grid/bin/crsctl start resource ggatevip
?
4. Validate VIP is running:
$ /u01/app/11.2.0/grid/bin/crsctl status resource ggatevip
NAME=ggatevip
TYPE=app.appvip.type
TARGET=ONLINE
STATE=ONLINE on node452
?
?
NOTE: The TARGET and STATE should both be ONLINE.
?
5. Ping the VIP's IP address(10.245.48.47) and make sure it's reachable.
NOTE: If you also prefer to set up HA on target system, follow the same steps, and make necessary changes to directory, VIP resource name, IP address, etc.
第二步 Develop an agent script




1. Save the script in a file 11gr2_gg_action.scr and copy it to OGG directory.
NOTE: Make necessary changes to GGS_HOME(OGG directory) and ORACLE_HOME.
?
2. Make sure the script is executable:
$ chmod +x 11gr2_gg_action.scr
NOTE: If you also prefer to set up HA on target system, follow the same steps, and make necessary changes to GGS_HOME, ORACLE_HOME in this file.


第三步 Register OGG resource in Oracle Clusterware




1. Register OGG as a resource in Oracle Clusterware:
$ /u01/app/11.2.0/grid/bin/crsctl add resource ggateapp -type cluster_resource -attr "ACTION_SCRIPT=/cloudfs/goldengate/11gr2_gg_action.scr, \
CHECK_INTERVAL=30, START_DEPENDENCIES='hard(ggatevip,ora.ggdb.db) \
pullup(ggatevip)', STOP_DEPENDENCIES='hard(ggatevip)'"
?
NOTE 1: 'ggateapp' is the example OGG resource name and will be used in the rest of this document.
NOTE 2: 'ora.ggdb.db' is the resource name for database 'ggdb'.
?
2. Check the ggateapp resource is available as Oracle Clusterware resource:
$ /u01/app/11.2.0/grid/bin/crsctl status resource ggateapp
NAME=ggateapp
TYPE=cluster_resource
TARGET=OFFLINE
STATE=OFFLINE
NOTE: If you also prefer to set up HA on target system, follow the same steps, and make necessary changes to directory, VIP and database resource
name, etc.


第四步 Start the OGG resource


1. Start the resource, from now on you should always use Oracle Clusterware to start OGG:
?
$ /u01/app/11.2.0/grid/bin/crsctl start resource ggateapp
?
2. Check the status of OGG resource:
$ /u01/app/11.2.0/grid/bin/crsctl status resource ggateapp
NAME=ggateapp
TYPE=cluster_resource
TARGET=ONLINE
STATE=ONLINE on node452
NOTE: TARGET and STATE should both be ONLINE.
?
3. Check status of OGG processes:
GGSCI > info all
Program Status Group Lag
Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING MYEXT 00:00:07
00:00:04
EXTRACT RUNNING MYPUMP 00:00:00 0
0:00:05
NOTE: If you also prefer to set up HA on target system, follow the same steps.


第五步. Test OGG resource failover


1. Log on to node source node as oracle user:
$ /u01/app/11.2.0/grid/bin/crsctl relocate resource ggateapp -f
CRS-2673: Attempting to stop 'ggateapp' on 'node452'
CRS-2677: Stop of 'ggateapp' on 'node452' succeeded
CRS-2673: Attempting to stop 'ggatevip' on 'node452'
CRS-2677: Stop of 'ggatevip' on 'node452' succeeded
CRS-2672: Attempting to start 'ggatevip' on 'node453'
CRS-2676: Start of 'ggatevip' on 'node453' succeeded
CRS-2672: Attempting to start 'ggateapp' on 'node453'
CRS-2676: Start of 'ggateapp' on 'node453' succeeded
?
2. Check the status of OGG resource:
$ /u01/app/11.2.0/grid/bin/crsctl status resource ggateapp
NAME=ggateapp
TYPE=cluster_resource
TARGET=ONLINE
STATE=ONLINE on node453
?
NOTE: TARGET and STATE should both be ONLINE on node453.
?
3. Log on to another node 'node453' in this example as oracle user, go to OGG directory.
?
4. Set up LD_LIBRARY_PATH as described in Section 1, start GGSCI program:
$ ggsci
?
5. Check status of OGG processes:
GGSCI > info all
Program Status Group Lag
Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING MYEXT 00:00:09 0
0:00:04
EXTRACT RUNNING MYPUMP 00:00:00 0
0:00:05
NOTE: If you also prefer to set up HA on target system, follow the same steps, and make necessary changes to directory, etc.


如下是script的詳細(xì)代碼


#!/bin/sh
#set the Oracle Goldengate installation directory
export GGS_HOME=/cloudfs/goldengate
#set the oracle home to the database to ensure GoldenGate will get the
#right environment settings to be able to connect to the database
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
#specify delay after start before checking for successful start
start_delay_secs=5
#Include the GoldenGate home in the library path to start GGSCI
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:${GGS_HOME}:${LD_LIBRARY_PATH}
#check_process validates that a manager process is running at the PID
#that GoldenGate specifies.
?
check_process () {
if ( [ -f "${GGS_HOME}/dirpcs/MGR.pcm" ] )
then
? pid=`cut -f8 "${GGS_HOME}/dirpcs/MGR.pcm"`
? if [ ${pid} = `ps -e |grep ${pid} |grep mgr |cut -d " " -f2` ]
? then
? ? #manager process is running on the PID exit success
? ? exit 0
? else
? if [ ${pid} = `ps -e |grep ${pid} |grep mgr |cut -d " " -f1` ]
? then
? ? #manager process is running on the PID exit success
? ? exit 0
? else
? ? #manager process is not running on the PID
? ? exit 1
? fi
fi
else
? #manager is not running because there is no PID file
? exit 1
fi
}
?
#call_ggsci is a generic routine that executes a ggsci command
call_ggsci () {
? ggsci_command=$1
? ggsci_output=`${GGS_HOME}/ggsci < < EOF
? ${ggsci_command}
? exit
? EOF`
}
?
case $1 in
'start')
? #start manager
? call_ggsci 'start manager'
? #there is a small delay between issuing the start manager command
? #and the process being spawned on the OS. wait before checking
? sleep ${start_delay_secs}
? #check whether manager is running and exit accordingly
? check_process
? ;;
'stop')
? #attempt a clean stop for all non-manager processes
? #call_ggsci 'stop er *'
? #ensure everything is stopped
? call_ggsci 'stop er *!'
? #call_ggsci 'kill er *'
? #stop manager without (y/n) confirmation
? call_ggsci 'stop manager!'
? #exit success
? exit 0
? ;;
'check')
? check_process
? ;;
'clean')
? #attempt a clean stop for all non-manager processes
? #call_ggsci 'stop er *'
? #ensure everything is stopped
? #call_ggsci 'stop er *!'
? #in case there are lingering processes
? call_ggsci 'kill er *'
? #stop manager without (y/n) confirmation
? call_ggsci 'stop manager!'
? #exit success
? exit 0
? ;;
'abort')
? #ensure everything is stopped
? call_ggsci 'stop er *!'
? #in case there are lingering processes
? call_ggsci 'kill er *'
? #stop manager without (y/n) confirmation
? call_ggsci 'stop manager!'
? #exit success
? exit 0
? ;;
esac

總結(jié)

以上是生活随笔為你收集整理的11gR2 RAC GoldenGate的HA配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。