Ora_11g Rac R2 修改主机Hostname详解

来源:互联网 发布:高德地图出行数据 编辑:程序博客网 时间:2024/06/08 09:55

11g RacR2 修改主机HOSTNAME详解

 

1.       Hosts文件配置

两个节点xulq1和xulq2,/etc/hosts的配置如下

#public ip

192.168.56.80   xulq1

192.168.56.81   xulq2

 

#priv ip

192.168.100.10    xulq1-priv

192.168.100.11    xulq2-priv

 

#vip ip

192.168.56.82   xulq1-vip

192.168.56.83   xulq2-vip

 

#scan ip

192.168.56.84  xulq-scan

 

2.       CRS集群状态

[grid@xulq2 ~]$ crsctl stat res -t

--------------------------------------------------------------------------------

NAME           TARGET  STATE       SERVER                  STATE_DETAILS      

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.DATA.dg

               ONLINE  ONLINE      xulq1                                       

              ONLINE  ONLINE      xulq2                                       

ora.DATA_DG1.dg

               ONLINE  ONLINE      xulq1                                       

               ONLINE  ONLINE      xulq2                                       

ora.LISTENER.lsnr

               ONLINE  ONLINE      xulq1                                       

               ONLINE  ONLINE      xulq2                                       

ora.asm

               ONLINE  ONLINE      xulq1                    Started            

               ONLINE  ONLINE      xulq2                   Started            

ora.gsd

               OFFLINE OFFLINE      xulq1                                       

               OFFLINE OFFLINE      xulq2                                        

ora.net1.network

               ONLINE  ONLINE      xulq1                                       

               ONLINE  ONLINE      xulq2                                       

ora.ons

               ONLINE  ONLINE      xulq1                                        

               ONLINE  ONLINE      xulq2                                       

ora.registry.acfs

               ONLINE  ONLINE      xulq1                                       

               ONLINE  ONLINE      xulq2                                        

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

     1        ONLINE  ONLINE      xulq2                                       

ora.cvu

     1        ONLINE  ONLINE      xulq2                                       

ora.oc4j

     1        ONLINE  ONLINE      xulq2                                       

ora.scan1.vip

     1        ONLINE  ONLINE      xulq2                                       

ora.xulq.db

     1        ONLINE  ONLINE      xulq1                    Open               

     2        ONLINE  ONLINE      xulq2                    Open                

ora.xulq1.vip

     1        ONLINE  ONLINE      xulq1                                       

ora.xulq2.vip

     1        ONLINE  ONLINE      xulq2

 

现在要把两个节点的主机名改为: xurac1 xurac2

 

3. 卸载CRS,在非最后一个节点运行

#/u01/product/11.2/grid/crs/install/rootcrs.pl-verbose -deconfig -force

[root@xulq1 install]#/u01/product/11.2/grid/crs/install/rootcrs.pl -verbose -deconfig -force

Using configuration parameter file:/u01/product/11.2/grid/crs/install/crsconfig_params

Network exists: 1/192.168.56.0/255.255.255.0/eth0,type static

VIP exists:/xulq1-vip/192.168.56.82/192.168.56.0/255.255.255.0/eth0, hosting node xulq1

VIP exists:/xulq2-vip/192.168.56.83/192.168.56.0/255.255.255.0/eth0, hosting node xulq2

GSD exists

ONS exists: Local port 6100, remote port6200, EM port 2016

CRS-2673: Attempting to stop'ora.registry.acfs' on 'xulq1'

CRS-2677: Stop of 'ora.registry.acfs' on'xulq1' succeeded

CRS-2791: Starting shutdown of Oracle HighAvailability Services-managed resources on 'xulq1'

CRS-2673: Attempting to stop 'ora.crsd' on'xulq1'

CRS-2790: Starting shutdown of ClusterReady Services-managed resources on 'xulq1'

CRS-2673: Attempting to stop 'ora.DATA.dg'on 'xulq1'

CRS-2673: Attempting to stop 'ora.xulq.db'on 'xulq1'

CRS-2677: Stop of 'ora.xulq.db' on 'xulq1'succeeded

CRS-2673: Attempting to stop'ora.DATA_DG1.dg' on 'xulq1'

CRS-2677: Stop of 'ora.DATA_DG1.dg' on'xulq1' succeeded

CRS-2677: Stop of 'ora.DATA.dg' on 'xulq1'succeeded

CRS-2673: Attempting to stop 'ora.asm' on'xulq1'

CRS-2677: Stop of 'ora.asm' on 'xulq1'succeeded

CRS-2792: Shutdown of Cluster ReadyServices-managed resources on 'xulq1' has completed

CRS-2677: Stop of 'ora.crsd' on 'xulq1'succeeded

CRS-2673: Attempting to stop 'ora.ctssd' on'xulq1'

CRS-2673: Attempting to stop 'ora.evmd' on'xulq1'

CRS-2673: Attempting to stop 'ora.asm' on'xulq1'

CRS-2673: Attempting to stop 'ora.mdnsd' on'xulq1'

CRS-2673: Attempting to stop'ora.drivers.acfs' on 'xulq1'

CRS-2677: Stop of 'ora.mdnsd' on 'xulq1'succeeded

CRS-2677: Stop of 'ora.evmd' on 'xulq1'succeeded

CRS-2677: Stop of 'ora.asm' on 'xulq1'succeeded

CRS-2673: Attempting to stop'ora.cluster_interconnect.haip' on 'xulq1'

CRS-2677: Stop of'ora.cluster_interconnect.haip' on 'xulq1' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'xulq1' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on'xulq1'

CRS-2677: Stop of 'ora.drivers.acfs' on'xulq1' succeeded

CRS-2677: Stop of 'ora.cssd' on 'xulq1'succeeded

CRS-2673: Attempting to stop 'ora.crf' on'xulq1'

CRS-2677: Stop of 'ora.crf' on 'xulq1'succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on'xulq1'

CRS-2677: Stop of 'ora.gipcd' on 'xulq1'succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on'xulq1'

CRS-2677: Stop of 'ora.gpnpd' on 'xulq1'succeeded

CRS-2793: Shutdown of Oracle High AvailabilityServices-managed resources on 'xulq1' has completed

CRS-4133: Oracle High Availability Serviceshas been stopped.

Removing Trace File Analyzer

Successfully deconfigured Oracleclusterware stack on this node

 

4.在最后一个节点运行

#/u01/product/11.2/grid/crs/install/rootcrs.pl-verbose -deconfig -force -lastnode

[root@xulq2 ~]#/u01/product/11.2/grid/crs/install/rootcrs.pl -verbose -deconfig -force-lastnode

Using configuration parameter file:/u01/product/11.2/grid/crs/install/crsconfig_params

CRS resources for listeners are stillconfigured

Network exists:1/192.168.56.0/255.255.255.0/eth0, type static

VIP exists:/xulq2-vip/192.168.56.83/192.168.56.0/255.255.255.0/eth0, hosting node xulq2

GSD exists

ONS exists: Local port 6100, remote port6200, EM port 2016

CRS-2673: Attempting to stop'ora.registry.acfs' on 'xulq2'

CRS-2677: Stop of 'ora.registry.acfs' on'xulq2' succeeded

CRS-2673: Attempting to stop 'ora.crsd' on'xulq2'

CRS-2790: Starting shutdown of ClusterReady Services-managed resources on 'xulq2'

CRS-2673: Attempting to stop 'ora.oc4j' on'xulq2'

CRS-2673: Attempting to stop 'ora.DATA.dg'on 'xulq2'

CRS-2673: Attempting to stop 'ora.xulq.db'on 'xulq2'

CRS-2677: Stop of 'ora.xulq.db' on 'xulq2'succeeded

CRS-2673: Attempting to stop'ora.DATA_DG1.dg' on 'xulq2'

CRS-2677: Stop of 'ora.DATA_DG1.dg' on'xulq2' succeeded

CRS-2677: Stop of 'ora.DATA.dg' on 'xulq2'succeeded

CRS-2673: Attempting to stop 'ora.asm' on'xulq2'

CRS-2677: Stop of 'ora.oc4j' on 'xulq2'succeeded

CRS-2677: Stop of 'ora.asm' on 'xulq2'succeeded

CRS-2792: Shutdown of Cluster ReadyServices-managed resources on 'xulq2' has completed

CRS-2677: Stop of 'ora.crsd' on 'xulq2'succeeded

CRS-2673: Attempting to stop 'ora.ctssd' on'xulq2'

CRS-2673: Attempting to stop 'ora.evmd' on'xulq2'

CRS-2673: Attempting to stop 'ora.asm' on'xulq2'

CRS-2677: Stop of 'ora.evmd' on 'xulq2'succeeded

CRS-2677: Stop of 'ora.asm' on 'xulq2'succeeded

CRS-2673: Attempting to stop'ora.cluster_interconnect.haip' on 'xulq2'

CRS-2677: Stop of'ora.cluster_interconnect.haip' on 'xulq2' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'xulq2'succeeded

CRS-2673: Attempting to stop 'ora.cssd' on'xulq2'

CRS-2677: Stop of 'ora.cssd' on 'xulq2'succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor'on 'xulq2'

CRS-2676: Start of 'ora.cssdmonitor' on'xulq2' succeeded

CRS-2672: Attempting to start 'ora.cssd' on'xulq2'

CRS-2672: Attempting to start 'ora.diskmon'on 'xulq2'

CRS-2676: Start of 'ora.diskmon' on 'xulq2'succeeded

CRS-2676: Start of 'ora.cssd' on 'xulq2'succeeded

CRS-4611: Successful deletion of votingdisk +DATA.

ASM de-configuration trace file location:/tmp/asmcadc_clean2016-10-19_10-33-59-AM.log

ASM Clean Configuration START

ASM Clean Configuration END

 

ASM with SID +ASM1 deleted successfully.Check /tmp/asmcadc_clean2016-10-19_10-33-59-AM.log for details.

 

CRS-2791: Starting shutdown of Oracle HighAvailability Services-managed resources on 'xulq2'

CRS-2673: Attempting to stop 'ora.crf' on'xulq2'

CRS-2673: Attempting to stop 'ora.ctssd' on'xulq2'

CRS-2673: Attempting to stop 'ora.asm' on'xulq2'

CRS-2673: Attempting to stop 'ora.mdnsd' on'xulq2'

CRS-2677: Stop of 'ora.mdnsd' on 'xulq2'succeeded

CRS-2677: Stop of 'ora.crf' on 'xulq2'succeeded

CRS-2677: Stop of 'ora.ctssd' on 'xulq2'succeeded

CRS-2677: Stop of 'ora.asm' on 'xulq2'succeeded

CRS-2673: Attempting to stop'ora.cluster_interconnect.haip' on 'xulq2'

CRS-2677: Stop of'ora.cluster_interconnect.haip' on 'xulq2' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on'xulq2'

CRS-2677: Stop of 'ora.cssd' on 'xulq2'succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on'xulq2'

CRS-2677: Stop of 'ora.gipcd' on 'xulq2'succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on'xulq2'

CRS-2677: Stop of 'ora.gpnpd' on 'xulq2'succeeded

CRS-2793: Shutdown of Oracle HighAvailability Services-managed resources on 'xulq2' has completed

CRS-4133: Oracle High Availability Serviceshas been stopped.

Removing Trace File Analyzer

Successfully deconfigured Oracleclusterware stack on this node

 

5. 修改主机名称

smitty tcpip修改主机名

第一节点:xulq1 修改为 xurac1

第一节点:xulq2 修改为 xurac2

修改方法:

hostname xurac1

hostname xurac2

 

vi /etc/sysconfig/network

 

vi /etc/hosts

:g/xulq1/s//xurac1/g

:g/xulq2/s//xurac2/g

 

6. 修改11g grid的参数文件(Node1,Node2)

$vi ORACLE_HOME/crs/install/crsconfig_params

:g/xulq1/s//xurac1/g

:g/xulq2/s//xurac2/g

 

7. 重建grid用户互信

因为主机名修改了,两节点间grid用户信任关系需要重建

$/u01/product/11.2/grid/deinstall/sshUserSetup.sh-user grid -hosts xurac1 xurac2 -noPromptPassphrase

 

8. 在各个节点依次运行root.sh脚本

节点1运行root.sh

另外一个节点运行root.sh

 

# /u01/product/11.2/grid/root.sh

[root@xurac1 ~]#/u01/product/11.2/grid/root.sh

Performing root user operation for Oracle11g

 

The following environment variables are setas:

   ORACLE_OWNER= grid

   ORACLE_HOME= /u01/product/11.2/grid

 

Enter the full pathname of the local bindirectory: [/usr/local/bin]:

The contents of "dbhome" have notchanged. No need to overwrite.

The contents of "oraenv" have notchanged. No need to overwrite.

The contents of "coraenv" havenot changed. No need to overwrite.

 

Entries will be added to the /etc/oratabfile as needed by

Database Configuration Assistant when adatabase is created

Finished running generic part of rootscript.

Now product-specific root actions will beperformed.

Using configuration parameter file:/u01/product/11.2/grid/crs/install/crsconfig_params

User ignored Prerequisites duringinstallation

Installing Trace File Analyzer

OLR initialization - successful

Adding Clusterware entries to inittab

CRS-2672: Attempting to start 'ora.mdnsd'on 'xurac1'

CRS-2676: Start of 'ora.mdnsd' on 'xurac1'succeeded

CRS-2672: Attempting to start 'ora.gpnpd'on 'xurac1'

CRS-2676: Start of 'ora.gpnpd' on 'xurac1'succeeded

CRS-2672: Attempting to start'ora.cssdmonitor' on 'xurac1'

CRS-2672: Attempting to start 'ora.gipcd'on 'xurac1'

CRS-2676: Start of 'ora.cssdmonitor' on'xurac1' succeeded

CRS-2676: Start of 'ora.gipcd' on 'xurac1'succeeded

CRS-2672: Attempting to start 'ora.cssd' on'xurac1'

CRS-2672: Attempting to start 'ora.diskmon'on 'xurac1'

CRS-2676: Start of 'ora.diskmon' on'xurac1' succeeded

CRS-2676: Start of 'ora.cssd' on 'xurac1'succeeded

 

ASM created and started successfully.

 

Disk Group DATA created successfully.

 

clscfg: -install mode specified

Successfully accumulated necessary OCRkeys.

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

Operation successful.

Successful addition of voting disk3adb021c4d6d4f91bf4fbee1e7502bfe.

Successfully replaced voting disk groupwith +DATA.

CRS-4266: Voting file(s) successfullyreplaced

## STATE    File Universal Id                File Name Disk group

-- -----    -----------------                --------- ---------

 1.ONLINE   3adb021c4d6d4f91bf4fbee1e7502bfe(ORCL:OCR_DM01) [DATA]

Located 1 voting disk(s).

CRS-2672: Attempting to start 'ora.asm' on'xurac1'

CRS-2676: Start of 'ora.asm' on 'xurac1'succeeded

CRS-2672: Attempting to start 'ora.DATA.dg'on 'xurac1'

CRS-2676: Start of 'ora.DATA.dg' on'xurac1' succeeded

Preparing packages for installation...

cvuqdisk-1.0.9-1

Configure Oracle Grid Infrastructure for aCluster ... succeeded

 

另一个节点执行:

[root@xurac2 ~]#/u01/product/11.2/grid/root.sh

Performing root user operation for Oracle11g

 

The following environment variables are setas:

   ORACLE_OWNER= grid

   ORACLE_HOME=  /u01/product/11.2/grid

 

Enter the full pathname of the local bindirectory: [/usr/local/bin]:

The contents of "dbhome" have notchanged. No need to overwrite.

The contents of "oraenv" have notchanged. No need to overwrite.

The contents of "coraenv" havenot changed. No need to overwrite.

 

Entries will be added to the /etc/oratabfile as needed by

Database Configuration Assistant when adatabase is created

Finished running generic part of rootscript.

Now product-specific root actions will beperformed.

Using configuration parameter file:/u01/product/11.2/grid/crs/install/crsconfig_params

User ignored Prerequisites duringinstallation

Installing Trace File Analyzer

OLR initialization - successful

Adding Clusterware entries to inittab

CRS-4402: The CSS daemon was started in exclusivemode but found an active CSS daemon on node xurac1, number 1, and isterminating

An active cluster was found duringexclusive startup, restarting to join the cluster

Preparing packages for installation...

cvuqdisk-1.0.9-1

Configure Oracle Grid Infrastructure for aCluster ... succeeded

 

9. 注册集群信息

9.1. grid用户asmca命令加载ASMVG

9.2. oracle用户注册集群信息

srvctl add database -d xulq -o $ORACLE_HOME

srvctl add instance -d xulq -i xulq1 -nxurac1   

srvctl add instance -d xulq -i xulq2 -nxurac2

 

root用户

./srvctl add scan -n  xulq-scan -S 8.8.6.0/255.255.255.0

 

10.mount ASM磁盘组

alter diskgroup DATA_DG1 mount;

 

11.grid用户netca注册监听

netca -silent -responsefile/u01/product/11.2/grid/assistants/netca/netca.rsp

 

12. 启动数据库实例

$ srvctl start database -d xulq

 

备注:

hostname命名只允许使用:字母a-z,数字0-9,和"-",不允许使用点 "."和"_"。

0 0
原创粉丝点击