java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:lis
2014-06-16 15:05
661 查看
原因:连接数过多,多实例需要切换实例来加大连接数,整合了一下。
sql>show user;查看当前用户
sql>show parameter instance_name;查看当前数据库实例
sql>set ORACLE_SID=实例名 --切换实例(linux为export)
SQL> select count(*) from v$process;--当前连接数
SQL> select value from v$parameter where name = 'processes' --数据库允许的最大连接数
修改最大连接数:
SQL> alter system set processes = 2000 scope = spfile;
重启数据库:
SQL> shutdown immediate;
SQL> 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;
--快速删除不活动进程
set heading off
spool on
select p.SPID from v$session s,v$process p where s.paddr= p.addr and s.machine='woogle';
spool off
set serveroutput on ;
declare
v_sid number;
v_serial number;
v_sql varchar2(200) ;
CURSOR cur_session is
select sid, serial# from v$session where machine='woogle';
begin
open cur_session ;
fetch cur_session into v_sid , v_serial ;
while cur_session%found
loop
dbms_output.put_line(v_sid||' killed!') ;
v_sql:= 'alter system kill session '||''''||v_sid||','||v_serial||'''';
execute immediate v_sql ;
fetch cur_session into v_sid , v_serial ;
end loop ;
close cur_session ;
end ;
/
Linux 下快速删除不活动进程
#!/bin/bash
tmpfile=/tmp/tmp.$$
sqlplus ' / as sysdba' << EOF
set heading off
spool on
spool $tmpfile
select p.SPID from v$session s,v$process p where s.paddr= p.addr and s.STATUS='SNIPED';
spool off
set serveroutput on ;
declare
v_sid number;
v_serial number;
v_sql varchar2(200) ;
CURSOR cur_session is
select sid, serial# from v$session where STATUS='SNIPED';
begin
open cur_session ;
fetch cur_session into v_sid , v_serial ;
while cur_session%found
loop
dbms_output.put_line(v_sid||' killed!') ;
v_sql:= 'alter system kill session '||''''||v_sid||','||v_serial||'''';
execute immediate v_sql ;
fetch cur_session into v_sid , v_serial ;
end loop ;
close cur_session ;
end ;
/
OERR: ORA-12519 TNS:no appropriate service handler found
url:http://blog.csdn.net/wyzxg/archive/2008/03/06/2154274.aspx
2008/03/06
skate
sql>show user;查看当前用户
sql>show parameter instance_name;查看当前数据库实例
sql>set ORACLE_SID=实例名 --切换实例(linux为export)
SQL> select count(*) from v$process;--当前连接数
SQL> select value from v$parameter where name = 'processes' --数据库允许的最大连接数
修改最大连接数:
SQL> alter system set processes = 2000 scope = spfile;
重启数据库:
SQL> shutdown immediate;
SQL> 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;
--快速删除不活动进程
set heading off
spool on
select p.SPID from v$session s,v$process p where s.paddr= p.addr and s.machine='woogle';
spool off
set serveroutput on ;
declare
v_sid number;
v_serial number;
v_sql varchar2(200) ;
CURSOR cur_session is
select sid, serial# from v$session where machine='woogle';
begin
open cur_session ;
fetch cur_session into v_sid , v_serial ;
while cur_session%found
loop
dbms_output.put_line(v_sid||' killed!') ;
v_sql:= 'alter system kill session '||''''||v_sid||','||v_serial||'''';
execute immediate v_sql ;
fetch cur_session into v_sid , v_serial ;
end loop ;
close cur_session ;
end ;
/
Linux 下快速删除不活动进程
#!/bin/bash
tmpfile=/tmp/tmp.$$
sqlplus ' / as sysdba' << EOF
set heading off
spool on
spool $tmpfile
select p.SPID from v$session s,v$process p where s.paddr= p.addr and s.STATUS='SNIPED';
spool off
set serveroutput on ;
declare
v_sid number;
v_serial number;
v_sql varchar2(200) ;
CURSOR cur_session is
select sid, serial# from v$session where STATUS='SNIPED';
begin
open cur_session ;
fetch cur_session into v_sid , v_serial ;
while cur_session%found
loop
dbms_output.put_line(v_sid||' killed!') ;
v_sql:= 'alter system kill session '||''''||v_sid||','||v_serial||'''';
execute immediate v_sql ;
fetch cur_session into v_sid , v_serial ;
end loop ;
close cur_session ;
end ;
/
OERR: ORA-12519 TNS:no appropriate service handler found
url:http://blog.csdn.net/wyzxg/archive/2008/03/06/2154274.aspx
2008/03/06
skate
相关文章推荐
- java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:list
- java.sql.SQLException: Listener refused the connection with the following error:ORA-12505
- 数据库报ORA-12519;java.sql.SQLException: Listener refused the connection with the following error解决办法
- 状态: 失败 -测试失败: Listener refused the connection with the following error: ORA-12505, TNS:listener does
- Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently
- Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently
- java.sql.SQLException: Listener refused the connection with the following error:
- 状态: 失败 -测试失败: Listener refused the connection with the following error: ORA-12505, TNS:listener does
- Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently
- java.sql.SQLException: Listener refused the connection with the following error
- 今天写一个JSP+Oracle的项目,遇到了 Listener refused the connection with the following error:ORA-12519:
- listener refused the connection with the ORA-12505错误解决方案--Oracle侦听服务解决终级办法
- Listener refused the connection with the following error 错误解
- Listener refused the connection with the following error 错误解决(最大连接数)
- Listener refused the connection with the following error 错误解决
- 连接Oracle数据库时遇到:Listener refused the connection with the following error。。。。
- Listener refused the connection with the following error 错误解决
- ORA-12514错误:Listener refused the connection with the following&
- Listener refused the connection with the following error 错误解决
- Listener refused the connection with the following error 错误解决