Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Query to find CPU and memory usage

Oracle Database Tips by Burleson Consulting

June 9, 2016

Question: What do I query to see the CPU cores and the total RAM usage for my instance using AWR?

Answer:  If you have purchased the diagnostic and tuning packs to read the AWR tables, you can run this query using dba_hist_osstat.  Also see this link on dba_hist_osstat.

With AWR, you can run this script to see RAM allocations on Oracle:

set lines 80
col c1 heading 'STAT'  format a25
col c2 heading 'Count' format 999,999,999,999
select distinct
   stat_name   c1,
   value       c2
from
   dba_hist_osstat
where
   stat_name in (
   'NUM_CPU_CORES',
   'NUM_CPU_SOCKETS',
   'PHYSICAL_MEMORY_BYTES'
);

Without AWR, this script will display CPU and RAM allocations for Oracle:

clear breaks
clear computes
clear columns
 
prompt
prompt ***********************************************
prompt Get cpu_count
prompt ***********************************************
col c1 heading 'CPU|Cores' format a20
col c2 heading 'Size'      format a20
select
   name  c1,
   value c2
from
   v$parameter
where
   name like '%cpu_count%';
prompt
prompt ***********************************************
prompt Get SGA size from v$sga
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format 999,999,999
select
   name  c1,
   value c2
from
   v$sga;
select
   sum(value) c2
from
   v$sga;
prompt
prompt ***********************************************
prompt Get RAM size if using manual pools
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format a20
select
   name  c1,
   value c2
from
   v$parameter
where
   (name like '%pool_size%'
or
    name like '%cache_size%')
and
   value is not null
and
   value <> '0';
prompt
prompt ***********************************************
prompt Get RAM size if using AMM
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format 999,999,999
select
   name             c1,
   to_number(value) c2
from
   v$parameter
where
   name like '%target'
and
   (name like 'memory%'
or
   name like 'sga%')
and
   value is not null
and
   value <> '0';
prompt
prompt ***********************************************
prompt Get PGA high water mark
prompt ***********************************************
col c1 heading 'PGA|Stat'  format a40
col c2 heading 'Size'      format 999,999,999
select
   name  c1,
   value c2
from
   v$pgastat
where
   name like ('maximum%');
clear breaks
clear computes
clear columns
prompt *******************************************
prompt Get the instance name
prompt ******************************************* 
select instance_name from v$instance;
prompt
prompt ***********************************************
prompt Get cpu_count
prompt ***********************************************
col c1 heading 'CPU|Cores' format a20
col c2 heading 'Size'      format a20
select
   name  c1,
   value c2
from
   v$parameter
where
   name like '%cpu_count%';
prompt
prompt ***********************************************
prompt Get SGA size from v$sga
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format 999,999,999
select
   name  c1,
   value c2
from
   v$sga;
select
   sum(value) c2
from
   v$sga;
prompt
prompt ***********************************************
prompt Get RAM size if using manual pools
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format a20
select
   name  c1,
   value c2
from
   v$parameter
where
   (name like '%pool_size%'
or
    name like '%cache_size%')
and
   value is not null
and
   value <> '0';
prompt
prompt ***********************************************
prompt Get RAM size if using AMM
prompt ***********************************************
col c1 heading 'Pool|Name' format a20
col c2 heading 'Size'      format 999,999,999
select
   name  c1,
   to_number(value) c2
from
   v$parameter
where
   name like '%target'
and
   (name like 'memory%'
or
   name like 'sga%')
and
   value is not null
and
   value <> '0';
prompt
prompt ***********************************************
prompt Get PGA high water mark
prompt ***********************************************
col c1 heading 'PGA|Stat'  format a40
col c2 heading 'Size'      format 999,999,999
select
   name  c1,
   value c2
from
   v$pgastat
where
   name like ('maximum%');

 

 


   
Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training
 
 


  Oracle consulting and training

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2016

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.


 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster