ORA-12537 TNS connection closed错误处理过程

news/2024/7/4 23:35:30
                       

1,同事说oracle测试换了连接不上了,报错如下

[oracle@pldb236 admin]$ rlwrap sqlplus powerdesk/pd141118@PD236SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 23 14:16:31 2015Copyright (c) 1982, 2009, OracleAll rights reserved.ERROR:ORA-12537: TNS:connection closedEnter user-name: 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

检查监听正常,oracle服务也是正常启动的,但是登录不进去

[oracle@pldb236 admin]$ tnsping PD236TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 23-NOV-2015 14:17:22Copyright (c) 1997, 2009, Oracle.  All rights reserved.Used parameter files:Used TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.180.236)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = powerdes)))OK (10 msec)[oracle@pldb236 admin]$ 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

PS:原blog地址:http://blog.csdn.net/mchdba/article/category/3254519,未经过原csdn的博主mchdba允许,谢绝转载


2,解决方案

[oracle@pldb236 bin]$ cd $ORACLE_HOME/bin/[oracle@pldb236 bin]$ [oracle@pldb236 bin]$ [oracle@pldb236 bin]$ ll oracle-rwsr-s--x. 1 oracle oinstall 210823844 Jul 31 13:21 oracle[oracle@pldb236 bin]$ [oracle@pldb236 bin]$ chmod 6571 oracle[oracle@pldb236 bin]$ [oracle@pldb236 bin]$ ll oracle-r-srws--x. 1 oracle oinstall 210823844 Jul 31 13:21 oracle[oracle@pldb236 bin]$ [oracle@pldb236 bin]$ rlwrap sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 23 14:20:09 2015Copyright (c) 1982, 2009, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> SQL> 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

ok可以连接上了,问题初步解决


3,不过3分钟后,又不行了,登录不上去。

SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 23 14:29:17 2015

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

ERROR:
ORA-12537: TNS:connection closed

Enter user-name:

去查看lsnrctl状态:
    [oracle@pldb236 bin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-NOV-2015 14:30:33Copyright (c) 1991, 2009, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.180.236)(PORT=1521)))STATUS of the LISTENER------------------------Alias                     LISTENERVersion                   TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date                23-NOV-2015 14:30:19Uptime                    0 days 0 hr. 0 min. 13 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.oraListener Log File         /oracle/app/oracle/diag/tnslsnr/pldb236/listener/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.180.236)(PORT=1521)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))Services Summary...Service "PLSExtProc" has 1 instance(s).  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...Service "powerdes" has 1 instance(s).  Instance "powerdes", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully[oracle@pldb236 bin]$ 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

看到后台alert的日志报错如下:

        Mon Nov 23 14:32:00 2015        ORA-00020: maximum number of processes 150 exceeded        ORA-20 errors will not be written to the alert log for         the next minute. Please look at trace files to see all         the ORA-20 errors.        Mon Nov 23 14:32:47 2015        Process m000 submission failed with error = 20        Mon Nov 23 14:33:02 2015        ORA-00020: maximum number of processes 150 exceeded        ORA-20 errors will not be written to the alert log for         the next minute. Please look at trace files to see all         the ORA-20 errors.        Mon Nov 23 14:34:03 2015        ORA-00020: maximum number of processes 150 exceeded        ORA-20 errors will not be written to the alert log for         the next minute. Please look at trace files to see all         the ORA-20 errors.
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

解决方案1:
lsnrctl stop 5分钟后,再lsnrctl start起来,问题解决了,是应用程序一直不停的连接数据库,占满了连接池导致的。

解决方案2:
查看oracle的连接数,果然为150

SQL> show parameter processes;NAME                     TYPE    VALUE------------------------------------ ----------- ------------------------------aq_tm_processes              integer     0db_writer_processes          integer     2gcs_server_processes             integer     0global_txn_processes             integer     1job_queue_processes          integer     1000log_archive_max_processes        integer     4processes                integer     150SQL> SQL> SQL> 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

分析原因:

SQL> select count(1) from v$session t where t.status='INACTIVE' and t.username='PLAS';  COUNT(1)----------        88SQL> SQL> SQL> select count(1) from v$session t where t.status='INACTIVE' and t.username='PLAS';  COUNT(1)----------         5SQL> 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

修改配置文件:

[oracle@pldb236 ~]$ find /oracle -name *init.ora*/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/init.ora/oracle/app/oracle/product/11.2.0/dbhome_1/srvm/admin/init.ora/oracle/app/oracle/admin/powerdes/pfile/init.ora.7112015171232[oracle@pldb236 ~]$ 
  
  • 1
  • 2
  • 3
  • 4
  • 5

改动连接数,并且写入参数文件

alter system set processes=500 scope = spfile;SQL> alter system set processes=500 scope=spfile;System altered.SQL> create pfile from spfile;File created.SQL> 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

关闭重启oracle实例,启动就可以看到最大连接数已经变成了500,问题解决

SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@pldb236 ~]$ rlwrap sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 23 23:09:00 2015Copyright (c) 1982, 2009, Oracle.  All rights reserved.Connected to an idle instance.SQL> startup;ORACLE instance started.Total System Global Area 6680915968 bytesFixed Size          2213936 bytesVariable Size        4362078160 bytesDatabase Buffers     2281701376 bytesRedo Buffers           34922496 bytesDatabase mounted.Database opened.SQL> SQL> SQL> show parameter processes;NAME                     TYPE    VALUE------------------------------------ ----------- ------------------------------aq_tm_processes              integer     0db_writer_processes          integer     2gcs_server_processes             integer     0global_txn_processes             integer     1job_queue_processes          integer     1000log_archive_max_processes        integer     4processes                integer     500SQL> 
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow


http://www.niftyadmin.cn/n/3653813.html

相关文章

JSF1.2 in JavaEE5 

Chapter 1 JSF 1.2 overviewJSF ( Java Server Faces ) 在 JavaEE5 之中, 是採用 1.2 的版本. 目前的 RI 僅有 SUN 釋出的版本, 並且可以使用在 NetBeans 5.5 與 Glassfish 之中. 主要來說, 簡化了相關的開發方式, 以及 Scoped Managed Bean 可以利用 Annotation 的方式快速存取…

BPM introduction

以往, 大家對於流程控管, 似乎都是稱之為 Workflow, 然而, 專門控制流程的會稱之為 FlowEngine. 所以想要了解接下來我所引導介紹的章節, 大家可以先行閱讀 TSS 的這篇文章. BPEL and Java .在 Java Opensource 的流程控管系統中, 當中有幾個重要的 flow engine .jBPM ( http:/…

開始來玩 jBPM

如果沒有特別的需求,可以直接下載 JBoss jBPM Starters Kit. 裡面其實就包含了 JBoss Application Server 以及 JBoss jBPM. 因為 jBPM 是採用 Hibernate 存取資料庫, 所以裡面也有 Hibernate 等元件. 如果你已經要將 jBPM 部署在其他的 Application Server 之上, 僅…

zabbix3 0 2 使用percona mysql插件来监控mysql5 7的详细实现过程

--前言上次用了zabbix自带的mysql插件来监控mysql数据库,但是太过简陋了,对于我们dba来说,基本没有啥作用,所以需要做更详细的监控,而percona就有这个详细监控的模版以及脚本,正好拿过来用。1, …

Lesson1:透過 commons-configuration 存取設定檔

在我們撰寫一些系統的時候,往往需要設定一些基本的屬性,在使用 Java 進行 Web 開發之中,可以將相關設定放在 JNDI Server 再透過 context lookup 重量級的方式來取得相關的屬性。不過,有時候簡單的環境,不必耗時耗力去…

MySQL 用户权限详细汇总

1,MySQL权限体系mysql 的权限体系大致分为5个层级: 全局层级: 全局权限适用于一个给定服务器中的所有数据库。这些权限存储在mysql.user表中。GRANT ALL ON .和REVOKE ALL ON .只授予和撤销全局权限。 数据库层级: 数据库权限适用于一个给定数…

MySQL 5 7 10最新版本源代码安装详细过程

1,下载地址:安装包下载地址:http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10.tar.gz可以wget下载,也可以在pc本地网页上下载完再远程传到linux上面去。 安装文档地址:http://dev.mysql.com/doc/refman/5.7…

ERROR 1227 42000 Access denied you need at least one of

1 用以往的mysql登陆模式登陆[mysqleanintmydbc002db1 mysqllog]$ mysql Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3157186Server version: 5.5.25a-log MySQL EA ReleaseCopyright (c) 2000, 2011, Oracle an…