您的位置:首页 > 博客中心 > 数据库 >

Oracle学习之shared pool--硬解析和软解析

时间:2022-03-14 17:20

1.shared pool(共享池)的组成

  3块区域:free cache、library cache、row cache

  free cache:空闲空间

  library cache:主要缓存SQL语句以及SQL语句对应的执行计划

  row cache:数据字典缓存

  select * from v$sgastat a where a.NAME = ‘library cache‘;

  select * from v$sgastat a where a.pool = ‘shared pool‘ and a.NAME=‘free memory‘;

  select * from v$sgastat a where a.NAME = ‘row cache‘;

  简述数据字典

2.硬解析、软解析

  硬解析步骤、软解析步骤

  硬解析:sql语句在library cache中无SQL语句以及对应的执行计划,进入硬解析。

  解析步骤:判断语法-》判断对象是否存在-》检查是否有权限-》生成执行计划(挑出最有的执行方案生成执行计划,此步骤最消耗资源)

  软解析:有缓存

  解析步骤:判断语法-》判断对象是否存在-》判断权限

硬解析和软解析都要频繁的访问数据字典,所以数据字典放在shared pool中。

软硬解析的具体情况

select name,value from v$sysstat where name like ‘parse%‘;

 

本类排行

今日推荐

热门手游