天高地厚

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

sql---oracle----sharePool

Posted on 2013-01-24 13:34  天高地厚-GNU  阅读(180)  评论(0编辑  收藏  举报

发出一个sql语句或sql命令,让数据库执行,那么sql语句在数据库内部就要被解析,建立它的execution plan(执行规划(计划)),然后按照执行计划去执行。
每一个sql语句都要被解析,解析成原子操作去执行。解析好的sql语句都会存在共享池里面。
Shared Pool used to store:
--Most recently executed SQL statements
--Most recently used data definitions
It consists of two key performance-related memory structures:
--Library Cache
--Data Dictionary Cache
======================
How to resize the shared pool:
alter system set shared_pool_size = 64M;

======================
Library Cache:
It stores information about the most recently used SQL and PL/SQL statements
(存储的是经过编译解析后的SQL语句和PL/SQL语句)
Enables the sharing of commonly used statements.
Is managed by a Last Recently Used(LRU) algorithm.
Consists of two structures:
--Shared SQL area
--Shared PL/SQL area
Size determined by the Shared Pool Sizing
====================
(如果现在执行的sql语句已经在LibraryCache中了,就不需要再解析,就可以提高执行速度)