Wednesday, January 19, 2011

Queries to get info about SGA

  •  Find the size of SGA and its components:
    • select name, value/(1024*1024*1024) as sizeGB from v$sga;
    • select sum(value)/(1024*1024*1024) as totalGB from v$sga;
  • Detailed look into SGA:
    • select name, bytes/(1024*1024*1024)) as sizeGB ,resizeable from v$sgainfo;
  • Find the size and contents of buffer pool:
    • select sum(current_size)/1024  as sizeGB from v$buffer_pool;
    • select name, block_size, current_size/1024 as sizeGB  from v$buffer_pool ;
  • Find  the size and contents of variable SGA size
    • the sum of following two queries should add up to variable sga as reported by show sga:
    • select name, bytes/(1024*1024*1024) as sizeGB from v$sgainfo where name='Free SGA Memory Available';
    •  select sum(bytes)/(1024*1024*1024) as sizeGB from v$sgastat where pool in ('shared pool' , 'java pool' ,'large pool') ;
  • The amount of SGA memory available for future dynamic SGA operations can be found by either one of the following query:
    • select current_size/(1024*1024*1024)  as freeGB from v$sga_dynamic_free_memory;
    • select name, bytes/(1024*1024*1024) as sizeGB from v$sgainfo where name='Free SGA Memory Available';
  • Query to find out the current, min and max size of each dynamic component in SGA. This query also returns the number of type an grow or shrink operation was performed on each component.
    • column component format a25
    • select component, current_size/(1024*1024) as currentsizeMB, min_size/(1024*1024) as minMB,max_size/(1024*1024) as maxMB,user_specified_size/(1024*1024) as userspecifiedMB  ,oper_count from  v$sga_dynamic_components;

No comments:

Post a Comment