Oracle RAC解除安裝後的重灌重點環節

kuqlan發表於2013-07-06

重新安裝RAC之前,需要在兩個節點分別執行如下命令來啟用使用者等效驗證:
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add


為了縮短篇幅,只對注意環節進行說明:

[@more@]

1、在安裝clusterware的過程中:
[root@dbserv1 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@dbserv1 ~]# /u01/crs1020/root.sh
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
assigning default hostname dbserv1 for node 1.
assigning default hostname dbserv2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: dbserv1 dbserv1-priv dbserv1
node 2: dbserv2 dbserv2-priv dbserv2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
dbserv1
CSS is inactive on these nodes.
dbserv2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.


--在節點2執行/u01/crs1020/root.sh指令碼時報如下錯誤:
[root@dbserv2 ~]# /u01/crs1020/root.sh
....
CSS is active on these nodes.
dbserv1
dbserv2
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
/u01/crs1020/jdk/jre//bin/java: error while loading shared libraries: libpthread
.so.0: cannot open shared object file: No such file or directory

這是由於LD_ASSUME_KERNEL引數設定不正確引起
在所有節點機器的/u01/crs1020/bin/vipca檔案中
找到如下內容:
Remove this workaround when the bug 3937317 is fixed
arch=`uname -m`
if [ "$arch" = "i686" -o "$arch" = "ia64" ]
then
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
fi
#End workaround
在fi後新新增一行:
unset LD_ASSUME_KERNEL
以及srvctl檔案 (需要在所有節點上操作)
# vi /u01/crs1020/bin/srvctl
找到如下內容:
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
同樣在其後新增加一行:
unset LD_ASSUME_KERNEL

對以上檔案修改完畢後,在節點1以root執行vipca,如果馬上執行vipca會報告如下錯誤
[root@dbserv1 bin]# cd /u01/crs1020/bin
[root@dbserv1 bin]# ./vipca
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]

必須先設定

[root@dbserv1 ~]# cd /u01/crs1020/bin/
[root@dbserv1 bin]# oifcfg setif -global eth0/192.168.133.0:public
bash: oifcfg: command not found
[root@dbserv1 bin]# ./oifcfg setif -global eth0/192.168.133.0:public
[root@dbserv1 bin]# ./oifcfg setif -global eth0/192.168.23.0:cluster_interconnect
[root@dbserv1 bin]# ./vipca
在出現的影像介面上配置完相關的節點名稱後單擊finsh結束VIPCA視窗,然後在單擊執行指令碼提示框的視窗。透過以上步驟clusterware就算安裝成功

[root@dbserv1 bin]# ./crsctl crscheck
Unknown parameter: crscheck
[root@dbserv1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@dbserv1 bin]# su - oracle
[oracle@dbserv1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....rv1.gsd application ONLINE ONLINE dbserv1
ora....rv1.ons application ONLINE ONLINE dbserv1
ora....rv1.vip application ONLINE ONLINE dbserv1
ora....rv2.gsd application ONLINE ONLINE dbserv2
ora....rv2.ons application ONLINE ONLINE dbserv2
ora....rv2.vip application ONLINE ONLINE dbserv2


2、db sofetware的安裝:
這一步驟,只要選對軟體安裝位置(不要裝到crs目錄下)正確,一般不會出錯。還要注意選對安裝選項中的db sofetware only選項。

3、asm的配置:

安裝完資料庫軟體並建立資料庫之前需要配置asm,在Oracle使用者下,透過dbca進行相關的配置工作;
dbca開始的步驟要選擇 configure automatic storage management選項:
初始化檔案要選擇pfile而不是spfile;
提示lintener錯誤,可以不用管,直接按yes;
在建立asm磁碟組後,單擊finish按鈕結束操作時,系統會彈出類此是否要執行另一個操作的提示,這時選擇yes來,開始下一步的建庫操作。


4、建立資料庫:

dbca開始的步驟要選擇 create a database選項;
資料問價存放位置是,要選擇ASM;
在建庫過程中還出現了ORA-00604錯誤,
Errors in file /u01/app/oracle/admin/RACDB/bdump/racdb1_smon_32290.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01578: ORACLE data block corrupted (file # 1, block # 4585)
ORA-01110: data file 1: '+DATA/racdb/datafile/system.256.820081481'
Sat Jul 6 16:26:34
說system資料檔案的某個塊兒有錯誤,這時我選擇了abort,重新調整了如下內容:
open_cursors 引數為360 ,原預設值為250;
記憶體所佔比例為40% , 第一次我改為35%;
日誌檔案大小為100M,原來預設值為50M;

完成如上調整完後,在次執行,發現沒有出現錯誤,資料庫建立成功。

最後對VOTEDISK和OCR的備份做個簡單說明:

[oracle@dbserv1 ~]$ crsctl query css votedisk
0. 0 /dev/raw/raw2
located 1 votedisk(s).
[oracle@dbserv1 ~]$

[root@dbserv1 ~]# dd if=/dev/raw/raw2 of=/home/oracle/votedisk2.bak
417760+0 records in
417760+0 records out
213893120 bytes (214 MB) copied, 282.621 seconds, 757 kB/s

[root@dbserv1 bin]# pwd
/u01/crs1020/bin

[root@dbserv1 bin]# ./ocrconfig -showbackup
dbserv2 2013/07/06 18:22:51 /u01/crs1020/cdata/crs
dbserv2 2013/07/06 18:22:51 /u01/crs1020/cdata/crs
dbserv2 2013/07/06 18:22:51 /u01/crs1020/cdata/crs


[root@dbserv1 bin]# ./ocrconfig -export /home/oracle/ocr.bak
[root@dbserv1 bin]# cd /home/oracle/

[root@dbserv1 oracle]# ll -h
total 298M
-rw-r--r-- 1 oracle oinstall 206 Oct 10 2012 controlfe.txt
-rw-r--r-- 1 oracle oinstall 11K Oct 3 2012 dbms_p.log
drwxr-xr-x 3 oracle oinstall 4.0K Oct 1 2012 flash
-rw-r--r-- 1 oracle oinstall 337 Oct 10 2012 init.ora
-rw-r--r-- 1 root root 104K Jul 6 19:15 ocr.bak
-rw-r--r-- 1 oracle oinstall 22 Oct 3 2012 on.lst
drwxr-xr-x 2 oracle oinstall 4.0K Oct 20 2012 scripts
-rw-r--r-- 1 oracle oinstall 1.5K Oct 10 2012 sqlnet.log
-rw-r--r-- 1 root root 204M Jul 6 19:08 votedisk2.bak
[root@dbserv1 oracle]#

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1060669/,如需轉載,請註明出處,否則將追究法律責任。

相關文章