【问题标题】:How can you get the RAM usage of processes in an oracle11g database?如何获取 oracle11g 数据库中进程的 RAM 使用情况?
【发布时间】:2011-08-30 13:26:08
【问题描述】:

我想在 oracle 11g 数据库环境中测量 sql 语句(例如简单的 create 或 insert 语句)的 RAM 使用情况。

我尝试使用dbms_space来获取它,但似乎只获取磁盘空间。

我还发现了这个网站: http://www.dba-oracle.com/m_memory_usage_percent.htm

但是声明

select
*
from
v$sql
where sql_text like {my table}

不要返回创建语句。

【问题讨论】:

标签: oracle memory-management ram


【解决方案1】:

见上面的评论:

select operation, 
       options, 
       object_name name,
       trunc(bytes/1024/1024) "input(MB)",
       trunc(last_memory_used/1024) last_mem,
       trunc(estimated_optimal_size/1024) opt_mem, 
       trunc(estimated_onepass_size/1024) onepass_mem, 
       decode(optimal_executions, null, null, 
             optimal_executions||'/'||onepass_executions||'/'||
             multipasses_executions) "O/1/M"
  from v$sql_plan p
     , v$sql_workarea w
 where p.address=w.address(+)
   and p.hash_value=w.hash_value(+) 
   and p.id=w.operation_id(+) 
   and p.address= ( select address
                      from v$sql
                     where sql_text like '%my_table%' )

【讨论】:

  • 不起作用:ORA-01427,子查询返回多行。此外,我正在寻找的创建和插入语句不在 v$sql 中。
  • 哦,还有一个错字 multipasses_executions --> multipasses_executions
  • @Hauke,谢谢;错字已修复。返回多于一行的子查询意味着 v$sql 有多个列表,其中包含您的表名。你必须更具体。
猜你喜欢
  • 2015-12-03
  • 1970-01-01
  • 1970-01-01
  • 2011-04-27
  • 1970-01-01
  • 1970-01-01
  • 2011-05-13
  • 1970-01-01
  • 2017-11-11
相关资源
最近更新 更多