17,086
社区成员
发帖
与我相关
我的任务
分享
tony@ORCL1> select current_size from v$sga_dynamic_components where component='shared pool';
CURRENT_SIZE
------------
125829120
tony@ORCL1> select bytes from v$sgainfo where name='Shared Pool Size';
BYTES
----------
125829120
with param as (select 1 as id, value as val from v$parameter where name = 'shared_pool_size'),
sgainfo as (select 1 as id, bytes as val from v$sgainfo where name = 'Shared Pool Size'),
sgastat as (select 1 as id, bytes as val from v$sgastat where pool = 'shared pool' and name = 'free memory')
select round(100 * (1 - (sgastat.val / (case param.val when '0' then sgainfo.val else (0+param.val) end))), 2) MemoryUsage
from param, sgainfo, sgastat where param.id=sgainfo.id and param.id=sgastat.id;