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



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值