Skip to main content

Oracle Database Check the usage of SGA


SQL> show sga

Total System Global Area 524288000 bytes
Fixed Size                  2046008 bytes

Variable Size             423626696 bytes

Database Buffers           92274688 bytes

Redo Buffers                6340608 bytes

SQL> show parameter sga_max_size

NAME                                 TYPE        VALUE

------------------------------------ -----------
------------------------------
sga_max_size                         big integer 500M


select value/1024/1024 shared_pool_size
from v$parameter
where name = 'shared_pool_size';

select * From v$sgastat;

select 'Memory Allocation' " "
, round(s.sgasize/1024/1024,2) "Total SGA (Mb)"
, round(f.bytes/1024/1024,2) " Free (Mb)"
, round(f.bytes*100/s.sgasize,2) " Free (%)"
from (select sum(bytes) sgasize from sys.v_$sgastat) s
, sys.v_$sgastat f
where f.name = 'free memory'
/


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
/


SQL> select sum(bytes)/1024/1024 " SGA size used in MB" from v$sgastat where name!='free memory';

 SGA size used in MB

          251.23645

Now we will use a simple SQL to see the free memory in SGA.

Select POOL, Round(bytes/1024/1024,0) Free_Memory_In_MB
  From V$sgastat
  Where Name Like '%free memory%';


Comments

  1. Hard Rock Hotel & Casino Las Vegas - Mapyro
    Realtime driving directions 창원 출장안마 to Hard Rock Hotel & 남원 출장마사지 Casino Las Vegas, 100 Fremont Street, Las Vegas, 안산 출장마사지 based on 안성 출장안마 live traffic updates 광명 출장샵 and road conditions – from

    ReplyDelete

Post a Comment

Popular posts from this blog

Oracle Database How much redo generated per hour

Track the Amount of Redo Generated per Hour / Day  Amount of Redo Generated per Hour SELECT  Start_Date,   Start_Time,   Num_Logs, Round(Num_Logs * (Vl.Bytes / (1024 * 1024)),2) AS Mbytes, Vdb.NAME AS Dbname FROM (SELECT To_Char(Vlh.First_Time, 'YYYY-MM-DD') AS Start_Date, To_Char(Vlh.First_Time, 'HH24') || ':00' AS Start_Time, COUNT(Vlh.Thread#) Num_Logs FROM V$log_History Vlh GROUP BY To_Char(Vlh.First_Time,  'YYYY-MM-DD'), To_Char(Vlh.First_Time, 'HH24') || ':00') Log_Hist, V$log Vl ,  V$database Vdb WHERE Vl.Group# = 1 ORDER BY Log_Hist.Start_Date, Log_Hist.Start_Time; Redo generated Per day: select trunc(completion_time) rundate ,count(*)  logswitch ,round((sum(blocks*block_size)/1024/1024)) "REDO PER DAY (MB)" from v$archived_log group by trunc(completion_time) order by 1;

Oracle database check db_recovery_file_dest_size usage

db_recovery_file_dest_size usage The following scripts will check space utilization for  db_recovery_file_dest_size : col name     format a32 col size_mb  format 999,999,999 col used_mb  format 999,999,999 col pct_used format 999 select    name,    ceil( space_limit / 1024 / 1024) size_mb,    ceil( space_used / 1024 / 1024) used_mb,    decode( nvl( space_used, 0),0, 0,    ceil ( ( space_used / space_limit) * 100) ) pct_used from     v$recovery_file_dest order by    name desc; ********************************* set lines 100 col name format a60 select    name,    floor(space_limit / 1024 / 1024) "Size MB",    ceil(space_used / 1024 / 1024)   "Used MB", from    v$recovery_file_dest order by    name;