在RAC下安裝配置OGG
有多種方案
1
共享磁碟—ACFS/DBFS/OCFS2
可由任何一個節點啟動OGG,若該節點crash,可由其他節點重啟manager和OGG程式;若本地節點的DB crash,則先停止其manager程式然後在其他節點啟動
2
本地磁碟
不支援failover,如果本地節點失效則無法獲取checkpoint資訊
3
異機安裝
GG透過tnsname連線到RAC,oracle日誌檔案必須位於共享磁碟以便extract讀取
一般選項安裝於共享磁碟,/u02為ACFS檔案系統,安裝步驟與單例項類似,新增extract程式時應指定thread數量;
連線ASM
如果RAC使用ASM儲存檔案,則配置Extract時連線應指向ASM;
對於10205/11202同時OGG版本>=11,採用DBLOGREADER API可直接連通資料庫,其他版本則透過SQLNET以SYS ASM使用者登入;
--透過ASMUSER連線ASM時,extrat程式的buffer為28672位元組,而DBLOGREADER API預設為1024000位元組,其extract相應配置為tranlogoptions dblogreader
如果資料量巨大,對於10R2或更高版本可使用BEQ協議,相比傳統的listener節省了TCP/IP開銷,OGG必須執行於db server;
使用傳統sqlnet配置
1 ASM透過db listener提供遠端連線必須顯示的加入監聽器配置檔案
2 Extract引數檔案必須包含連線ASM例項的配置
GGSCI (raclinux1.gj.com) 25> view params extcdc
extract extcdc
tranlogoptions asmuser sys@ASM, asmpassword sys1
userid ogg_extract, password ogg_extract
rmthost raclinux1, mgrport 7809
rmttrail ./dirdat/aa
使用BEQ和DBLOGREADER時配置如下
--tnsname
ORCL_BEQ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = BEQ)
(PROGRAM=oracle)
(ARGV0 = oracleORCL)
(ARGS=‘(DESCRIPTION=(LOCAL=YES)(ADDRESS =(PROTOCOL=BEQ)))’)
)
(CONNECT_DATA = (SERVICE_NAME = ORCL))
)
--extract引數檔案
EXTRACT EASM
EXTTRAIL ./dirdat/ea
USERID gguser@ORCL_BEQ, PASSWORD Oracle1
TRANLOGOPTIONS BUFSIZE 4096000
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4096000
TABLE amer.*;
Extract ASM Connection Methods [ID 1390268.1]
安裝完畢後,為保證OGG可以failover,須將其manager程式註冊為clusterware資源,以下適用於11R2
1
新增應用VIP
$GRID_HOME/bin/appvipcfg create -network=1 -ip=10.1.41.93 -vipname=mvggatevip -user=root
此時VIP屬主為root,賦予許可權給oracle
$GRID_HOME/bin/crsctl setperm resource mvggatevip -u user:oracle:r-x
以oracle使用者啟動
$GRID_HOME/bin/crsctl start resource mvggatevip
檢視VIP執行情況
GRID_HOME/bin/crsctl status resource mvggatevip
2
部署agent指令碼
Clusterware透過agent執行相應資源
將指令碼11gr2_gg_action.scr複製到每個節點相同目錄,其至少包含5個選項:start/stop/check/clean/abort
Chmod +X 11gr2_gg_action.scr
Oracle Clusterware runs resource-specific commands through an entity called an agent. The agent script. must be able to accept 5 parameter values: start, stop, check, clean and abort (optional).
Save the script. in a file and copy it to every node in the cluster into the same directory
3
註冊到叢集
$GRID_HOME/bin/crsctl add resource ggateapp -type cluster_resource -attr "ACTION_SCRIPT=/mnt/acfs/oracle/grid/11gr2_gg_action.scr, CHECK_INTERVAL=30, START_DEPENDENCIES='hard(mvggatevip) pullup(mvggatevip)', STOP_DEPENDENCIES='hard(mvggatevip)'"
如果OGG和GRID分屬不同使用者,須將該應用屬主設定為OGG使用者(假定mvandewiel)
--以root使用者執行
$GRID_HOME/bin/crsctl setperm resource ggateapp -o mvandewiel
4
啟動應用
$GRID_HOME/bin/crsctl start resource ggateapp
$GRID_HOME/bin/crsctl status resource ggateapp
NAME=ggateapp
TYPE=cluster_resource
TARGET=ONLINE
STATE=ONLINE on coe-02
5
重定向
[oracle@coe-02 grid]$ crsctl relocate resource ggateapp -f
CRS-2673: Attempting to stop 'ggateapp' on 'coe-01'
CRS-2677: Stop of 'ggateapp' on 'coe-01' succeeded
CRS-2673: Attempting to stop 'mvggatevip' on 'coe-01'
CRS-2677: Stop of 'mvggatevip' on 'coe-01' succeeded
CRS-2672: Attempting to start 'mvggatevip' on 'coe-02'
CRS-2676: Start of 'mvggatevip' on 'coe-02' succeeded
CRS-2672: Attempting to start 'ggateapp' on 'coe-02'
CRS-2676: Start of 'ggateapp' on 'coe-02' succeeded
清空資源
先以oracle使用者停止相應資源
GRID_HOME/bin/crsctl stop resource ggateapp
GRID_HOME/bin/crsctl stop resource mvggatevip
以root使用者刪除資源
$GRID_HOME/bin/crsctl delete resource ggateapp
GRID_HOME/bin/appvipcfg delete -vipname=mvggatevip
刪除11gr2_gg_action.scr指令碼
指令碼
#!/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
增刪RAC節點需重新配置extract 1267901.1
增加節點, 需修改extract的thread
1 增加新日誌 alter database add logfile … thread#
2 停止extract程式,獲取當前檢查點資訊info ext
3 重新新增extract程式,add ext
4 依據step2資訊修改其檢查點alter extract [thread n] extseqno <>, extrba <>/alter extract [thread n] ioextseqno <>, ioextrba <>
5 重啟extract程式
Extract程式有相應引數processthreads select/except
增刪節點後,OGG thread和RAC thread的對映關係可能發生變動1342635.1
RAC thread的順序遵從select distinct thread# from v$log的輸出,而OGG thread永遠從1到N遞增
Before node addition:
====================
RAC THREAD# OGG thread
----------------- --------------
5 - 1
1 - 2
2 - 3
3 - 4
4 - 5
After node addition:
====================
The corresponding thread mapping for Golden Gate is identified as given below:
RAC THREAD# OGG thread
----------- ----------
6 - 1
5 - 2
1 - 3
2 - 4
3 - 5
4 - 6
RAC thread 6為新增節點,其歸檔日誌應從0開始,則OGG thread#1的檢查點應指向RAC thread#6的0號日誌
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-762758/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- OGG在RAC上的初始化(上)-- 安裝配置篇
- RAC環境下配置OGG同步
- 【OGG】RAC環境下配置OGG單向同步 (四)
- OGG安裝及單向配置
- 【OGG】OGG的下載和安裝篇
- 在AIX上安裝配置Oracle10g RACAIOracle
- 在VMware 上安裝配置Oracle10g RACOracle
- Mongodb在Windows下安裝及配置MongoDBWindows
- CUnit在Linux下安裝配置Linux
- 在RAC環境下安裝實施GoldenGateGo
- solr在windows下的安裝及配置SolrWindows
- Winrar 在Linux下的安裝配置Linux
- 在centos5下安裝配置VNCCentOSVNC
- 【RAC安裝】 AIX下安裝Oracle 11gR2 RACAIOracle
- Openfiler+RAC的安裝之五--在RAC 節點上配置 iSCSI 卷
- 預安裝RAC的ServiceGuard配置
- 在安裝RAC時需要配置的幾個kernel引數
- 在AIX上安裝配置Oracle10g RAC2AIOracle
- ogg for oracle 19c 非cdb安裝配置Oracle
- Oracle 12cR1 RAC 在VMware Workstation上安裝(下)—靜默安裝Oracle
- 在Linux下安裝配置Cntlm代理教程Linux
- nodejs在linux下的安裝配置NodeJSLinux
- Tomcat在Windows下的免安裝配置TomcatWindows
- 手把手教你用VMware在linux下安裝oracle10g RAC(6)-配置Clusterware安裝環境LinuxOracle
- solaris安裝RAC的儲存配置
- linux配置multipath 並安裝racLinux
- oracle rac安裝配置注意事項Oracle
- LINUX 環境 mysql to mysql OGG安裝配置(二)LinuxMySql
- oracle linux 下安裝OGG 11gOracleLinux
- Apache+php在windows下的安裝和配置ApachePHPWindows
- 在oracle 11g下安裝配置scheduler agentOracle
- JDK1.6在LINUX下的安裝配置JDKLinux
- Elasticsearch 在Linux下的安裝部署和配置ElasticsearchLinux
- Windows 11.2.0.4 RAC安裝配置以及RAC新增節點Windows
- 3 安裝配置oracle叢集和RACOracle
- OGG安裝測試
- jdk在linux下安裝、配置環境變數JDKLinux變數
- JDK1.6在LINUX下的安裝配置[轉]JDKLinux