Author: phanx
Updated: 2014-6-30
转载请保留作者信息
=========================
MOS 上有参考文档 How to change Hostname/ IP in GI standalone (SIHA) (文档 ID 1552810.1)。
文档中对于ASM是采用新创建的PFILE来重新添加ASM实例。其实就使用以前的SPFILE,也可以,只需要记下来,重新配置SPFILE的位置参数就行了。
点击(此处)折叠或打开
- // #行都使用root用户执行, $行使用对应用户执行
-
# $GI_HOME/bin/crsctl status resource ora.asm -f
- // 记录以下两个参数的值
-
ASM_DISKSTRING=/dev/UPRR*
-
SPFILE=+UPRRDB_DATA/asm/asmparameterfile/registry.253.832110249
-
- # $GI_HOME/crs/install/roothas.pl -deconfig -force
-
-
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS 守护程序已停止。
CRS-2673: Attempting to stop 'ora.UPRRDB_DATA.dg' on 'uprr1'
CRS-2677: Stop of 'ora.UPRRDB_DATA.dg' on 'uprr1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'uprr1'
CRS-2677: Stop of 'ora.asm' on 'uprr1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'uprr1'
CRS-2677: Stop of 'ora.cssd' on 'uprr1' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'uprr1'
CRS-2673: Attempting to stop 'ora.evmd' on 'uprr1'
CRS-2677: Stop of 'ora.evmd' on 'uprr1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'uprr1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack -
- //改主机名
- # hostname uprr.phanx.com
-
# vim /etc/hosts
-
# vim /etc/sysconfig/network
-
# service network restart
-
-
-
//重新登录 Logout and re-login.
-
-
# $GI_HOME/crs/install/roothas.pl
-
-
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node uprr successfully pinned.
Adding Clusterware entries to upstart
uprr 2014/06/30 14:48:16 /u01/app/grid/product/11.2.0/grid/cdata/uprr/backup_20140630_144816.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
-
# crs_stat -t
-
-
Name Type Target State Host
------------------------------------------------------------
ora.cssd ora.cssd.type OFFLINE OFFLINE
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE uprr
ora.ons ora.ons.type OFFLINE OFFLINE
- su - grid
-
$ vim $GI_HOME/network/admin/listener.ora
-
$ $GI_HOME/bin/srvctl add asm
-
$ $GI_HOME/bin/crsctl modify resource "ora.asm" -attr "AUTO_START=1"
-
$ $GI_HOME/bin/srvctl modify asm -p '+UPRRDB_DATA/asm/asmparameterfile/registry.253.832110249' -d '/dev/UPRR*'
-
-
//检查监听是否已经启动,如果启动了就停止。 check if listener is active, if yes kill it.
-
-
$ ps -ef|grep tnslsnr|grep -v grep | awk '{print $2}'|xargs -L1 kill -9
-
-
-
-
$ $GI_HOME/bin/srvctl add listener -l LISTENER -o $GI_HOME
- $ $GI_HOME/bin/lsnrctl start
-
$ crsctl start resource ora.cssd
-
-
CRS-2672: Attempting to start 'ora.cssd' on 'uprr'
CRS-2672: Attempting to start 'ora.diskmon' on 'uprr'
CRS-2676: Start of 'ora.diskmon' on 'uprr' succeeded
CRS-2676: Start of 'ora.cssd' on 'uprr' succeeded
-
$ sqlplus / as sysasm
- SQL> startup
- SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=uprr.phanx.com)(PORT=1521))))';
-
-
-
# su - oracle
-
$ srvctl add database -d UPRR -o $ORACLE_HOME
-
$ sqlplus / as sysdba
-
SQL> startup
- SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=uprr.phanx.com)(PORT=1521))))';
- # $GI_HOME/bin/crs_stat -t
-
Name Type Target State Host
------------------------------------------------------------
ora....ER.lsnr ora....er.type ONLINE ONLINE uprr
ora....DATA.dg ora....up.type ONLINE ONLINE uprr
ora.asm ora.asm.type ONLINE ONLINE uprr
ora.cssd ora.cssd.type ONLINE ONLINE uprr
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE uprr
ora.ons ora.ons.type OFFLINE OFFLINE
ora.uprr.db ora....se.type ONLINE ONLINE uprr
如果还有其它地方,像 tnsnames.ora, sqlnet.ora 中,如果有主机名的地方,对应修改以下。
我没有用DB Control,如果有的话,还需要重建DB Control,参考 MOS 文档 Note 278100.1 How To Drop, Create And Recreate the Database Control (DB Control) Release 10g and 11g
278100.pdf