原文地址 :http://blog.csdn.net/zajin/article/details/17753351

做个备份:

查询数据库当前进程的连接数:

  select count(*) from v$process;

  查看数据库当前会话的连接数:

  elect count(*) from v$session;

  查看数据库的并发连接数:

  select count(*) from v$session where status='ACTIVE';

  查看当前数据库建立的会话情况:

  select sid,serial#,username,program,machine,status from v$session;

  查询数据库允许的最大连接数:

  select value from v$parameter where name = 'processes';

  或者:show parameter processes;

  修改数据库允许的最大连接数:

  alter system set processes = 300 scope = spfile;

  (需要重启数据库才能实现连接数的修改)

  重启数据库:

  shutdown immediate;

  startup;

  查看当前有哪些用户正在使用数据:

  select osuser,a.username,cpu_time/executions/1000000's' ,sql_fulltext,machine

  from v$session a,v$sqlarea b

  where a.sql_address = b.address

  order by cpu_time/executions desc;

  备注:UNIX 1个用户session对应一个操作系统process,而Windows体现在线程。

  启动oracle

  su - oracle

  sqlplus system/pwd as sysdba //进入sql

  startup //启动数据库

  lsnrctl start //启动监听

  sqlplus "/as sysdba"

  shutdown immediate;

  startup mount;

  alter database open;

--

web应用连接oracle数据库时,经常在查询数据时发生

Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: 127.0.0.1:1521:ORCL

这种错误,网上查了很多,都说是ip地址改变之后的问题,要把tnsnames.ora中的实例配置中改为计算机名,我试过之后问题还是不能解决,今天终于找到问题所在了,是数据库连接数量的问题,12519错误为监听不能提供服务,通常为数据库进程达到上限导致。

可以先执行下 select count(*) from v$process ,看下现在系统有多少连接数,然后再查询 select value from v$parameter where name = 'processes' ,看下oracle设置中设置了多少连接数,一般一个应用都会使用20个,所以如果你开了几个应用的话(web、pl/sql、……)就会出这个问题了,这时只需要执行下

alter system set processes = 300 scope = spfile;

就可以了,当然300可以根据实际情况设置。

 
 

Listener refused the connection with the following error 错误解决的更多相关文章

  1. Connection to Oracle failed. [66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor .

    我安装了Oracle数据库,默认的数据库用户名是system,密码口令是安装过程中你自己设置的.可以先使用命令框,输入 sqlplus system; 然后再输入密码即可. 然后我的数据库连接工具使用 ...

  2. Hive中导入Oracle数据错误:Listener refused the connection with the following error: ORA-12505

    问题: 今天往Hive中导入Oracle数据的时候碰到了如下错误:Listener refused the connection with the following error: ORA-12505 ...

  3. Oracle中Error while performing database login with the XXXdriver; Listener refused the connection with the following error; ORA-12505,TNS:listener does not currently know of SID given inconnect descrip

    一次连接数据库怎么也连接不上,查了多方面资料,终于找到答案,总结 首先应该保证数据库的服务启动 在myeclipse的数据库视图中点 右键->new 弹出database driver的窗口,  ...

  4. java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:list

    package DisplayAuthors; import  java.sql.*; public class DisplayAuthors  { private static final  Str ...

  5. 66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor oracle.n et.ns.NetException: Listener refuse

    新装的idea开发工具后连接数据库出现如题所示错误. 1.网上搜了不少的文章,没有解决我的问题.后来细心看了一下url: 一开始url是这样子的. jdbc:oracle:thin:@:s21_pdb ...

  6. 关于Oracle出现listener refused the connection with the ORA-12505错误,解决方案

    出现listener refused the connection with the ORA-12505错误,解决方案: 1.首先重启一下电脑,释放被占用的1521端口 2.重启后打开Oracle D ...

  7. mac 上运行cassandra出现的java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: : : unknown error错误解决方法

    mac 上运行cassandra出现的java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostExce ...

  8. 安裝jpeg-6b png error错误解决方法

    安裝jpeg-6b png error错误解决方法 默认安裝jpeg-6b shell> wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar. ...

  9. PHP failed to ptrace(PEEKDATA) pid 13659: Input/output error错误解决方法

    PHP failed to ptrace(PEEKDATA) pid 13659: Input/output error错误解决方法 现在改linux内核文件打开限制<pre>ulimit ...

随机推荐

  1. ubuntu下安装numpy和matplotlib

    安装NumPy函数库--sudo apt-get install python-numpy 以及  sudo apt-get install python-scipy NumPy函数库的函数查看:Nu ...

  2. Git入门

    转: http://www.cnblogs.com/luxiaojun/p/5944145.html

  3. Android 实现分页(使用TabWidget/TabHost)

    注:本文为转载,但该内容本人已亲身尝试,确认该方法可行,代码有点小的改动,转载用作保存与分享. 原作者地址:http://gundumw100.iteye.com/blog/853967 个人吐嘈:据 ...

  4. Hadoop里的数据挖掘应用-Mahout——学习笔记<三>

    之前有幸在MOOC学院抽中小象学院hadoop体验课. 这是小象学院hadoop2.X的笔记 由于平时对数据挖掘做的比较多,所以优先看Mahout方向视频. Mahout有很好的扩展性与容错性(基于H ...

  5. nyoj 448 寻找最大数(贪心专题)

    寻找最大数 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大, 比如当n=920813467185 ...

  6. CSS高效开发实战:CSS 3、LESS、SASS、Bootstrap、Foundation --读书笔记(2)CSS3利用图层叠加实现多背景

    CSS 3允许设置多个背景图片,每个背景图片占一层,层的上下按照在CSS中书写的顺序来定,最先写的背景在最上层,每层图片定义使用英文逗号隔开. 例如下面的代码: background:url(http ...

  7. 加载默认图片,如何避免img标签陷入onerror事件死循环

    当图片加载失败的时候,我们可以利用onerror事件赋予它默认图片,但是问题来了,假如默认图片又不存在呢,即加载失败,这个时候就会陷入死循环. 为了避免死循环的情况,我们可以在执行完onerror事件 ...

  8. URL处理几个关键的函数parse_url、parse_str与http_build_query

    parse_url() 该函数可以解析 URL,返回其组成部分.它的用法如下: array parse_url(string $url) 此函数返回一个关联数组,包含现有 URL 的各种组成部分.如果 ...

  9. C和指针 第十二章 使用结构和指针

    链表是一种常用的数据结构,每个节点通过链或者指针链接在一起,程序通过间接指针访问链表中的节点. typedef struct Node { //指向下一个节点的指针 struct Node *next ...

  10. MySQL SQL中的安全问题

    一.SQL注入是一个很常见的问题:利用的原理是SQL语句中的 "or"操作符或者"/*"和"#"注释符.前者利用逻辑运算,或者利用MySQL ...