Monday, August 9, 2010

Gathering System Statistics

  • System Statistics can be collected and displayed for CBO to use and apprehend CPU and system I/O information. For each plan candidate, the optimizer computes estimates for I/O and CPU costs.
  • Invoke the dbms_stats.gather_system_stats procedure as an elapsed time capture, making sure to collect the statistics during a representative heavy workload
  • How to collect  these  statistics.easist way  of  it  is

    execute dbms_stats.gather_system_stats('Start');
    -- one hour delay during high workload
    execute dbms_stats.gather_system_stats('Stop');

  •  Here are the data items collected by dbms_stats.gather_system_stats: we  can query it  from  aux_stats$ system view

    select * from aux_stats$;
    No Workload (NW) stats::
    CPUSPEEDNW - CPU speed
    IOSEEKTIM - The I/O seek time in milliseconds
    IOTFRSPEED - I/O transfer speed in milliseconds
    Workload-related stats:
    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
    SLAVETHR - OPQ Factotum (slave)
  • If the hardware or workload has changed these  statistics must be  refreshed.
  • If  the workload  differs  from day to  nigth  (run OLTP during the day and DSS at night) then  statistics can be  exported  to  a table and  One  job may be   scheculed  to  import  statistics  before  begining  of  night  and   day

No comments: