Wednesday, April 15, 2015

Fixed size and variable Size in SGA

Have you ever wondered what is that fixed size and variable size when you say show SGA?

11:30:35 SQL> show sga

Total System Global Area  778387456 bytes
Fixed Size                           1374808 bytes
Variable Size                      662701480 bytes
Database Buffers                109051904 bytes
Redo Buffers                      5259264 bytes


Lets dig into this now.

The first component "Total System Global Area" is nothing but

Fixed Size + Variable Size + Database Buffers + Redo Buffers


The second component "Fixed Size" is constant for a version/release for a particular platform. This is internally set by oracle kernel and absolutely the DBA cannot do anything about it.

The third component  "Variable Size" is calculated by

shared_pool_size + Java_pool_size + large_pool_size + streams_pool_size

Please use the below query to get this value to avoid doing it manually.

11:42:13 SQL> select sum(bytes)/1024/1024 from  v$sgastat
11:42:28   2  where pool in ('java pool','streams pool','shared pool','large pool');

SUM(BYTES)/1024/1024
--------------------
          632.004478

1 row selected.

The third and fourth component  are db buffers and redo buffers.



No comments: