/**PageBeginHtml Block Begin **/ /***自定义返回顶部小火箭***/ /*生成博客目录的JS 开始*/ /*生成博客目录的JS 结束*/

Oracle 系统调优

* 博客文章部分截图及内容来自于学习的书本及相应培训课程以及网络其他博客,仅做学习讨论之用,不做商业用途。
* 如有侵权,马上联系我,我立马删除对应链接。
* @author Alan
* @Email no008@foxmail.com

 

正文


一:前言

image


一:调整初始化参数

image


1: Oracle 初始化参数分类

image

2:主要系统调优参数介绍

image

imageimageimage

image

image



二:系统全局区 sga 优化

image




1:调整内存分配

image


2:调整日志缓冲区

imageimage

image

        1:查询当前oracle 实例的日志缓冲区的大小

复制代码
  1 
  2 SYS@orcl> select distinct lebsz as log_cache_size  from x$kccle;
  3 
  4 LOG_CACHE_SIZE
  5 --------------
  6            512
  7              0
  8 
  9 SYS@orcl>
复制代码

image

imageimage

image

3:调整共享池

image

image

image

  1 
  2 SYS@orcl> select sum(pins) as sum_pins/*请求存取数*/,sum(reloads) as sum_reloads /*不命中数*/ from v$librarycache;
  3 
  4   SUM_PINS SUM_RELOADS
  5 ---------- -----------
  6   11151706       52931
  7 
  8 SYS@orcl>


image

image

  1 
  2 SYS@orcl> select sum(pins) as sum_pins/*请求存取数*/,sum(reloads) as sum_reloads /*不命中数*/ from v$librarycache;
  3 
  4   SUM_PINS SUM_RELOADS
  5 ---------- -----------
  6   11151706       52931
  7 
  8 SYS@orcl>
  1 SYS@orcl> select sum(gets) as sum_pins /*请求存取数*/,sum(getmisses) as sum_reloads/*不命中数*/ from v$rowcache;
  2 
  3   SUM_PINS SUM_RELOADS
  4 ---------- -----------
  5   14853534      220272
  6 
  7 SYS@orcl>
  8 


image

image

  1 SYS@orcl> select sum(value)||'字节' as value_byte /*当前分配给所有会话的内存数*/  from v$sesstat a ,v$statname b where name='session uga memory' and a.statistic#=b.statistic#;
  2 VALUE_BYTE
  3 --------------------------------------------
  4 8376368字节
  5 
  6 SYS@orcl>


image

image

  1 SYS@orcl> select sum(value)||'字节' as value_type /*曾经分配给所有会话的最大内存数*/ from v$sesstat a,v$statname b where name='session uga memory max' and a.statistic#=b.statistic#;
  2 
  3 VALUE_TYPE
  4 --------------------------------------------
  5 25527396字节
  6 
  7 SYS@orcl>

image

imageimage



4:调整数据库缓冲区

image

         示例:查询一段时间内 v$sysstat表中的统计信息

复制代码
  1 SYS@orcl> select name ,value from v$sysstat where name in ('db block gets','consistent gets','physical reads');
  2 
  3 NAME                                                                  VALUE
  4 ---------------------------------------------------------------- ----------
  5 db block gets                                                          2445
  6 consistent gets                                                      145199
  7 physical reads                                                         8414
  8 
  9 SYS@orcl>
复制代码

image



5:SGA调优建议

image





三:排序区优化

imageimage

复制代码
  1 SYS@orcl> show parameter sort_area_size;
  2 
  3 NAME                                 TYPE        VALUE
  4 ------------------------------------ ----------- ------------------------------
  5 sort_area_size                       integer     65536
  6 
  7 SYS@orcl> show parameter sort_area_
  8 
  9 NAME                                 TYPE        VALUE
 10 ------------------------------------ ----------- ------------------------------
 11 sort_area_retained_size              integer     0
 12 sort_area_size                       integer     65536
 13 SYS@orcl>
复制代码

1:排序区与其他内存区的关系

image


复制代码
  1 
  2 SYS@orcl> show parameter large_pool_size;
  3 
  4 NAME                                 TYPE        VALUE
  5 ------------------------------------ ----------- ------------------------------
  6 large_pool_size                      big integer 0
  7 SYS@orcl> alter system set large_pool_size=32M;
  8 
  9 System altered.
 10 
 11 SYS@orcl> show parameter large_pool_size ;
 12 
 13 NAME                                 TYPE        VALUE
 14 ------------------------------------ ----------- ------------------------------
 15 large_pool_size                      big integer 32M
 16 SYS@orcl>
复制代码

image


2:排序活动

image

image


3:专用模式下排序区的调整

image


image


        1:sort_area_size

image

        2:sort_area_retained_size

image

                       示例:查看所有服务器进程使用的内存的总量

  1 SYS@orcl> show parameter pga_aggregate_target;
  2 
  3 NAME                                 TYPE        VALUE
  4 ------------------------------------ ----------- ------------------------------
  5 pga_aggregate_target                 big integer 0
  6 SYS@orcl>

                       示例:查看 PGA使用的管理方式

  1 SYS@orcl> show parameter workarea_size_policy;
  2 
  3 NAME                                 TYPE        VALUE
  4 ------------------------------------ ----------- ------------------------------
  5 workarea_size_policy                 string      AUTO
  6 SYS@orcl>


image

                       示例:查看会话信息及堆栈空间的大小

  1 SYS@orcl> show parameter sort_area_size;
  2 
  3 NAME                                 TYPE        VALUE
  4 ------------------------------------ ----------- ------------------------------
  5 sort_area_size                       integer     65536
  6 SYS@orcl>

image


4:共享模式下排序区的调整

image

image

image

image




























————————————————————————————————————————————————————————————————

posted @   一品堂.技术学习笔记  阅读(560)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示

目录导航