ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC先关后启过程与在虚拟机上更换IP过程

RAC先关后启过程与在虚拟机上更换IP过程

原创 Linux操作系统 作者:womenshitouzhu 时间:2009-10-10 11:24:22 0 删除 编辑
RAC先关后启过程与在虚拟机上更换IP过程
===========================================================

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.
http://rac1:1158/em/console/aboutApplication
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.
http://rac1:1158/em/console/aboutApplication
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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9653957/viewspace-616209/,如需转载,请注明出处,否则将追究法律责任。

上一篇: temp表空间管理
请登录后发表评论 登录
全部评论

注册时间:2009-02-11

  • 博文量
    22
  • 访问量
    54375