日期:2014-05-16  浏览次数:20468 次

转:TNS-12519与processes参数设置;jdbc 连接oracle 报 ORA-12519

转:TNS-12519与processes参数设置;jdbc 连接oracle 报 ORA-12519, TNS:no appropriate service handler found 问题解决

这几天项目中进行大批量数据导入时,在运行一段时间后报如下异常:

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found

找了些网友的解决策略,贴上来,等自己遇到的解决后再做总结.

ORA-12519, TNS:no appropriate service handler found
url:http://windows9834.blog.163.com/blog/static/273450042009102511540240/

Oracle 2009-11-25 11:54:00

ORA-12519: TNS:no appropriate service handler found 的解决


有时候连得上数据库,有时候又连不上.

可能是数据库上当前的连接数目已经超过了它能够处理的最大值.

SQL> select count(*) from v$process;--当前连接数
???? COUNT(*)
???? 63
SQL> select value from v$parameter where name = 'processes' --数据库允许的最大连接数
VALUE
500

修改最大连接数:
SQL> alter system set processes = 300 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

今天下午,开发人员突然说不能连接数据库了,提示相关的错误

?

OERR: ORA-12519 TNS:no appropriate service handler found

客户端连接间歇性失败,报错ORA-12519


Cause: the listener could not find any available service handlers that are?
?????? appropriate for the client connection.

Action: run "lsnrctl services" to ensure that the instance(s) have registered?
??????? with the listener, and are accepting connections. 检查lsnrctl service ,instance已经注册,
状态显示ready时,可以连接。

When the listener believes