ORACLE RAC 11G 更改 /etc/hosts文件


來自官方文檔:
1)Can I change the public hostname in my Oracle Database 10g Cluster using Oracle Clusterware? Hostname changes are not supported in Oracle Clusterware (CRS), unless you want to perform a deletenode followed by a new addnode operation. The hostname is used to store among other things the flag files and Oracle Clusterware stack will not start if hostname is changed. (2)Does the hostname have to match the public name or can it be anything else? When there is no vendor clusterware, only Oracle Clusterware, then the public node name must match the host name. When vendor clusterware is present, it determines the public node names, and the installer doesn't present an opportunity to change them. So, when you have a choice, always choose the hostname. From: Metalink Note 220970.1 RAC Frequently Asked Questions:

(1). RAC 環境一旦安裝好后, 主機名就不能修改,除非先刪除節點,修改Hostname, 在添加節點。

(2). 主機名必須和public 名一致。這一點在安裝文檔中有特別強調。

 大神博客鏈接:http://blog.csdn.net/tianlesoftware/article/details/6055612

 

由於之前的安裝失誤,將/etc/hosts文件配置成如下格式

#管理網段
30.11.3.178  rappdb1
30.11.3.179  rappdb2
#public IP
30.2.21.161  rappdb1-pub
30.2.21.163  rappdb2-pub

30.2.21.162  rappdb1-vip
30.2.21.163  rappdb2-vip

172.2.21.101  rappdb1-priv
172.2.21.102  rappdb2-priv

當安裝完成后,監聽中發現監聽的是 管理IP(30.11.3.178)和VIP(30.2.21.162),正常應該是監聽PublicIP和VIP。一般不建議直接修改hosts文件。

修復操作如下:

一、先卸載CRS
在非最后一個節點運行

/oracle/asm/crs/install/rootcrs.pl -verbose -deconfig -force

Using configuration parameter file: /oracle/asm/crs/install/crsconfig_params
Network exists: 1/8.8.6.0/255.255.255.0/en0, type static
VIP exists: /dbrac1-vip/8.8.6.11/8.8.6.0/255.255.255.0/en0, hosting node dbrac1
VIP exists: /dbrac2-vip/8.8.6.21/8.8.6.0/255.255.255.0/en0, hosting node dbrac2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'dbrac1'
CRS-2677: Stop of 'ora.registry.acfs' on 'dbrac1' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbrac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'dbrac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'dbrac1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.ASMCRS.dg' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.racdb.db' on 'dbrac1'
CRS-2677: Stop of 'ora.racdb.db' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.ASMVG1.dg' on 'dbrac1'
CRS-2677: Stop of 'ora.ASMVG1.dg' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'dbrac1' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'dbrac2'
CRS-2676: Start of 'ora.oc4j' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.ASMCRS.dg' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'dbrac1'
CRS-2677: Stop of 'ora.asm' on 'dbrac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'dbrac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.crf' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.asm' on 'dbrac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'dbrac1'
CRS-2677: Stop of 'ora.crf' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'dbrac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbrac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'dbrac1'
CRS-2677: Stop of 'ora.cssd' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'dbrac1'
CRS-2677: Stop of 'ora.gipcd' on 'dbrac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'dbrac1'
CRS-2677: Stop of 'ora.gpnpd' on 'dbrac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'dbrac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
This may take several minutes. Please wait ...
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
Successfully deconfigured Oracle clusterware stack on this node

 


在最后一個節點運行

/oracle/asm/crs/install/rootcrs.pl -verbose -deconfig -force -lastnode

Using configuration parameter file: /oracle/asm/crs/install/crsconfig_params
CRS resources for listeners are still configured
Network exists: 1/8.8.6.0/255.255.255.0/en0, type static
VIP exists: /dbrac2-vip/8.8.6.21/8.8.6.0/255.255.255.0/en0, hosting node dbrac2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'dbrac2'
CRS-2677: Stop of 'ora.registry.acfs' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.crsd' on 'dbrac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'dbrac2'
CRS-2673: Attempting to stop 'ora.oc4j' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.ASMCRS.dg' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.racdb.db' on 'dbrac2'
CRS-2677: Stop of 'ora.racdb.db' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.ASMVG1.dg' on 'dbrac2'
CRS-2677: Stop of 'ora.ASMVG1.dg' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.ASMCRS.dg' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'dbrac2'
CRS-2677: Stop of 'ora.asm' on 'dbrac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'dbrac2' has completed
CRS-2677: Stop of 'ora.crsd' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.evmd' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.asm' on 'dbrac2'
CRS-2677: Stop of 'ora.evmd' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.asm' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbrac2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'dbrac2'
CRS-2677: Stop of 'ora.cssd' on 'dbrac2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'dbrac2'
CRS-2676: Start of 'ora.cssdmonitor' on 'dbrac2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'dbrac2'
CRS-2672: Attempting to start 'ora.diskmon' on 'dbrac2'
CRS-2676: Start of 'ora.diskmon' on 'dbrac2' succeeded
CRS-2676: Start of 'ora.cssd' on 'dbrac2' succeeded
CRS-4611: Successful deletion of voting disk +ASMCRS.
ASM de-configuration trace file location: /tmp/asmcadc_clean2012-11-20_10-05-15-AM.log
ASM Clean Configuration START
ASM Clean Configuration END

ASM with SID +ASM1 deleted successfully. Check /tmp/asmcadc_clean2012-11-20_10-05-15-AM.log for details.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbrac2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.crf' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'dbrac2'
CRS-2673: Attempting to stop 'ora.asm' on 'dbrac2'
CRS-2677: Stop of 'ora.mdnsd' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.crf' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.asm' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbrac2'
CRS-2677: Stop of 'ora.ctssd' on 'dbrac2' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'dbrac2'
CRS-2677: Stop of 'ora.cssd' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'dbrac2'
CRS-2677: Stop of 'ora.gipcd' on 'dbrac2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'dbrac2'
CRS-2677: Stop of 'ora.gpnpd' on 'dbrac2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'dbrac2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
This may take several minutes. Please wait ...
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
0518-307 odmdelete: 1 objects deleted.
Successfully deconfigured Oracle clusterware stack on this node


二、修改主機名 (本案例不涉及修改主機名)
smitty tcpip修改主機名
第一節點:dbrac1修改為dbrac100
第一節點:dbrac2修改為dbrac200

三、修改/etc/hosts

#管理網段
#30.11.3.178  rappdb1
#30.11.3.179  rappdb2
#public IP
30.2.21.161  rappdb1
30.2.21.163  rappdb2

30.2.21.162  rappdb1-vip
30.2.21.163  rappdb2-vip

172.2.21.101  rappdb1-priv
172.2.21.102  rappdb2-priv

 

四、修改11g grid的參數文件
修改$ORACLE_HOME/crs/install/crsconfig_params中相關部分:

ORACLE_HOME=/oracle/asm
ORACLE_BASE=/oracle/grid
OLD_CRS_HOME=

JREDIR=/oracle/asm/jdk/jre/
JLIBDIR=/oracle/asm/jlib

VNDR_CLUSTER=false
OCR_LOCATIONS=NO_VAL
CLUSTER_NAME=dbrac-cluster
HOST_NAME_LIST=dbrac100,dbrac200
NODE_NAME_LIST=dbrac100,dbrac200
PRIVATE_NAME_LIST=
VOTING_DISKS=NO_VAL
#VF_DISCOVERY_STRING=%s_vfdiscoverystring%
ASM_UPGRADE=false
ASM_SPFILE=
ASM_DISK_GROUP=ASMCRS
ASM_DISCOVERY_STRING=
ASM_DISKS=/dev/rhdisk3
ASM_REDUNDANCY=EXTERNAL 
CRS_STORAGE_OPTION=1
CSS_LEASEDURATION=400
CRS_NODEVIPS="dbrac100-vip/255.255.255.0/en0,dbrac200-vip/255.255.255.0/en0"
NODELIST=dbrac100,dbrac200
NETWORKS="en0"/8.8.6.0:public,"en1"/7.7.9.0:cluster_interconnect
SCAN_NAME=dbrac-scan
SCAN_PORT=1521
GPNP_PA=
OCFS_CONFIG=

# GNS consts
GNS_CONF=false
GNS_ADDR_LIST=
GNS_DOMAIN_LIST=
GNS_ALLOW_NET_LIST=
GNS_DENY_NET_LIST=
GNS_DENY_ITF_LIST=

#### Required by OUI add node
NEW_HOST_NAME_LIST=
NEW_NODE_NAME_LIST=
NEW_PRIVATE_NAME_LIST=
NEW_NODEVIPS="dbrac100-vip/255.255.255.0/en0,dbrac200-vip/255.255.255.0/en0"

############### OCR constants
# GPNPCONFIGDIR is handled differently in dev (T_HAS_WORK for all)
# GPNPGCONFIGDIR in dev expands to T_HAS_WORK_GLOBAL
GPNPCONFIGDIR=$ORACLE_HOME
GPNPGCONFIGDIR=$ORACLE_HOME
OCRLOC=
OLRLOC=
OCRID=
CLUSTER_GUID=

CLSCFG_MISSCOUNT=

#### IPD/OS
CRFHOME="/oracle/asm"

注:10g RAC的參數配置文件: $ORA_CRS_HOME/install/rootconfig

五、在各個節點依次運行root.sh腳本
節點1運行root.sh
另外一個節點運行root.sh

六、注冊信息
1.grid用戶asmca命令加載ASMVG1
2.oracle用戶注冊集群信息
./srvctl add database -d racdb -o /oracle/db/product/11.2
./srvctl add instance -d racdb -i racdb1 -n dbrac100     
./srvctl add instance -d racdb -i racdb2 -n dbrac200
root用戶
./srvctl add scan -n  dbrac-scan -S 8.8.6.0/255.255.255.0

3.grid用戶netca注冊監聽

七、完成檢查狀態
$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.ASMCRS.dg  ora....up.type ONLINE    ONLINE    dbrac100    
ora.ASMVG1.dg  ora....up.type ONLINE    ONLINE    dbrac100    
ora....ER.lsnr ora....er.type ONLINE    ONLINE    dbrac100    
ora.asm        ora.asm.type   ONLINE    ONLINE    dbrac100    
ora....SM1.asm application    ONLINE    ONLINE    dbrac100    
ora....00.lsnr application    ONLINE    ONLINE    dbrac100    
ora....100.gsd application    OFFLINE   OFFLINE               
ora....100.ons application    ONLINE    ONLINE    dbrac100    
ora....100.vip ora....t1.type ONLINE    ONLINE    dbrac100    
ora....SM2.asm application    ONLINE    ONLINE    dbrac200    
ora....00.lsnr application    ONLINE    ONLINE    dbrac200    
ora....200.gsd application    OFFLINE   OFFLINE               
ora....200.ons application    ONLINE    ONLINE    dbrac200    
ora....200.vip ora....t1.type ONLINE    ONLINE    dbrac200    
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    dbrac100    
ora.ons        ora.ons.type   ONLINE    ONLINE    dbrac100    
ora.racdb.db   ora....se.type ONLINE    ONLINE    dbrac100    
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    dbrac100


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM