原文地址 :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. 个人学习记录1:二维数组保存到cookie后再读取

    二维数组保存到cookie后再读取 var heartsArray = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0, ...

  2. js 闭包 理解

    1.什么是闭包 定义:是指有权访问另一个函数作用域中的变量的函数 创建闭包:在一个函数内部创建另一个函数 基本特点 在返回的匿名函数中 可以调用外部函数的变量 如下例中所示 内部函数(匿名函数) 可以 ...

  3. js自动闭合html标签,自动补全html标记

    假如我有一个DIV,如果没有闭合后面的样式都会乱了,这样的代码可能会影响后面的样式,我希望用js去自动闭合这种没有闭合的标签: 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 ...

  4. 大熊君学习html5系列之------requestAnimationFrame(实现动画的另一种方案)

    一,开篇分析 Hi,大家好!大熊君又和大家见面了,(*^__^*) 嘻嘻……,这系列文章主要是学习Html5相关的知识点,以学习API知识点为入口,由浅入深的引入实例, 让大家一步一步的体会" ...

  5. ORACLE 触发器

    •1.1 触发器类型 • DML触发器 • 替代触发器 • 系统触发器 •1.2 创建触发器 • 触发器触发次序 • 创建DML触发器 • 创建替代(INSTEAD OF)触发器 • 创建系统事件触发 ...

  6. Codeforces Round #262 (Div. 2) 1003

    Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 2 ...

  7. XML格式示例 与 XML操作(读取)类封装

    header('Content-Type: text/xml'); <?xml version="1.0" encoding="utf-8" standa ...

  8. 第3月第9天 循环引用 block

    一.一个对象没有被引用,那么在函数块完成时就会被dealloc,这种情况因为对象销毁了,block块也永远不会执行. MyNetworkOperation *op = [[MyNetworkOpera ...

  9. 【Alpha版本】冲刺阶段——Day 1

    我说的都队 031402304 陈燊 031402342 许玲玲 031402337 胡心颖 03140241 王婷婷 031402203 陈齐民 031402209 黄伟炜 031402233 郑扬 ...

  10. 一条代码解决各种IE浏览器兼容性问题

    在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案百度也应用了这种方案去解决IE的兼容问题 百度源代码如下 <!Doctype html> ...