了解Maclean Liu|向Maclean Liu提问 Oracle ALLSTARS 全明星(群内有多位Oracle高级售后support,N位OCM和ACE) QQ群 # QQ群号:23549328 # 已经升级到 2000人群,空位多多。欢迎有一定基础的Oracle骨友加入,现在入群需要经过Maclean的技术面试,欢迎面试,请加QQ号:47079569 为好友参加面试 2群基础群 适合刚入门的同学,会共享最佳入门实践和资料 QQ群 # QQ群号:171092051 # 已经升级到 500人的超级群,空位多多,无需面试

Script:计算Oracle Streams进程所占用的内存大小

以下脚本可以用于收集Oracle Streams进程的内存使用信息, 便于诊断因memory leak引起的内存问题:  
ps auxgw | sort  -n +5 | tail -10

select a.apply_name,
       a.server_id,
       b.sid,
       b.program,
       c.spid,
       trunc(c.pga_used_mem / (1024 * 1024), 2) PGA_USED,
       trunc(c.pga_alloc_mem / (1024 * 1024), 2) PGA_ALLOC,
       trunc(c.pga_freeable_mem / (1024 * 1024), 2) PGA_FREE,
       trunc(c.pga_max_mem / (1024 * 1024), 2) PGA_MAX
  from v$streams_apply_server a, v$process c, v$session b
 where a.sid = b.sid
   and b.paddr = c.addr
 order by 1, 2;

SELECT p.spid spid,
       'C00' || c.capture# || ' ' || upper(lp.role) as process,
       c.capture_name "Capture Name",
       s.sid,
       s.program,
       trunc(p.pga_used_mem / (1024 * 1024), 2) PGA_USED,
       trunc(p.pga_alloc_mem / (1024 * 1024), 2) PGA_ALLOC,
       trunc(p.pga_freeable_mem / (1024 * 1024), 2) PGA_FREE,
       trunc(p.pga_max_mem / (1024 * 1024), 2) PGA_MAX
  FROM v$streams_capture c, v$logmnr_process lp, v$session s, v$process p
 WHERE c.logminer_id = lp.session_id
   AND lp.role in ('reader', 'preparer', 'builder')
   AND lp.sid = s.sid
   AND lp.serial# = s.serial#
   AND s.paddr = p.addr
 order by capture_name, process;

sqlplus / as sysdba
oradebug setospid $PID
oradebug unlimit
oradebug dump heapdump 536870917
oradebug tracefile_name

posted on 2013-03-19 00:48  Oracle和MySQL  阅读(174)  评论(0编辑  收藏  举报

导航