RAC先關後啟過程與在虛擬機器上更換IP過程

linyu2012發表於2009-10-10

rac1-> emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
rac1-> srvctl stop service -d snowdb -s portdb
rac1-> srvctl stop database -d snowdb
rac1-> srvctl stop instance -d snowdb -i snowdb1
rac1-> srvctl stop instance -d snowdb -i snowdb2
rac1-> srvctl stop asm -n rac1
rac1-> srvctl stop asm -n rac2
rac1-> srvctl stop nodeapps -n rac1
rac1-> srvctl stop nodeapps -n rac2
rac1-> srvctl start nodeapps -n rac2
rac1-> srvctl start nodeapps -n rac1
rac1-> srvctl start asm -n rac2
rac1-> srvctl start asm -n rac1
rac1-> srvctl start instance -d snowdb -i snowdb1
rac1-> srvctl start instance -d snowdb -i snowdb2
rac1-> srvctl start database -d snowdb
rac1-> srvctl start service -d snowdb -s portdb
rac1-> emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Starting Oracle Enterprise Manager 10g Database Control ................. started.
------------------------------------------------------------------
Logs are generated in directory /u01/oracle/product/10.2.0/dbs/rac1_snowdb1/sysman/log
====================================================================]
IP 地址更改問題;
1. /etc/hosts
127.0.0.1 rac1 localhost.localdomain localhost
#Pubilic
192.168.1.195 rac1.fastrise.com rac1
192.168.1.196 rac2.fastrise.com rac2
#Private
192.168.2.195 rac1-priv.fastrise.com rac1-priv
192.168.2.196 rac2-priv.fastrise.com rac2-priv
#Virtual
192.168.1.205 rac1-vip.fastrise.com rac1-vip
192.168.1.206 rac2-vip.fastrise.com rac2-vip
2. cd /etc/sysconfig/network-scripts/ 更改IP及其MAC (建議圖形化)
ifcfg-eth0
ifcfg-eth1
3. 更改VIP地址:
/u01/oracle/product/10.2.0/crs/bin/srvctl modify nodeapps -n rac1 -A 192.168.1.205/255.255.255.0/eth0
/u01/oracle/product/10.2.0/crs/bin/srvctl modify nodeapps -n rac2 -A 192.168.1.206/255.255.255.0/eth0
4. 重新配置兩機相通
分別在兩臺機器上先刪除後加配
rm-Rf ~/.ssh
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
在RAC1執行:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
5.在啟動ASM2時有發現,啟動不了,於是去看log後,發現有如下錯誤
------------------------------------------------------------------------------------------------------------------------------------
rac2-> srvctl start nodeapps -n rac1
rac2-> srvctl start nodeapps -n rac2
rac2-> srvctl start asm -n rac1
rac2-> srvctl start asm -n rac2
PRKS-1009 : Failed to start ASM instance "+ASM2" on node "rac2", [PRKS-1009 : Failed to start ASM instance "+ASM2" on node "rac2", [rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 6 10:11:07 2009
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:Copyright (c) 1982, 2005, Oracle. All rights reserved.
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:Enter user-name: Connected to an idle instance.
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:SQL> ORA-03113: end-of-file on communication channel
rac2:ora.rac2.ASM2.asm:SQL> Disconnected
rac2:ora.rac2.ASM2.asm:
CRS-0215: Could not start resource 'ora.rac2.ASM2.asm'.]]
[PRKS-1009 : Failed to start ASM instance "+ASM2" on node "rac2", [rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 6 10:11:07 2009
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:Copyright (c) 1982, 2005, Oracle. All rights reserved.
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:Enter user-name: Connected to an idle instance.
rac2:ora.rac2.ASM2.asm:
rac2:ora.rac2.ASM2.asm:SQL> ORA-03113: end-of-file on communication channel
rac2:ora.rac2.ASM2.asm:SQL> Disconnected
rac2:ora.rac2.ASM2.asm:
CRS-0215: Could not start resource 'ora.rac2.ASM2.asm'.]]

發現啟動不了,就用startup來
rac2-> export ORACLE_SID=+ASM2
rac2-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 6 10:20:17 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
還能啟動起來,再查下
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE OFFLINE
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.snowdb.db application OFFLINE OFFLINE
ora....rtdb.cs application OFFLINE OFFLINE
ora....db1.srv application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
把節點1上,給OFFLINE了,有點奇怪啊!不爽,再用startup去開啟節點1上,報錯
rac1-> export ORACLE_SID=+ASM1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 6 10:25:46 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected.
SQL> startup
ORA-10997: another startup/shutdown operation of this instance inprogress
ORA-09968: unable to lock file
Linux Error: 11: Resource temporarily unavailable
Additional information: 7911
SQL> exit
看來怪事多多啊,按自己想的思路行不通,檢視ASM的alert_+ASM2.log

Interface type 1 eth1 172.16.100.0 configured from OCR for use as a cluster interconnect
WARNING 172.16.100.0 could not be translated to a network address error 1
Interface type 1 eth0 172.16.99.0 configured from OCR for use as a public interface
WARNING 172.16.99.0 could not be translated to a network address
WARNING: No cluster interconnect has been specified. Depending on
the communication driver configured Oracle cluster traffic
may be directed to the public interface of this machine.
Oracle recommends that RAC clustered databases be configured
with a private interconnect for enhanced security and
performance.
Picked latch-free SCN scheme 2

原來還有IP地址沒更改掉啊,就是公網IP與私網IP的設定問題。
rac1-> oifcfg
Name:
oifcfg - Oracle Interface Configuration Tool.
Usage: oifcfg iflist [-p [-n]]
oifcfg setif {-node | -global} {/:}...
oifcfg getif [-node | -global] [ -if [/] [-type ] ]
oifcfg delif [-node | -global] [[/]]
oifcfg [-help]

- name of the host, as known to a communications network
- name by which the interface is configured in the system
- subnet address of the interface
- type of the interface { cluster_interconnect | public | storage }

rac2-> oifcfg getif
eth0 172.16.99.0 global public
eth1 172.16.100.0 global cluster_interconnect
rac1-> oifcfg setif -global eth0/192.168.1.0:public //增加 eth0
rac1-> oifcfg setif -global eth1/192.168.2.0:cluster_interconnect //增加 eth1
rac2-> oifcfg getif
eth0 172.16.99.0 global public
eth0 192.168.1.0 global public
eth1 172.16.100.0 global cluster_interconnect
eth1 192.168.2.0 global cluster_interconnect
rac1-> oifcfg delif -global eth0/172.16.99.0 //刪除 eth0
rac1-> oifcfg delif -global eth0/172.16.100.0 //刪除 eth1
rac2-> oifcfg getif
eth0 192.168.1.0 global public
eth1 192.168.2.0 global cluster_interconnect
---------------------------------------------------------------------------------------------------------------------------------------
6.再次去開啟後,一切正常。若發現有哪項啟動不了,一定要先關再開原則。
rac2-> srvctl start asm -n rac1
rac2-> srvctl start asm -n rac2
rac2-> srvctl start instance -d snowdb -i snowdb1
rac2-> srvctl start instance -d snowdb -i snowdb2
rac2-> srvctl start database -d snowdb
rac2-> srvctl start service -d snowdb -s portdb

[@more@]

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

相關文章