You are on page 1of 2

systeminfo | find "Virtual Memory"

=====Get the estimated memory footprint of an existing database.

---- Get the SGA footprint of a database instance:


SELECT sum(value)/1024/1024 "TOTAL SGA (MB)" FROM v$sga;

---- Get the current PGA consumption of a database instance:


select sum(pga_max_mem)/1024/1024 "TOTAL MAX PGA (MB)" from v$process;

---- A more detailed breakdown of PGA memory usage:


SELECT spid, program,
pga_max_mem max,
pga_alloc_mem alloc,
pga_used_mem used,
pga_freeable_mem free
FROM V$PROCESS;

--- The query below gives the max allocated memory by a user session. We’ll use
this to calculate the remaining memory requirements for the unconnected processes.
select max(p.pga_max_mem)/1024/1024 Max--"PGA MAX MEMORY OF USER SESSION (MB)"
from v$process p, v$session s
where P.ADDR = S.paddr and s.username is not null;

--- Get the maximum number of processes that an Oracle instance can handle.
select name, value from v$parameter where name = 'processes';

--- Let's count the number of connected sessions:


select count(1) from v$session where username is not null;

===== Get the estimated storage sizing requirements of a database.

-- Copy and paste each resulting commands onto a shell script and execute in
primary server to get the mount point size

select unique 'df -k '||a.MTPOINT MOUNT_POINT


from ( select substr(FILE_NAME,0,instr(FILE_NAME,'/',1,2)-1) MTPOINT
from dba_data_files
union
select substr(FILE_NAME,0,instr(FILE_NAME,'/',1,2)-1) MTPOINT
from dba_temp_files
union
select substr(MEMBER,0,instr(MEMBER,'/',1,2)-1) MTPOINT
from v$logfile
union
select substr(NAME,0,instr(NAME,'/',1,2)-1) MTPOINT
from v$controlfile) a;
--- Query all parameter file destination and determine if they are of different
path from the datafile mount point or ORACLE_BASE dir. get the mount point size of
file destinations

select name, value from v$parameter


where (regexp_like(name, '^log_archive_(dest|dest\_([1-9]))$', 'i') or name like
'%dump_dest' or name like '%file_dest' or name like 'diag%dest' or name
='utl_file_dir') and value is not null;

--- Query the database directories for mount points

select 'df -k '||substr(DIRECTORY_PATH,0,instr(DIRECTORY_PATH,'/',1,2)-1) MTPOINT


from dba_directories;

select name c1,cnt c2,decode(total, 0, 0, round(cnt*100/total)) c3


from
(
select name,value cnt,(sum(value) over ()) total
from
v$sysstat
where
name like 'workarea exec%'
);

You might also like