select * from gv$sysstat where name like '%open%'select sum(a.value) total_cur, avg(a.value) avg_cur, max(a.value) max_cur, s.username, s.machinefrom gv$sesstat a, gv$statname b, gv$session s where a.statistic# = b.statistic# and s.sid=a.sidand b.name = 'opened cursors current' group by s.username, s.machineorder by 1 desc;
Update open_cursors
show parameter open_cursors;alter system set open_cursors=1000 scope=MEMORY; (如果启动时候定义了spfile,可以写scope=BOTH)Kill session to let the parameter take effect
select substr(a.spid,1,9) pid, substr(b.sid,1,5) sid, substr(b.serial#,1,5) ser#, substr(b.machine,1,6) box, substr(b.username,1,10) username, -- b.server, substr(b.osuser,1,8) os_user, substr(b.program,1,30) program from gv$session b, gv$process a where b.paddr = a.addr and type='USER' order by program, sid;alter system kill session 'SID,SERIAL#'e.g. alter system kill session '12,2653'
参考