ORA-12537: TNS:connection closed

问题描述:

1、就在刚才,遇到了一个小问题,通过服务名怎么也连接不上数据库:

[oracle@rac1 ~]$ sqlplus system/oracle@rac

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 5 13:31:17 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12537: TNS:connection closed

2、但是通过sqlplus / as sysdba是可以连接上的,于是乎检查监听,正常:

[oracle@rac1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 05-JUN-2017 13:30:51

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                05-JUN-2017 13:19:05
Uptime                    0 days 0 hr. 11 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/grid/app/11.2.0/network/admin/listener.ora
Listener Log File         /u01/grid/app/grid/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.201)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "rac" has 1 instance(s).
  Instance "rac1", status READY, has 1 handler(s) for this service...
Service "racXDB" has 1 instance(s).
  Instance "rac1", status READY, has 1 handler(s) for this service...
The command completed successfully

3、而且tnsping也是ok的:

[oracle@rac1 ~]$ tnsping rac

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 05-JUN-2017 13:31:48

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = rac)))
OK (10 msec)

解决办法:

1、检查权限:

[oracle@rac1 ~]$ cd /u01/oracle/app/11.2.0/bin/
[oracle@rac1 bin]$ ls -lh oracle
-rwxr-x--x 1 oracle oinstall 229M Mar 22 09:52 oracle

 2、修改权限为6751:    
[oracle@rac1 bin]$ chmod 6751 oracle
[oracle@rac1 bin]$ ls -lh oracle
-rwsr-s--x 1 oracle oinstall 229M Mar 22 09:52 oracle

3、重新连接就可以连接上了:
[oracle@rac1 bin]$ sqlplus system/oracle@rac

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 5 13:33:57 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

总结:

对于RAC环境,轻易不要修改安装目录下任何一个文件的权限,以免不必要的麻烦。


参考文章:

http://www.linuxidc.com/Linux/2016-01/126988.htm




你可能感兴趣的:(读书笔记)