pga内存诊断进阶-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3502263
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2024-01-24 00:01:59


  1. 1447481.1

  2. vmstat 2 5 -sm

  3. col name for a40
  4. select name,round(value/1024/1024) mb from v$pgastat where name like '%pga%';
  5. 比较pga参数与total pga allocated差异,观察maxium pga used for auto wrokareas

  6. select snap_id,round(value/1024/1024) pga_alloc_mb from dba_hist_pgastat where name='total pga allocated' and instance_number=1 order by 1;
  7. 确认是否缓慢增长

  8. select a.sid,b.spid,b.pname,a.status,a.sql_id,a.last_call_et,round(b.pga_alloc_mem/1024/1024) pga_alloc_mb, a.event,a.state from v$session a ,v$process b where a.paddr=b.addr and b.pga_alloc_mem/1024/1024>100 order by pga_alloc_mb desc;
  9. 等待事件空闲的会话是否使用pga不释放

  10. oradebug setospid &pid
  11. oradebug dump heapdump 536870917
  12. oradebug tracefile_name
  13. 转储对应进程的heapdump

  14. egrep "heap dump heap|total heap size|permanet space" xxx.trc
  15. 查看内存占用{banned}最佳大的

  16. v$process_memory

  17. column category heading "category"
  18. column allocated heading "allocated bytes"
  19. column used heading "used bytes"
  20. column max_allocated heading "max allocated bytes"
  21. select pid, category, allocated, used, max_allocated
  22. from v$process_memory
  23. where pid = (select pid
  24.               from v$process
  25.               where addr= (select paddr
  26.                             from v$session
  27.                             where sid = &sid));
  28.             
  29.  v$process_memory_detail
  30. select low_optimal_size/1024 low_kb,
  31.        (high_optimal_size1)/1024 high_kb,
  32.        optimal_executions, onepass_executions, multipasses_executions
  33.   from v$sql_workarea_histogram
  34.  where total_executions != 0;

  35. select optimal_count, round(optimal_count*100/total, 2) optimal_perc,
  36.        onepass_count, round(onepass_count*100/total, 2) onepass_perc,
  37.        multipass_count, round(multipass_count*100/total, 2) multipass_perc
  38. from
  39.  (select decode(sum(total_executions), 0, 1, sum(total_executions)) total,
  40.          sum(optimal_executions) optimal_count,
  41.          sum(onepass_executions) onepass_count,
  42.          sum(multipasses_executions) multipass_count
  43.     from v$sql_workarea_histogram
  44.    where low_optimal_size >= 64*1024);
  45.    
  46. select to_number(decode(sid, 65535, null, sid)) sid,
  47.        operation_type operation,
  48.        trunc(expected_size/1024) esize,
  49.        trunc(actual_mem_used/1024) mem,
  50.        trunc(max_mem_used/1024) "max mem",
  51.        number_passes pass,
  52.        trunc(tempseg_size/1024) tsize
  53.   from v$sql_workarea_active
  54.  order by 1,2;

  55. col workarea_address for a20
  56. col operation_type for a20
  57. col policy for a15
  58. select *
  59. from (select workarea_address, operation_type, policy, estimated_optimal_size
  60.         from v$sql_workarea
  61.         order by estimated_optimal_size desc)
  62.  where rownum <= 10;

  63. col sql_text format a80 wrap
  64. select sql_text, sum(onepass_executions) onepass_cnt,
  65.        sum(multipasses_executions) mpass_cnt
  66. from v$sql s, v$sql_workarea wa
  67. where s.address = wa.address
  68. group by sql_text
  69. having sum(onepass_executionsmultipasses_executions)>0;

  70. col "o/1/m" format a10
  71. col name format a20
  72. select operation, options, object_name name, trunc(bytes/1024/1024) "input(mb)",
  73.        trunc(last_memory_used/1024) last_mem,
  74.        trunc(estimated_optimal_size/1024) optimal_mem,
  75.        trunc(estimated_onepass_size/1024) onepass_mem,
  76.        decode(optimal_executions, null, null,
  77.               optimal_executions||'/'||onepass_executions||'/'||
  78.               multipasses_executions) "o/1/m"
  79.   from v$sql_plan p, v$sql_workarea w
  80.  where p.address=w.address()
  81.    and p.hash_value=w.hash_value()
  82.    and p.id=w.operation_id()
  83.    and p.address='&addr'
  84.    and p.hash_value=&hashvalue;

  85. select round(pga_target_for_estimate/1024/1024) target_mb,
  86.        estd_pga_cache_hit_percentage cache_hit_perc,
  87.        estd_overalloc_count
  88.   from v$pga_target_advice;

  89. select name profile, cnt, decode(total, 0, 0, round(cnt*100/total)) percentage
  90.   from (select name, value cnt, (sum(value) over ()) total
  91.   from v$sysstat
  92.  where name
  93.   like 'workarea exec%');


  94.             
  95. 822527.1
  96. 看前10 pga高的
  97. column alme heading "allocated mb" format 99999d9
  98. column usme heading "used mb" format 99999d9
  99. column frme heading "freeable mb" format 99999d9
  100. column mame heading "max mb" format 99999d9
  101. column username format a15
  102. column program format a22
  103. column sid format a5
  104. column spid format a8
  105. set linesize 300
  106. select * from (
  107. select s.username, substr(s.sid,1,5) sid, p.spid, logon_time,
  108.        substr(s.program,1,22) program , s.process pid_remote,
  109.        s.status,
  110.        round(pga_used_mem/1024/1024) usme,
  111.        round(pga_alloc_mem/1024/1024) alme,
  112.        round(pga_freeable_mem/1024/1024) frme,
  113.        round(pga_max_mem/1024/1024) mame
  114. from v$session s,v$process p
  115. where p.addr=s.paddr
  116. order by pga_max_mem,logon_time)
  117. where rownum<11;

  118. 对某个进行检查
  119. column category heading "category"
  120. column allocated heading "allocated bytes"
  121. column used heading "used bytes"
  122. column max_allocated heading "max allocated bytes"
  123. select pid, category, allocated, used, max_allocated
  124. from v$process_memory
  125. where pid = (select pid
  126.               from v$process
  127.               where addr= (select paddr
  128.                             from v$session
  129.                             where sid = &sid));
  130. 详细分析
  131. alter session set events'immediate trace name pga_detail_get level &pid';

  132. oradebug setmypid;
  133. oradebug dump pga_detail_get &pid;

  134. 查看结果
  135. select category, name, heap_name, bytes, allocation_count,
  136.        heap_descriptor, parent_heap_descriptor
  137. from v$process_memory_detail
  138. where pid = 10
  139. and category = 'other';

阅读(14) | 评论(0) | 转发(0) |
0

上一篇:linux命令进阶

下一篇:打好基础--创建目录

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图