Chinaunix首页 | 论坛 | 博客
  • 博客访问: 543602
  • 博文数量: 28
  • 博客积分: 150
  • 博客等级: 入伍新兵
  • 技术积分: 429
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-25 12:07
个人简介

Cisco Certified Internetwork Expert(Routing and Switching) CCIE R&S 2101X, IBM Certified Advanced Technical Expert - Power Systems with AIX v2, Red Hat Certified Engineer RHCE 130-165-39X, Oracle Certified Master 10g

文章分类

全部博文(28)

文章存档

2018年(1)

2017年(2)

2016年(4)

2015年(8)

2014年(4)

2013年(2)

2011年(7)

我的朋友

分类: Oracle

2014-06-30 16:32:12

========phanx.com========
Author:   phanx
Updated: 2014-6-30
转载请保留作者信息
=========================


MOS 上有参考文档 
How to change Hostname/ IP in GI standalone (SIHA) (文档 ID 1552810.1)。    
文档中对于ASM是采用新创建的PFILE重新添加ASM实例。其实就使用以前的SPFILE,也可以,只需要记下来,重新配置SPFILE的位置参数就行了。

点击(此处)折叠或打开

  1. // #行都使用root用户执行, $行使用对应用户执行
  2. # $GI_HOME/bin/crsctl status resource ora.asm -f
  3. // 记录以下两个参数的值
  4.                         ASM_DISKSTRING=/dev/UPRR*
  5.                         SPFILE=+UPRRDB_DATA/asm/asmparameterfile/registry.253.832110249

  6. # $GI_HOME/crs/install/roothas.pl -deconfig -force

  7. 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

  8. //改主机名
  1. # hostname uprr.phanx.com
  2. # vim /etc/hosts
  3. # vim /etc/sysconfig/network
  4. # service network restart


  5. //重新登录   Logout and re-login.

  6. # $GI_HOME/crs/install/roothas.pl

  7. 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

  8. # crs_stat -t

  9. 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   

  10. su - grid
  11. $ vim $GI_HOME/network/admin/listener.ora
  12. $ $GI_HOME/bin/srvctl add asm
  13. $ $GI_HOME/bin/crsctl modify resource "ora.asm" -attr "AUTO_START=1"
  14. $ $GI_HOME/bin/srvctl modify asm -p '+UPRRDB_DATA/asm/asmparameterfile/registry.253.832110249' -d '/dev/UPRR*'

  15. //检查监听是否已经启动,如果启动了就停止。 check if listener is active, if yes kill it.

  16. $  ps -ef|grep tnslsnr|grep -v grep | awk '{print $2}'|xargs -L1 kill -9



  17. $ $GI_HOME/bin/srvctl add listener -l LISTENER -o $GI_HOME
  18. $ $GI_HOME/bin/lsnrctl start
  19. $ crsctl start resource ora.cssd

  20. 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

  21. $ sqlplus / as sysasm
  22. SQL> startup
  23. SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=uprr.phanx.com)(PORT=1521))))';


  24. # su - oracle
  25. $ srvctl add database -d UPRR -o $ORACLE_HOME
  26. $ sqlplus / as sysdba
  27. SQL> startup
  28. SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=uprr.phanx.com)(PORT=1521))))';
  29. # $GI_HOME/bin/crs_stat -t
  30. 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
阅读(6554) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~