V$OPEN_CUSOR |
---|
v$open_cursor - это не открытые, а закешированные курсоры.
|
SQL> var x0 refcursor
SQL> var x1 refcursor
SQL> var x2 refcursor
SQL> var x3 refcursor
SQL> var x4 refcursor
SQL> var x5 refcursor
SQL> var x6 refcursor
SQL> var x7 refcursor
SQL> var x8 refcursor
SQL> var x9 refcursor
SQL> begin
2 open :x0 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x1 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x2 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x3 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x4 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x5 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x6 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x7 for 'select * from dual';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> begin
2 open :x8 for 'select * from dual';
3 end;
4 /
begin
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-01000: maximum open cursors exceeded
ORA-06512: at line 2
SQL> exec close :x0
PL/SQL procedure successfully completed.
SQL> select count(*) from v$open_cursor
2 where sid = SYS_CONTEXT('USERENV', 'SID')
3 /
COUNT(*)
----------
12
SQL> select count(*),cursor_type from v$open_cursor
2 where sid = SYS_CONTEXT('USERENV', 'SID')
3 group by cursor_type;
COUNT(*) CURSOR_TYPE
---------- ----------------------------------------------------------------
1 SESSION CURSOR CACHED
8 OPEN
1 OPEN-RECURSIVE
2 DICTIONARY LOOKUP CURSOR CACHED