oracle 11gR2 grid单机使用asm存储修改主机名后导致的故障处理
oracle 11gR2 grid单机使用asm存储修改主机名后导致的故障处理
一. 问题描述:
在虚拟机中测试,为了方便就修改了主机名,然后结果重启服务器后就css和oha都起不来了
原因分析:
grid不能改主机名
standalone改了就得重配 restart
cluster的话改主机名只能使用增删节点的方式
This document is about reconfiguring Oracle Restart. One reasonfor such action might be if the server (host) was renamed. If that was the caseand the server was rebooted, the ASM startup would fail with ORA-29701.
The solution is to reconfigure Oracle Restart.
has检查:
[root@itpux grid]# crsctl start has
CLSU-00100: Operating System function:opendir failed with error data: 2
CLSU-00101: Operating System error message:No such file or directory
CLSU-00103: error location: scrsearch1
CLSU-00104: additional error information:cant open scr home dir scls_scr_getval
CRS-4000: Command Start failed, orcompleted with errors.
[root@itpux grid]# hostname
itpux
[root@itpux grid]#
css检查:
[root@itpux grid]# crsctl check css
CRS-4639: Could not contact Oracle HighAvailability Services
CRS-4000: Command Check failed, orcompleted with errors.
[root@itpux grid]#
启动+asm实例报错:
[grid@itpux grid]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 28 13:12:11 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing systemparameters
ORA-29701: unable to connect to Cluster Synchronization Service
SQL>
二. 解决方案参考文档:
How to Reconfigure Oracle Restart (文档 ID 986740.1)
实施步骤:
1. Remove Oracle Restart configuration
This step should be performedas privileged (root) user.
#$GRID_HOME/crs/install/roothas.pl -deconfig -forceThe expected result is "Successfully deconfigured OracleRestart stack".
[root@[color=#0100]itpux grid]# $GRID_HOME/crs/install/roothas.pl -deconfig-force
bash: /crs/install/roothas.pl: No such fileor directory
[root@[color=#0100]itpux grid]#$GRID_HOME/crs/install/roothas.pl -deconfig -force
bash: /crs/install/roothas.pl: No such fileor directory
[root@itpux grid]#$ORACLE_HOME/crs/install/roothas.pl -deconfig -force
Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle HighAvailability Services
CRS-4000: Command Stop failed, or completedwith errors.
CRS-4639: Could not contact Oracle HighAvailability Services
CRS-4000: Command Delete failed, orcompleted with errors.
CLSU-00100: Operating System function:opendir failed with error data: 2
CLSU-00101: Operating System error message:No such file or directory
CLSU-00103: error location: scrsearch1
CLSU-00104: additional error information:cant open scr home dir scls_scr_getval
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completedwith errors.
Successfully deconfigured Oracle Restartstack
[root@itpux grid]#
2. ReconfigureOracle Restart
This step should also beperformed as privileged (root) user.
#$GRID_HOME/crs/install/roothas.plThe expected result is "Successfully configured Oracle GridInfrastructure for a Standalone Server"
[root@node1bak grid]# $ORACLE_HOME/crs/install/roothas.pl
Using configuration parameter file:/u01/app/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 node1bak successfully pinned.
Adding Clusterware entries to inittab
node1bak 2016/09/1811:20:40 /u01/app/11.2.0/grid/cdata/node1bak/backup_20160918_112040.olr
Successfully configured Oracle Grid Infrastructure for aStandalone Server
[root@[color=#0100]itpux grid]#
3. Add ASM back to Oracle Restart configuration
This step should be performed as Grid Infrastructure owner (grid user). $ srvctl add asmThe expected result is no output, just a return to the operatingsystem prompt.
[grid@itpux~]$ srvctl add asm
[grid@itpux~]$
4. Start up ASM instance
This step should be performed as Grid Infrastructure owner (grid user). $ ]srvctlstart asmThat should start ASM. Note that at this time there will be no ASM initialization or server parameter file. [grid@itpux~]$ srvctl start asm[grid@itpux~]$
5. Recreate ASM server parameter file (SPFILE)
This step should be performed as Grid Infrastructure owner (grid user)asm_diskgroups='DATA','RECO'
instance_type='asm'
large_pool_size=12M
remote_login_passwordfile='EXCLUSIVE'Mount the disk group where the new server parameter file (SPFILE) will reside (e.g. DATA) and create SPFILE:$ sqlplus / as sysasm
SQL> alter diskgroup DATA mount;
Diskgroup altered.
SQL> create spfile='+DATA' from pfile='/tmp/init+ASM.ora';
File created.
SQL> show parameter spfile
NAME TYPE VALUE
------- ------- -------------------------------------------------
spfile string +DATA/asm/asmparameterfile/registry.253.707737977SQL> startup pfile='/tmp/init+ASM.ora';
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA" cannot bemounted
ORA-15063: ASM discovered an insufficient number ofdisks for diskgroup "DATA"
SQL>
[root@itpux tmp]# cat init+ASM.ora
asm_diskgroups='DATA'
instance_type='asm'
large_pool_size=12M
remote_login_passwordfile='EXCLUSIVE'
asm_diskstring='/dev/sdb*'
[root@itpux tmp]#
SQL> shutdown immediate
ORA-15100: invalid or missing diskgroup name
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> SQL> SQL> SQL> SQL> SQL>
SQL>
SQL>
SQL> startup pfile='/tmp/init+ASM.ora';
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> createspfile='+DATA' from pfile='/tmp/init+ASM.ora';
File created.
SQL> show parameter pfile
NAME TYPE VALUE
----------------------------------------------- ------------------------------
spfile string
SQL> shutdown immediate
ASM diskgroups volume disabled
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL>
6. Restart HASstackcrsctl stop has
crsctl start has[root@itpux grid]# crsctl stop has
CRS-2791: Starting shutdown of Oracle HighAvailability Services-managed resources on 'node1bak'
CRS-2673: Attempting to stop 'ora.DATA.dg'on 'node1bak'
CRS-2677: Stop of 'ora.DATA.dg' on'node1bak' succeeded
CRS-2679: Attempting to clean 'ora.DATA.dg'on 'node1bak'
CRS-2681: Clean of 'ora.DATA.dg' on'node1bak' succeeded
CRS-2673: Attempting to stop 'ora.asm' on'node1bak'
CRS-2677: Stop of 'ora.asm' on 'node1bak'succeeded
CRS-2673: Attempting to stop 'ora.cssd' on'node1bak'
CRS-2677: Stop of 'ora.cssd' on 'node1bak'succeeded
CRS-2673: Attempting to stop 'ora.evmd' on'node1bak'
CRS-2677: Stop of 'ora.evmd' on 'node1bak'succeeded
CRS-2793: Shutdown of Oracle HighAvailability Services-managed resources on 'node1bak' has completed
CRS-4133: Oracle High Availability Serviceshas been stopped.
[root@node1bak grid]#
[root@itpux grid]# crsctl start has
CRS-4123: Oracle High Availability Serviceshas been started.
[root@itpux grid]#
7. Addcomponents back to Oracle Restart Configuration
If you had the database, listener and other components, add them back to the Oracle Restart Configuration.
[i][color=#0088]7.1. Add database componentThis step should be performed as RDBMS owner (oracle user).srvctl adddatabase -d
[oracle@itpux ~]$
[i][color=#0088]7.2. Addlistener componentThis step should be performed as Grid Infrastructure owner (grid user).srvctl addlistener[grid@itpux ~]$ srvctl add listener
[grid@itpux ~]$
[i][color=#0088]7.3. Add othercomponentsFor information on how to add back additional components, please review:Oracle Database Administrator's Guide 11g Release 2 (11.2)Chapter 4 Configuring Automatic Restart of an Oracle DatabaseSection Configuring Oracle Restart
8. 最后startup数据库
[oracle@itpux ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 28 14:12:11 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1235959808 bytes
Fixed Size 2252784 bytes
Variable Size 738197520 bytes
Database Buffers 486539264 bytes
Redo Buffers 8970240 bytes
Database mounted.
Database opened.
SQL>