一、现象分析:
1、数据库和实例服务无法启动,如下:
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.....CRM.cs application ONLINE OFFLINE rac1
ora....cl1.srv application ONLINE OFFLINE rac1
ora.orcl.db application ONLINE OFFLINE rac2
ora....l1.inst application ONLINE OFFLINE rac1
ora....l2.inst application ONLINE OFFLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
2、单独启动某个应用服务依然启不起来
3、用sqlplus启动实例,如下:
[oracle@rac1]$ export ORACLE_SID=devdb1
SQL> startup;
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DG1/devdb/spfiledevdb.ora'
ORA-17503: ksfdopn:2 Failed to open file +DG1/devdb/spfiledevdb.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
可以看出diskgroup没有mount,所以先把diskgroup mount
也可做下面的测试,同样也会报磁盘组没挂载:
[oracle@rac1 bdump]$ export ORACLE_SID=+ASM1
[oracle@rac1 bdump]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 22 17:59:39 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> shutdown immediate;
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> startup;
ASM instance started
Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
二、解决办法:
1、首先挂载ASM磁盘组
[oracle@rac1 bdump]$ export ORACLE_SID=+ASM1
[oracle@rac1 bdump]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 22 17:59:39 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
RECOVERYDEST DISMOUNTED
DG1 DISMOUNTED
SQL> alter diskgroup RECOVERYDEST mount;
Diskgroup altered.
SQL> alter diskgroup DG1 mount;
Diskgroup altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
2、启动数据库实例
[oracle@rac1 bdump]$ export ORACLE_SID=devdb1
[oracle@rac1 bdump]$ sqlplus / as sysdba
SQL> startup;
ORACLE instance started.
Total System Global Area 264241152 bytes
Fixed Size 1218868 bytes
Variable Size 109053644 bytes
Database Buffers 150994944 bytes
Redo Buffers 2973696 bytes
Database mounted.
database open.
三、原因:
发现可能是因为oracle用户下的.bashrc文件中$ORACLE_SID环境变量与实际建库的数据库名不一致所至,所以在数据库启动时会找不到环境变量对应的实例名
.bashrc中是orcl1
[oracle@rac1~]cat .bashrc
.....
export ORACLE_SID=orcl1
.....
而实现的实例名是devdb1
所以修改.bashrc中的ORACLE_SID=devdb1