续上一篇博文,集群启动正常后,发现数据库不能正常启动:
环境:虚拟机:VBOX,操作系统为RHEL5.6,数据库为Oracle11.2.0.1.0
问题:在启动数据库时报如下错误:
[oracle@node1 ~]$ ps -ef|grep ora_
oracle 5879 5844 0 17:46 pts/1 00:00:00 grep ora_
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 18 17:46:31 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/devdb/spfiledevdb.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/devdb/spfiledevdb.ora
ORA-12547: TNS:lost contact
解决方法:
1.尝试重建spfile,发现也报错:
SQL> create spfile='+DATA/devdb/spfiledevdb.ora' from pfile;
create spfile='+DATA/devdb/spfiledevdb.ora' from pfile
*
ERROR at line 1:
ORA-17502: ksfdcre:4 Failed to create file +DATA/devdb/spfiledevdb.ora
ORA-12547: TNS:lost contact
2.从网上搜索解决方法如下:
检查ORACLE_HOME/bin目录与GRID_HOME/bin目录下的oracle文件,u和g组必有s属性:
[root@node1 app]# cd /u01/app/oracle/product/11.2.0/db_1/bin/
[root@node1 bin]# ls -ltr oracle
-r-sr-s--x 1 oracle asmadmin 210824720 Apr 10 2013 oracle
[root@node1 bin]# cd /u01/app/11.2.0/grid/bin/
[root@node1 bin]# ls -ltr oracle
-rwxr-x--x 1 grid oinstall 184286251 Apr 10 2013 oracle --u和g组没有s属性
3.进行修改:
[root@node1 bin]# chmod u+s oracle
[root@node1 bin]# ls -ltr oracle
-rwsr-x--x 1 grid oinstall 184286251 Apr 10 2013 oracle
[root@node1 bin]# chmod g+s oracle
[root@node1 bin]# ls -ltr oracle
-rwsr-s--x 1 grid oinstall 184286251 Apr 10 2013 oracle
4.再次启动实例1成功:
SQL> startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2213936 bytes
Variable Size 369100752 bytes
Database Buffers 41943040 bytes
Redo Buffers 4288512 bytes
Database mounted.
Database opened.
5.节点2也如此处理:
[root@node2 bin]# pwd
/u01/app/11.2.0/grid/bin
[root@node2 bin]# ls -l oracle
-rwxr-x--x 1 grid oinstall 184286251 Apr 10 2013 oracle
[root@node2 bin]# chmod ug+s oracle
[root@node2 bin]# ls -l oracle
-rwsr-s--x 1 grid oinstall 184286251 Apr 10 2013 oracle
[root@node2 bin]#
[root@node2 bin]# cd /u01/app/oracle/product/11.2.0/db_1/bin/
[root@node2 bin]# pwd
/u01/app/oracle/product/11.2.0/db_1/bin
[root@node2 bin]# ls -l oracle
-r-sr-s--x 1 oracle asmadmin 210824720 Apr 10 2013 oracle
6.启动节点2的实例:
[oracle@node2 ~]$ srvctl start instance -d devdb -i devdb2
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
7.所有状态全部正常:
[oracle@node1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE node1
ora.FLASH.dg ora....up.type ONLINE ONLINE node1
ora.GRIDDG.dg ora....up.type ONLINE ONLINE node1
ora....ER.lsnr ora....er.type ONLINE ONLINE node1
ora....N1.lsnr ora....er.type ONLINE ONLINE node1
ora.asm ora.asm.type ONLINE ONLINE node1
ora.devdb.db ora....se.type ONLINE ONLINE node1
ora.eons ora.eons.type ONLINE ONLINE node1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE node1
ora....SM1.asm application ONLINE ONLINE node1
ora....E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip ora....t1.type ONLINE ONLINE node1
ora....SM2.asm application ONLINE ONLINE node2
ora....E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip ora....t1.type ONLINE ONLINE node2
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE node1
ora....ry.acfs ora....fs.type ONLINE ONLINE node1
ora.scan1.vip ora....ip.type ONLINE ONLINE node1
[oracle@node1 ~]$
总结:不明白为什么要有s属性,过后要搜索一下为什么。