oracle數據庫忽然連不上了,一查是游標數量超了。

1.查看游標數
show parameter open_cursors
2.修改游標數
alter system set open_cursors = 10000;

3.獲取打開的游標數
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
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數據庫
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:- Oracle 遍歷游標的四種方式匯總(for、fetch、while、BULK COLLECT)
- 詳解Oracle游標的簡易用法
- Oracle游標的使用實例詳解
- Oracle中游標Cursor基本用法詳解
- 詳解Oracle隱式游標和顯式游標
- Oracle存儲過程游標用法分析
- Oracle出現超出打開游標最大數的解決方法
- Oracle顯示游標的使用及游標for循環
- Oracle存儲過程返回游標實例詳解
- Oracle 游標使用總結
- Oracle使用游標進行分批次更新數據的6種方式及速度比對