Shared SQL Areas (88)

tsinglee發表於2007-10-24

A shared SQL area contains the parse tree and execution plan for a
given SQL statement. Oracle saves memory by using one shared SQL area for SQL
statements run multiple times, which often happens when many users run the same
application.
Oracle allocates memory from the shared pool when a new SQL statement is parsed, to
store in the shared SQL area. The size of this memory depends on the complexity of
the statement. If the entire shared pool has already been allocated, Oracle can
deallocate items from the pool using a modified LRU (least recently used) algorithm
until there is enough free space for the new statement’s shared SQL area. If Oracle
deallocates a shared SQL area, the associated SQL statement must be reparsed and
reassigned to another shared SQL area at its next execution.

共享SQL區域
1. 包括一個SQL語句的解析樹, 執行計劃.
2. Oracle為共享記憶體區域分配記憶體是在一個新的SQL語句被解析時並被儲存在該區域時.分配的記憶體大小視SQL語
句的複雜性來定
3. 如果該區域全被分配, Oracle使用LRU演算法來回收各條款直到有足夠的空閒空間for新的SQL.
4. 如果回收了一個共享記憶體區域, 則相應的SQL在下次執行時會誒重新解析並被指定到另一塊共享SQL區域

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-978365/,如需轉載,請註明出處,否則將追究法律責任。

相關文章