今天在启动自己测试环境中的RAC其中一个实例,然而启动了几分后数据库仍不能连接,查看CRS资源,发现INSTANCE为UNKNOWN状态。如下:
- [oracle@oracle10grac1 ~]$ crs_stat.sh
- Name Target State Host
- ------------------------------ ---------- --------- -------
- ora.oracle10grac1.ASM1.asm ONLINE ONLINE oracle10grac1
- ora.oracle10grac1.LISTENER_ORACLE10GRAC1.lsnr ONLINE ONLINE oracle10grac1
- ora.oracle10grac1.gsd ONLINE ONLINE oracle10grac1
- ora.oracle10grac1.ons ONLINE ONLINE oracle10grac1
- ora.oracle10grac1.vip ONLINE ONLINE oracle10grac1
- ora.oracle10grac2.ASM2.asm ONLINE OFFLINE
- ora.oracle10grac2.LISTENER_ORACLE10GRAC2.lsnr ONLINE OFFLINE
- ora.oracle10grac2.gsd ONLINE OFFLINE
- ora.oracle10grac2.ons ONLINE OFFLINE
- ora.oracle10grac2.vip ONLINE ONLINE oracle10grac1
- ora.orcl.db ONLINE UNKNOWN oracle10grac1
- ora.orcl.orcl1.inst ONLINE UNKNOWN oracle10grac1
- ora.orcl.orcl2.inst ONLINE OFFLINE
由于手动启动数据库:
- [oracle@oracle10grac1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 30 22:10:36 2012
- Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
- Connected to an idle instance.
- SQL> startup
- ORA-00119: invalid specification for system parameter REMOTE_LISTENER
- ORA-00132: syntax error or unresolved network name 'LISTENERS_ORCL'
ORA-00119报错,还有可能是下面的提示,如果遇到,请查看连接:http://luoping.blog.51cto.com/534596/273241环境是单机+文件系统
- SQL> startup
- ORA-00119: invalid specification for system parameter LOCAL_LISTENER
- ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
奇怪了,报REMOTE_LISTENER错误。
查看TNSNAMES.ORA文件,是正常的。如下:
- LISTENERS_ORCL =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10grac1-vip)(PORT = 1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10grac2-vip)(PORT = 1521))
- )
导出SPFILE文件,
- SQL> create pfile='/tmp/pfile.ora' from spfile='+cata/orcl/spfileorcl.ora';
- create pfile='/tmp/pfile.ora' from spfile='+cata/orcl/spfileorcl.ora'
- *
- ERROR at line 1:
- ORA-07392: sftcls: fclose error, unable to close text file.
又报错了,
查看ORA-07392报错
- [oracle@oracle10grac1 ~]$ oerr ora 07392
- 07392, 00000, "sftcls: fclose error, unable to close text file."
- // *Cause: Fclose library routine returned an error.
- // *Action: Possible internal oracle error.
没有看懂。由于修改pfileorcl1.ora文件把数据库启动起来。
- [oracle@oracle10grac1 ~]$ cd $ORACLE_HOME/dbs/
- [oracle@oracle10grac1 dbs]$ cp initorcl1.ora initorcl1.ora.back
- [oracle@oracle10grac1 dbs]$ cat initorcl1.ora
- spfile=+cata/orcl/spfileorcl.ora
- remote_listener=''
再次手动启动数据库
- SQL> startup
- ORACLE instance started.
- Total System Global Area 314572800 bytes
- Fixed Size 2083592 bytes
- Variable Size 155190520 bytes
- Database Buffers 150994944 bytes
- Redo Buffers 6303744 bytes
- Database mounted.
- Database opened.
查看监听状态:
- [oracle@oracle10grac1 dbs]$ lsnrctl status
- LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 30-MAY-2012 23:06:02
- Copyright (c) 1991, 2007, Oracle. All rights reserved.
- Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
- STATUS of the LISTENER
- ------------------------
- Alias LISTENER_ORACLE10GRAC1
- Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
- Start Date 30-MAY-2012 21:49:36
- Uptime 0 days 1 hr. 16 min. 25 sec
- Trace Level off
- Security ON: Local OS Authentication
- SNMP OFF
- Listener Parameter File /app/oracle/product/10.2.0/db_1/network/admin/listener.ora
- Listener Log File /app/oracle/product/10.2.0/db_1/network/log/listener_oracle10grac1.log
- Listening Endpoints Summary...
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.232.41)(PORT=1521)))
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.232.31)(PORT=1521)))
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10grac1)(PORT=8800))(Presentation=HTTP)(Session=RAW))
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10grac1)(PORT=7788))(Presentation=FTP)(Session=RAW))
- Services Summary...
- Service "+ASM" has 1 instance(s).
- Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
- Service "+ASM_XPT" has 1 instance(s).
- Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
- Service "PLSExtProc" has 1 instance(s).
- Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
- Service "orcl" has 1 instance(s).
- Instance "orcl1", status READY, has 2 handler(s) for this service...
- Service "orclXDB" has 1 instance(s).
- Instance "orcl1", status READY, has 1 handler(s) for this service...
- Service "orcl_XPT" has 1 instance(s).
- Instance "orcl1", status READY, has 2 handler(s) for this service...
- The command completed successfully
查看tnsnames.ora文件的权限
- [oracle@oracle10grac1 dbs]$ cd $ORACLE_HOME/network/admin
- [oracle@oracle10grac1 admin]$ ls
- afiedt.buf listener1105176AM2105.bak listener.ora OCRDUMPFILE samples shrept.lst sqlnet.ora tnsnames1105176AM2105.bak tnsnames.ora
- [oracle@oracle10grac1 admin]$ ls -l *
- -rw-r--r-- 1 oracle oinstall 43 Apr 3 13:35 afiedt.buf
- -rw-r--r-- 1 oracle oinstall 566 May 17 2011 listener1105176AM2105.bak
- -rw-r----- 1 oracle oinstall 578 May 4 15:35 listener.ora
- -rw-r--r-- 1 oracle oinstall 38254 Jul 16 2011 OCRDUMPFILE
- -rw-r----- 1 oracle oinstall 172 Dec 26 2003 shrept.lst
- -rw-r--r-- 1 oracle oinstall 233 May 4 15:35 sqlnet.ora
- -rw-r--r-- 1 oracle oinstall 1440 May 17 2011 tnsnames1105176AM2105.bak
- -rw-r----- 1 oracle oinstall 1743 May 4 15:35 tnsnames.ora
- samples:
- total 40
- -rw-r----- 1 oracle oinstall 3867 Sep 9 1997 listener.ora
- -rw-r----- 1 oracle oinstall 31023 Sep 9 2003 sqlnet.ora
- -rw-r----- 1 oracle oinstall 2939 Feb 13 1997 tnsnames.ora
看了上面这些都配置正确,没有办法了,由于手动修改tnsnames.ora文件的权限
- [oracle@oracle10grac1 admin]$ chmod 777 tnsnames.ora
- [oracle@oracle10grac1 admin]$ ls -l
- total 72
- -rw-r--r-- 1 oracle oinstall 43 Apr 3 13:35 afiedt.buf
- -rw-r--r-- 1 oracle oinstall 566 May 17 2011 listener1105176AM2105.bak
- -rw-r----- 1 oracle oinstall 578 May 4 15:35 listener.ora
- -rw-r--r-- 1 oracle oinstall 38254 Jul 16 2011 OCRDUMPFILE
- drwxr-x--- 2 oracle oinstall 4096 May 17 2011 samples
- -rw-r----- 1 oracle oinstall 172 Dec 26 2003 shrept.lst
- -rw-r--r-- 1 oracle oinstall 233 May 4 15:35 sqlnet.ora
- -rw-r--r-- 1 oracle oinstall 1440 May 17 2011 tnsnames1105176AM2105.bak
- -rwxrwxrwx 1 oracle oinstall 1743 May 4 15:35 tnsnames.ora
把数据库关闭,再次重启正常:
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup
- ORACLE instance started.
- Total System Global Area 314572800 bytes
- Fixed Size 2083592 bytes
- Variable Size 155190520 bytes
- Database Buffers 150994944 bytes
- Redo Buffers 6303744 bytes
- Database mounted.
- Database opened.
还是觉得奇怪,由于我手动把tnsnames.ora文件的权限分别改成了640于000,改成640后数据库仍启动正常,改成000后,报上面相同的报错。为什么之前权限为640就报错呢?想不通
本文转自7343696 51CTO博客,原文链接:http://blog.51cto.com/luoping/964475,如需转载请自行联系原作者