Site icon DBA의 정석

ORACLE CONTEXT SIZE & CURSORS

CONTEXT SIZE & CURSORS

   1.
Context size
에 관련한 error message

     
.ora-1046 :can’t acquire space to extend context area.

     
.ora-1050 :can’t acquire space to open context area.

     
.ora-1051 :maximum context area extents exceeded.

 

   2.
Context size
란 무엇인가?

      (1)
Cursor
의 initial size이다 . 즉, Cursor 에
allocate
되는 user memory이다.

      (2) 이는 init.ora 의 CONTEXT_SIZE 에 의해 결정된다.

      (3)
Cursor
에 할당되는 additional space 는
CONTEXT_INCR
에 의하며 50 extents를 갖는다.

      (4)
Recommended context size increment
는 4096 bytes(4K)이다.

      (5)
SQL statement
가 수행
시마다 cursor 가 open 되며, 같은 cursor가 reuse 되도록 design 되어 SQL*PLUS session은 2-3 개
이상 open 되어지지
않는다.

          그러나 SQL*FORMS 는 여러 다른 task를 수행하므로
많은 cursor를 open한다.  (100 or more)

     
(6)Cursor
가 hold 하는 item

         *
the SQL statement

         *
the parsed SQL statement

         *
one row of the result

 

   3.
ORA-1051
은 무엇이
문제인가?

      (1)
cursor
의 size를 줄인다.

      (2)
CONTEXT_SIZE, CONTEXT_INCR
를 늘린다.

 

   4.  OPEN_CURSORS 수를
줄이는 전략

      (1)
Commit
을 자주한다.

      (2)
Synonym
이나 view를 사용하지 않음으로써 implicit cursor 수를 줄인다.

      (3) SQL*FORMS
에서 select 문대신 #COPY로
바꿔 사용한다.

      (4) SQL*FORMS
에서 large forms를 여러 개의
작은 forms로
나눈다.

      (5) ASAP,
EXEC  SQL CLOSE C1;
을 수행한다.

      (6) HOLD_CURSOR=NO  & RELEASE_CURSOR=YES를 사용한다.

Exit mobile version