星期四, 12月 01, 2011

Oracle 10g clusterware 重建ocr 及voting步驟

由於主機OS並沒有重新安裝,因此重建CRS和資料庫就行了。

環境:Solaris 10 + ORACLE 10.2.0.4+ Veritas

以下是操作步驟:

1、在兩個節點上修改主機配置:由於網路變更的原因,需要更換VIP,因此修改/etc/hosts檔,將VIP位址對應的位址更改為新的IP位址

2、在兩個節點上修改/etc/oracle/ocr.loc檔,將檔中的ocrconfig_loc=後的位址改為新的存儲ocrraw device名,如果用的是cluster file system,則為檔案名(不更改crsvoting路徑,以及vip則可忽略步驟2346

root@dbtest1 # cat /var/opt/oracle/ocr.loc

ocrconfig_loc=/ocrvote/crs

local_only=FALSE

root@dbtest1 # cd /var/opt/oracle

root@dbtest1 # cp ocr.loc ocr.loc.org

root@dbtest2 # cat /var/opt/oracle/ocr.loc

ocrconfig_loc=/ocrvote/crs

local_only=FALSE

root@dbtest2 # cd  /var/opt/oracle

root@dbtest2 # cp ocr.loc ocr.loc.org

 

3、在兩個節點上刪除檔/etc/oracle/scls_scr/<節點名>/oracle/cssfatal

root@dbtest1 # mv /var/opt/oracle/scls_scr/`hostname`/oracle/cssfatal /var/opt/oracle/scls_scr/`hostname`/oracle/cssfatal.org

root@dbtest2 # mv /var/opt/oracle/scls_scr/`hostname`/oracle/cssfatal /var/opt/oracle/scls_scr/`hostname`/oracle/cssfatal.org

 

4、在兩個節點上,進入$ORA_CRS_HOME/install目錄,修改paramfile.crs檔,修改變動的配置資料。這�主要包括CRS_OCR_LOCATIONSCRS_VOTING_DISKSCRS_NODEVIPS

oracle@dbtest1 $cd $ORA_CRS_HOME/install

oracle@dbtest1 $cp paramfile.crs paramfile.crs.org

oracle@dbtest2 $cd $ORA_CRS_HOME/install

oracle@dbtest2 $cp paramfile.crs paramfile.crs.org

vi paramfile.crs

CRS_OCR_LOCATIONS=/oradata/crs

CRS_VOTING_DISKS=/oradata/voting

 

5、對storage OCR CONFIGraw device,用dd命令進行清除。(如果是cluster file system系統,只需要做以下動作)。

root@dbtest1 # cd /ocrvote

root@dbtest1 # touch crs voting

root@dbtest1 # chown root:dba crs voting

root@dbtest1 # chmod 660 crs voting

如果為raw device(在這為emc powerpath的範例

Initialize the devices using dd.

dd if=/dev/zero of=/dev/rdsk/emcpower1a bs=125829120 \
count=1(ocr disk)
dd if=/dev/zero of=/dev/rdsk/emcpower3a bs=20971520 \
count=1(voting disk)


#chown root:dba /dev/rdsk/emcpower1a
#chmod 660 /dev/rdsk/emcpower1a

#chown oracle:dba /dev/rdsk/emcpower3a

#chmod 660 /dev/rdsk/emcpower3a

 

(如果是OCR本來是存在,只是需要重建,則必須要執行這一步。就算是完全新建在raw device上,在後面的步驟中有時也會遇到莫名其妙的問題,則也需要對raw devicedd進行清除,dd清除的大小不能過小,bs=4096的情況下,count10之類的數值就顯得過小,後面也會出現問題)

6、在兩個節點上修改$ORA_CRS_HOME/install/rootconfig,修改在檔案前面的變數。這�也主要是CRS_OCR_LOCATIONSCRS_VOTING_DISKSCRS_NODEVIPS

7、如果是通過遠端telnetssh在主機上操作,則要設置DISPLAY變數。export DISPLAY=x.x.x.x:0.0。這�x.x.x.x為操作的終端的IP位址。在操作終端上運行如xmanager這樣的軟體。

8、在節點一上以root用戶運行$ORA_CRS_HOME/install/rootconfig,注意不要運行rootinstall

root@dbtest1 # ./rootconfig

Checking to see if Oracle CRS stack is already configured

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: dbtest1 dbtest1-priv dbtest1

node 2: dbtest2 dbtest2-priv dbtest2

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

Now formatting voting device: /ocrvote/voting

Format of 1 voting devices complete.

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

 

CSS is active on these nodes.

        dbtest1

CSS is inactive on these nodes.

        dbtest2

Local node checking complete.

Run root.sh on remaining nodes to start CRS daemons.

9、待節點一完全運行完後,在節點二上運行$ORA_CRS_HOME/install/rootconfig。正常情況下不會彈出vip設置視窗(silent configure vip)

root@dbtest2 # ./rootconfig

Checking to see if Oracle CRS stack is already configured

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: dbtest1 dbtest1-priv dbtest1

node 2: dbtest2 dbtest2-priv dbtest2

clscfg: Arguments check out successfully.

 

NO KEYS WERE WRITTEN. Supply -force parameter to override.

-force is destructive and will destroy any previous cluster

configuration.

Oracle Cluster Registry for cluster has already been initialized

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        dbtest1

        dbtest2

CSS is active on all nodes.

Waiting for the Oracle CRSD and EVMD to start

Oracle CRS stack installed and running under init(1M)

Running vipca(silent) for configuring nodeapps

 

Creating VIP application resource on (2) nodes...

Creating GSD application resource on (2) nodes...

Creating ONS application resource on (2) nodes...

Starting VIP application resource on (2) nodes...

Starting GSD application resource on (2) nodes...

Starting ONS application resource on (2) nodes...

Done.

10、在兩個節點上運行crs_stat -t,如果出現CRSVIP相關的資源啟動(在VIP已經設置的情況下),說明CRS已經建立成功。

11、如果前面沒有配置VIP,則以root用戶運行vipca,配置VIP。注意在彈出的視窗中,提示選擇網路介面時,選擇public介面。(如果顯示介面異常,在shelloifcfg命令檢查一下網路介面,如有必要,用該命令對網路介面進行重新配置)

oifcfg getif -global

 

12、至此crs已經配置完畢,用crs_stat檢查crs是否正常運行。如果沒有正常運行,檢查crs日誌。此時應該有VIPONSGSD等資源運行。在兩個節點上運行ifconfig -a檢查VIP是否已經綁定到PUBLIC網卡上(注意要確保是在PUBLIC網卡上,有的時候粗略一下VIP已經起了,但實際上綁在了PRIVATE網卡上)

13、清除原來的監聽設置,確認監聽是處於關閉狀態,運行netca,配置監聽,配置完成後將會自動把監聽加入到crs中。

oracle@dbtest1 $ mv listener.ora listener.ora.org

oracle@dbtest2 $ mv listener.ora listener.ora.org

oracle@dbtest1 $ netca &

14、執行dbca

oracle@dbtest1 $ dbca &

 

 

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...