Monday, February 1, 2021

flush_sga.sql

 $ more flush_sga.sql
 SELECT ROUND (used.bytes / 1024 / 1024, 2) used_mb,
       ROUND (free.bytes / 1024 / 1024, 2) free_mb,
       ROUND (tot.bytes / 1024 / 1024, 2)  total_mb
  FROM (SELECT SUM (bytes) bytes
          FROM v$sgastat
         WHERE name != 'free memory') used,
       (SELECT SUM (bytes) bytes
          FROM v$sgastat
         WHERE name = 'free memory') free,
       (SELECT SUM (bytes) bytes FROM v$sgastat) tot;

set heading on

alter system flush shared_pool;

 SELECT ROUND (used.bytes / 1024 / 1024, 2) used_mb,
       ROUND (free.bytes / 1024 / 1024, 2) free_mb,
       ROUND (tot.bytes / 1024 / 1024, 2)  total_mb
  FROM (SELECT SUM (bytes) bytes
          FROM v$sgastat
         WHERE name != 'free memory') used,
       (SELECT SUM (bytes) bytes
          FROM v$sgastat
         WHERE name = 'free memory') free,
       (SELECT SUM (bytes) bytes FROM v$sgastat) tot;

No comments:

Post a Comment