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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

oracle集群安装ogg,在RAC下安装配置OGG

發(fā)布時(shí)間:2023/12/29 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle集群安装ogg,在RAC下安装配置OGG 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

有多種方案

1

共享磁盤—ACFS/DBFS/OCFS2

可由任何一個(gè)節(jié)點(diǎn)啟動(dòng)OGG,若該節(jié)點(diǎn)crash,可由其他節(jié)點(diǎn)重啟manager和OGG進(jìn)程;若本地節(jié)點(diǎn)的DB crash,則先停止其manager進(jìn)程然后在其他節(jié)點(diǎn)啟動(dòng)

2

本地磁盤

不支持failover,如果本地節(jié)點(diǎn)失效則無(wú)法獲取checkpoint信息

3

異機(jī)安裝

GG通過tnsname連接到RAC,oracle日志文件必須位于共享磁盤以便extract讀取

一般選項(xiàng)安裝于共享磁盤,/u02為ACFS文件系統(tǒng),安裝步驟與單實(shí)例類似,添加extract進(jìn)程時(shí)應(yīng)指定thread數(shù)量;

連接ASM

如果RAC使用ASM存儲(chǔ)文件,則配置Extract時(shí)連接應(yīng)指向ASM;

對(duì)于10205/11202同時(shí)OGG版本>=11,采用DBLOGREADER API可直接連通數(shù)據(jù)庫(kù),其他版本則通過SQLNET以SYS ASM用戶登錄;

--通過ASMUSER連接ASM時(shí),extrat進(jìn)程的buffer為28672字節(jié),而DBLOGREADER API默認(rèn)為1024000字節(jié),其extract相應(yīng)配置為tranlogoptions dblogreader

如果數(shù)據(jù)量巨大,對(duì)于10R2或更高版本可使用BEQ協(xié)議,相比傳統(tǒng)的listener節(jié)省了TCP/IP開銷,OGG必須運(yùn)行于db server;

使用傳統(tǒng)sqlnet配置

1 ASM通過db listener提供遠(yuǎn)程連接必須顯示的加入監(jiān)聽器配置文件

2 Extract參數(shù)文件必須包含連接ASM實(shí)例的配置

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時(shí)配置如下

--tnsname

ORCL_BEQ =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = BEQ)

(PROGRAM=oracle)

(ARGV0 = oracleORCL)

(ARGS=‘(DESCRIPTION=(LOCAL=YES)(ADDRESS =(PROTOCOL=BEQ)))’)

)

(CONNECT_DATA = (SERVICE_NAME = ORCL))

)

--extract參數(shù)文件

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進(jìn)程注冊(cè)為clusterware資源,以下適用于11R2

1

添加應(yīng)用VIP

$GRID_HOME/bin/appvipcfg create -network=1 -ip=10.1.41.93 -vipname=mvggatevip -user=root

此時(shí)VIP屬主為root,賦予權(quán)限給oracle

$GRID_HOME/bin/crsctl setperm resource mvggatevip -u user:oracle:r-x

以oracle用戶啟動(dòng)

$GRID_HOME/bin/crsctl start resource mvggatevip

查看VIP運(yùn)行情況

GRID_HOME/bin/crsctl status resource mvggatevip

2

部署agent腳本

Clusterware通過agent運(yùn)行相應(yīng)資源

將腳本11gr2_gg_action.scr復(fù)制到每個(gè)節(jié)點(diǎn)相同目錄,其至少包含5個(gè)選項(xiàng):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

注冊(cè)到集群

$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分屬不同用戶,須將該應(yīng)用屬主設(shè)置為OGG用戶(假定mvandewiel)

--以root用戶執(zhí)行

$GRID_HOME/bin/crsctl setperm resource ggateapp -o mvandewiel

4

啟動(dòng)應(yīng)用

$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用戶停止相應(yīng)資源

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

exportGGS_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

exportORACLE_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

exportLD_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} |grepmgr |cut-d " "-f2` ]

then

#manager process is running on the PID exit success

exit0

else

if[ ${pid} = `ps-e |grep${pid} |grepmgr |cut-d " "-f1` ]

then

#manager process is running on the PID exit success

exit0

else

#manager process is not running on the PID

exit1

fi

fi

else

#manager is not running because there is no PID file

exit1

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

exit0

;;

'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

exit0

;;

'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

exit0

;;

esac

增刪RAC節(jié)點(diǎn)需重新配置extract? 1267901.1

增加節(jié)點(diǎn), 需修改extract的thread

1 增加新日志 alter database add logfile … thread#

2 停止extract進(jìn)程,獲取當(dāng)前檢查點(diǎn)信息info ext , showch,然后刪除該extract—delete ext

3 重新添加extract進(jìn)程,add ext , begin now, tranlog, threads

4 依據(jù)step2信息修改其檢查點(diǎn)alter extract [thread n] extseqno <>, extrba <>/alter extract [thread n] ioextseqno <>, ioextrba <>

5 重啟extract進(jìn)程

Extract進(jìn)程有相應(yīng)參數(shù)processthreads select/except 用于指定或排除候選log thread

增刪節(jié)點(diǎn)后,OGG thread和RAC thread的映射關(guān)系可能發(fā)生變動(dòng)1342635.1

RAC thread的順序遵從select distinct thread# from v$log的輸出,而OGG thread永遠(yuǎn)從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為新增節(jié)點(diǎn),其歸檔日志應(yīng)從0開始,則OGG thread#1的檢查點(diǎn)應(yīng)指向RAC thread#6的0號(hào)日志

總結(jié)

以上是生活随笔為你收集整理的oracle集群安装ogg,在RAC下安装配置OGG的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

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