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

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle News

 Oracle Forum
 Class Catalog


 Our Staff
 Our Prices
 Help Wanted!

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


 SQL Tuning
 Security

 UNIX
 Oracle UNIX
 Linux
 Oracle Linux
 Monitoring
 Remote help

 Remote plans
 Remote
services
 Oracle C++
 Oracle Java
 Apache
 JDeveloper
 App Server

 Applications
 Oracle Forms
 Oracle Portal
 11i Upgrades
 SQL Server
 Oracle Concepts
 HTML-DB Tips
 Software Help

 Remote Help  
 Development  

 Implementation


 Financials Training
 Oracle 11i
 Oracle Apps 11i
 Oracle Workflow
 Oracle AR 11i Class
 Oracle AP 11i class
 Oracle GL 11i class
 Oracle HR 11i class
 Oracle FA 11i class
 11i Project Mgt
 11i procurement
 11i collections


 Oracle Posters
 Oracle Books

 Oracle Tuning Book
 Oracle RAC Book
 Oracle Security
 Easy Oracle Books
 Oracle Scripts
 SQL Server DBA
 SQL Design Patterns
 Ion
 Excel-DB   


 BC Oracle News


 Rednecks!
 Dress code
 Arabian Stallion

 Burleson Arabians
 Guide Horses
 Don Burleson Blog
 Golf & Travel


 Privacy Policy
 

 

 
 

Oracle OS statistics

Oracle Tips by Burleson Consulting

October 2, 2009

Oracle knows that the database does not run in a vacuum and that external environmental events have a huge impact on Oracle performance.

The speed of disk access, the backlog of CPU enqueues, network latency and RAM swapping can all be the root cause of an Oracle performance problem, and no amount of tuning can fix a problem that is at the OS layer, external to Oracle.

Oracle has two main ways to collect OS information:

  • dbms_stats - the gather_system_stats procedure samples important OS metrics.

  • v$ Views - Oracle background processes also collect OS information and  store them in v$osstat.  In STATSPACK we have OS information in stats$osstat and  stats$osstatname and in AWR we have OS statistics inside the dba_hist_osstat table.

Let's take a closer look at the operating system statistics captured by Oracle.

Using dbms_stats.gather_system_stats

The dbms_stats.gather_system_stats procedure measures important timings within the database and adjusts the optimizers propensity to choose indexes vs. full-scans.  Oracle captures these OS statistics:

Here are the data items collected by dbms_stats.gather_system_stats:

Non Workload (NW) OS statistics:

  • CPUSPEEDNW - CPU speed
  • IOSEEKTIM - The I/O seek time in milliseconds
  • IOTFRSPEED - I/O transfer speed in milliseconds

Workload-related OS statistics:

  • SREADTIM  - Single block read time in milliseconds
  • MREADTIM - Multiblock read time in ms
  • CPUSPEED - CPU speed
  • MBRC - Average blocks read per multiblock read
  • MAXTHR - Maximum I/O throughput (for OPQ only)
  • SLAVETHR - OPQ Factotum (slave) throughput (OPQ only)   

Here is a script to display these Oracle OS statistics:

select
   sum(a.time_waited_micro)/sum(a.total_waits)/1000000 c1,
   sum(b.time_waited_micro)/sum(b.total_waits)/1000000 c2,
   (
      sum(a.total_waits) /
      sum(a.total_waits + b.total_waits)
   ) * 100 c3,
   (
      sum(b.total_waits) /
      sum(a.total_waits + b.total_waits)
   ) * 100 c4,
  (
      sum(b.time_waited_micro) /
      sum(b.total_waits)) /
      (sum(a.time_waited_micro)/sum(a.total_waits)
   ) * 100 c5
from
   dba_hist_system_event a,
SEE CODE DEPOT FOR FULL SCRIPTS
   dba_hist_system_event b
where
   a.snap_id = b.snap_id
and
   a.event_name = 'db file scattered read'
and
   b.event_name = 'db file sequential read';

OS data inside Oracle views

Oracle has several views that collect OS information, namely v$osstat, stats$osstat, stats$osstatname and dba_hist_osstat.

Here is a script that queries the AWR for OS statistics:

select e.stat_name "Statistic Name"

     , decode(e.stat_name, 'NUM_CPUS', e.value, e.value - b.value) "Total"

     , decode( instrb(e.stat_name, 'BYTES'), 0, to_number(null)

             , round((e.value - b.value)/( select

       avg( extract( day from (e1.end_interval_time-b1.end_interval_time) )*24*60*60+

           extract( hour from (e1.end_interval_time-b1.end_interval_time) )*60*60+

           extract( minute from (e1.end_interval_time-b1.end_interval_time) )*60+

           extract( second from (e1.end_interval_time-b1.end_interval_time)) )    

      from dba_hist_snapshot  b1

          ,dba_hist_snapshot  e1

     where b1.snap_id         = b.snap_id

       and e1.snap_id         = e.snap_id

       and b1.dbid            = b.dbid

       and e1.dbid            = e.dbid

       and b1.instance_number = b.instance_number

       and e1.instance_number = e.instance_number

       and b1.startup_time    = e1.startup_time

       and b1.end_interval_time < e1.end_interval_time ),2)) "Per Second"

 from  dba_hist_osstat  b

SEE CODE DEPOT FOR FULL SCRIPTS

     , dba_hist_osstat  e

 where b.snap_id         = &pBgnSnap

   and e.snap_id         = &pEndSnap

   and b.dbid            = &pDbId

 order by 1 asc;

 

The query output looks like the following:

 

SQL> @os_stat_int_10g.sql

 

Statistic Name                      Total    Per Second

------------------------------ ----------    ----------

AVG_BUSY_TICKS                    1,974,925

AVG_IDLE_TICKS                    7,382,241

AVG_IN_BYTES                  2,236,256,256  23,881.91

AVG_OUT_BYTES                   566,304,768     6047.8

AVG_SYS_TICKS                       727,533

AVG_USER_TICKS                    1,247,392

BUSY_TICKS                        1,974,925

IDLE_TICKS                        7,382,241

IN_BYTES                      2,236,256,256  23,881.91

NUM_CPUS                                  1

OUT_BYTES                       566,304,768    6,047.8

SYS_TICKS                           727,533

USER_TICKS                         1247,392

If you like Oracle tuning, you may enjoy my new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.



 

 

  
 

 Oracle cruise
 
 
 
Oracle performance tuning software
 
 

Oracle performance tuning book

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

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 -  2009 by Burleson Enterprises, Inc. All rights reserved.

Oracle ? is the registered trademark of Oracle Corporation.