oracle 数据库 忽然连不上了,一查是 游标 数量超了。
1.查看游标数
show parameter open_cursors
2.修改游标数
alter system set open_cursors = 10000;
3.获取打开的游标数
1 2 3 4 5 6 7 |
select o.sid, osuser, machine, count (*) num_curs from v$open_cursor o, v$session s where user_name = 'AF651_U8' and o.sid = s.sid group by o.sid, osuser, machine order by num_curs desc ; SID OSUSER MACHINE NUM_CURS |
4.查询某游标执行的sql
1 2 3 4 |
select q.sql_text from v$open_cursor o, v$sql q where q.hash_value = o.hash_value and o.sid = 396; |
5.解决问题的办法:
--1.查找代码不合理的地方,修改代码。
--2.重启oracle数据库
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://www.cnblogs.com/helq/p/13260426.html
查看更多关于Oracle数据库游标连接超出解决方案的详细内容...