sapnote_0000927295
TRANSCRIPT
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 1/6
28.07.2011 Page 1 of 6
SAP Note 927295 - FAQ: Oracle system statistics
Note Language: English Version: 19 Validity: Valid Since 26.08.2009
Summary
Symptom
1. What are system statistics?
2. What is the difference between system statistics and regular CBO
statistics?
3. What are WORKLOAD and NOWORKLOAD system statistics?
4. How can I create system statistics?
5. How can I delete system statistics?
6. Where do I find the current values of the system statistics?
7. Where do I find the values of former system statistics?
8. Do you recommend system statistics in the SAP environment?
9. Which advantages do system statistics have?
10. How are system statistics included in CBO cost calculation?
11. Why does the cost of a full table scan decrease when IOSEEKTIM
increases?
12. Which restrictions do I have to consider with respect to system
statistics?
13. Where can I find more information about system statistics?
Other terms
Frequently asked questions
Reason and Prerequisites
Solution
1. What are system statistics?
System statistics contain information on system-specific performance
data such as CPU rate or average duration of a hard disk access.
Consequently, they represent a supplement of the regular CBO
statistics (Note 588668).
2. What is the difference between system statistics and regular CBO
statistics?
You can distinguish system statistics and regular CBO statistics asfollows:
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 2/6
28.07.2011 Page 2 of 6
SAP Note 927295 - FAQ: Oracle system statistics
o Regular CBO statistics
- These are table, column and index-related.
- They contain information on the storage requirement (for
example, number of the table blocks) and of the data
constellation (for example, number of the instances of a
column).
- They serve as a basis to estimate block accesses.
o System statistics
- These are system-specific.
- They contain information such as CPU rate, average duration of
single block and multi block read accesses, and seek and
transfer times.
- They are used to include CPU times and to weight single block
read times, multi block read times, and CPU times.
3. What are WORKLOAD and NOWORKLOAD system statistics?
o NOWORKLOAD statistics contain information which Oracle considers
workload-independent. Internal default values are used with Oracle
9i, while the following values as from 10g are determined
system-dependently:
- CPUSPEEDNW: CPU speed (in instructions per microsecond) when
the system is not under load
- IOSEEKTIM: Seek time for block read accesses (in milliseconds)
- IOTFRSPEED: Block transfer time (in bytes per millisecond)
o WORKLOAD statistics contain additional key figures which may depend
on the system load:
- SREADTIM: Average access time (in milliseconds) for a single
block read (for example, "DB file sequential read", index
access)
- MREADTIM: Average access time (in milliseconds) for a multi
block read ("DB file scattered read", full table scan)
- CPUSPEED: CPU speed (in millions of instructions per second)
- MBRC: Average number of blocks read for a multi block read
("multi block read count")
Since WORKLOAD statistics are load-dependent, it is important to
generate these statistics during a characteristic workload phase.
4. How can I create system statistics?
You can use Oracle tools to create system statistics with the
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 3/6
28.07.2011 Page 3 of 6
SAP Note 927295 - FAQ: Oracle system statistics
DBMS_STATS.GATHER_SYSTEM_STATS command:
o NOWORKLOAD statistics:
EXEC DBMS_STATS.GATHER_SYSTEM_STATS;
o WORKLOAD statistics:
EXEC DBMS_STATS.GATHER_SYSTEM_STATS('INTERVAL', <minutes>);
<minutes>: Number of minutes during which you are to determine the
WORKLOAD statistics.
In the SAP environment, BRCONNECT permits the creation of system
statistics with the aid of the "-f stats -t system_stats [-i
<minutes>]" options. For more information, see Note 601395.
5. How can I delete system statistics?
You can delete WORKLOAD statistics with the aid of the
DELETE_SYSTEM_STATS function of the DBMS_STATS package:
EXEC DBMS_STATS.DELETE_SYSTEM_STATS;
NOWORKLOAD statistics are retained in spite of the execution of this
command.
6. Where do I find the current values of the system statistics?
In the Oracle Data Dictionary, the system statistics are stored in the
AUX_STATS$ table. With the following query, you can receive the
present values of the system statistics:
SELECT PNAME, PVAL1 FROM SYS.AUX_STATS$
WHERE SNAME = 'SYSSTATS_MAIN';
You can determine the start date and the end date of the system
statistic creation as follows:
SELECT
PNAME,
SUBSTR(PVAL2, 1, 40) "DATE"
FROM SYS.AUX_STATS$
WHERE SNAME = 'SYSSTATS_INFO' AND PNAME IN ('DSTART', 'DSTOP');
In the SAP system, you can access this information from transaction
ST04N / DBACOCKPIT under "Additional Functions -> System Statistics
for CBO". You must implement the views from Note 706927 before you can
use this function.
7. Where do I find the values of former system statistics?
As of Oracle 10g, you can find historical system statistics in the
WRI$_OPTSTAT_AUX_HISTORY Oracle DDIC table. You can determine the
historical values for a key figure <param> (for example, "MBRC") as
follows:
SELECT SAVTIME, PVAL1
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 4/6
28.07.2011 Page 4 of 6
SAP Note 927295 - FAQ: Oracle system statistics
FROM WRI$_OPTSTAT_AUX_HISTORY
WHERE PNAME = '<param>'
ORDER BY SAVTIME ASC;
Also as of Oracle 10g, the DBA_OPTSTAT_OPERATIONS view exists, which
stores the executed commands concerning system statistics:
8. Do you recommend system statistics in the SAP environment?
With Oracle 9i, SAP does not recommend the creation of system
statistics in the standard. In individual cases, however, a creation
might be useful.
As of Oracle 10g, we recommend that you create NOWORKLOAD system
statistics on a regular basis.
9. Which advantages do system statistics have?
As a standard, the CPU demand is not included in the cost calculationof the CBO. In addition, the weighting of multi block read accesses is
static in comparison with single block read accesses.
With system statistics, you can weight the three components CPU
consumption, single block reads, and multi block reads correctly so
that the CBO has significantly more data available for the actual
resource and time demand and can thus make more optimal decisions.
Furthermore, you can adjust system statistics manually by means of
DBMS_STATS.SET_SYSTEM_STATS if required. For example, you may set MBRC
explicitly in order to achieve a useful separation of I/O behavior
(parameter DB_FILE_MULTIBLOCK_READ_COUNT) and cost calculation (MBRC).
For this, read the particular information from Note 750631.
10. How are system statistics included in CBO cost calculation?
Before system statistics are analyzed, the system determines following
sizes based on the normal CBO statistics and on hard-coded assumptions
regarding the CPU consumption of certain actions:
o #CPUCycles: Number of required CPU cycles
o #SingleBlockReadBlocks: Number of blocks that are read within the
framework of single block read accesses
o #MultiBlockReadBlocks: Number of blocks that are read within the
framework of multi block read accesses
If there are only NOWORKLOAD statistics, the system performs internal
calculations with Oracle 9i. With Oracle 10g, the WORKLOAD statistic
values are determined dynamically as follows:
o MBRC:
- DB_FILE_MULTIBLOCK_READ_COUNT (if explicitly set)
- _DB_FILE_OPTIMIZER_READ_COUNT (otherwise)
o SREADTIM: IOSEEKTIM + DB_BLOCK_SIZE / IOTFRSPEED
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 5/6
28.07.2011 Page 5 of 6
SAP Note 927295 - FAQ: Oracle system statistics
o MREADTIM: IOSEEKTIM + MBRC * DB_BLOCK_SIZE / IOTFRSPEED
o CPUSPEED: CPUSPEEDNW
Based on these values or when WORKLOAD statistics are present, the
costs are now determined roughly in accordance with the following
formula:
Costs = (#SingleBlockReadBlocks +
#MultiBlockReadBlocks * MREADTIM / (MBRC * SREADTIM) +
#CPUCycles / (CPUSPEED * SREADTIM))
Therefore, the single block reads are the unit of the costs - the
other key figures multi block reads and CPU time are scaled onto the
single block reads.
Note that the final costs are still affected by other factors such as
parameterization or parallel processing (Note 750631).
11. Why does the cost of a full table scan decrease when IOSEEKTIM
increases?
At first, it is not clear why an increase in the I/O seek time should
reduce the costs of full table scans. This is explained when we
examine the cost calculation formulas described above, and the
normalization of multi block reads relative to single block reads that
they contain: If IOSEEKTIM increases, the ratio of MREADTIM and
SREADTIM decreases. Multi-accesses are less expensive than
single-block accesses, which reduces costs.
12. Which restrictions do I have to consider with respect to system
statistics?
The following restrictions exist with respect to system statistics:
o WORKLOAD statistics always reflect the behavior of the system in
the interval of the system statistic creation. Hence, it is
important to create WORKLOAD statistics in a time period of
characteristic system activities. However, note that we do not
recommend that you normally create WORKLOAD statistics.
o The system creates temporary help entries in AUX_STATS$ while
creating WORKLOAD statistics. The actual system statistics are onlyvisible upon completion of the creation interval.
o If no sufficient load is applied in the interval of the WORKLOAD
statistics creation, individual statistic values such as SREADTIM,
MBRC or MREADTIM are not determined and are stored with the value
-1 (9i) or with an empty entry (10g) in AUX_STATS$ instead. As a
consequence, the affected part of the system statistics is ignored
and only the rest is applied (for example, CPU-specific
statistics).
o If the system determines a MREADTIM value which is smaller than
SREADTIM , Oracle assumes an error in the statistics and ignoresthe block-related system statistics. Merely the CPU-related
statistics are used.
8/6/2019 sapnote_0000927295
http://slidepdf.com/reader/full/sapnote0000927295 6/6
28.07.2011 Page 6 of 6
SAP Note 927295 - FAQ: Oracle system statistics
13. Where can I find more information about system statistics?
You can find exact details on system statistics as part of the Oracle
online documentation.
Header Data
Release Status: Released for Customer
Released on: 26.08.2009 10:01:47
Master Language: German
Priority: Recommendations/additional info
Category: FAQ
Primary Component: BC-DB-ORA Oracle
The Note is release-independent
Related Notes
Number Short Text
825653 Oracle: Common misconceptions
750631 Approximations for cost calculation of the CBO
706927 Oracle DB-Mon: Installation script for ST04N/DBA Cockpit
601395 Collecting system statistics with BRCONNECT
588668 FAQ: Database statistics
176754 Problems with CBO and RBO