如何获得oracle11g数据库中进程的RAM使用情况?



我想测量一个sql语句(例如一个简单的创建或插入语句)在oracle 11g数据库环境中的内存使用情况。

我试图通过使用dbms_space来获取它,但似乎只获得磁盘空间。

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

但是语句

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

不返回create语句

见上面的注释:

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%' )

最新更新