Beruflich Dokumente
Kultur Dokumente
• The streams pool contains all the necessary data Oracle parameters that affect the shared pool
for streams processing. This new pool has the new components include OPEN_CURSORS, SESSION_
Oracle10g parameter STREAMS_POOL_SIZE, CACHED_CURSORS, CURSOR_SPACE_FOR_
which specifies its size and must be accounted for TIME, CURSOR_SHARING, and SHARED_
as part of the Oracle10g SGA. POOL_RESERVED_SIZE. Oracle recommends
setting SHARED_POOL_RESERVED_SIZE to
• The least recently used (LRU) list monitors 10% of the value of the SHARED_POOL_SIZE
buffer use. Buffers are sorted by the number of parameter.
times they have been used.
• The DB_CACHE_SIZE parameter specifies the
• The checkpoint queue contains all the buffers
size of the DEFAULT buffer pool cache of stan-
found during the LRU scan that have been modi-
dard blocks. The primary block size used for the
fied by a server process. The DB writer (DBWn)
SYSTEM tablespace and the primary buffer caches
server process writes these buffers to disk during
is specified by the DB_BLOCK_SIZE parameter.
a checkpoint.
Beginning with Oracle9i, a dynamic SGA • The DB_{2K, 4K, 8K, 16K, 32K}_CACHE_SIZE
implements an infrastructure that allows the SGA parameter specifies the size of the 2K, 4K, 8K,
configuration to change without shutting down the 16K, and 32K buffers and is only allowed when
instance. This then allows you to change the sizes of the DB_BLOCK_SIZE is not a multiple of kilo-
the database buffer cache, shared pool, and large pool bytes in size.
without shutting down the Oracle instance. The size of
the SGA is determined by the following initialization • The DB_KEEP_CACHE_SIZE and DB_ RECYCLE
parameters, which are specified in the init<SID>.ora _CACHE_SIZE parameters specify the KEEP
Oracle initialization file: and RECYCLE buffer pools, respectively. The
buffer size in both pools is specified by the
• The SHARED_POOL_SIZE parameter specifies DB_BLOCK_SIZE parameter. The parameter
the size (in bytes) of the area devoted to shared DB_KEEP_CACHE_SIZE replaces the Oracle8i
SQL and PL/SQL (Oracle’s procedural language parameter BUFFER_POOL_KEEP. The parameter
extension to SQL). The default is 8MB for 32-bit DB_RECYCLE_CACHE_SIZE replaces the
platforms and 64MB for 64-bit platforms. Other Oracle8i parameter BUFFER_POOL_RECYCLE.
• The LOG_BUFFER parameter specifies the down. You do this using the new Oracle parameter
number of bytes allocated for the log buffer. SGA_MAX_SIZE. It specifies the maximum size in
The default is the greater of 512KB or 128KB bytes that the Oracle SGA can reach for the life of the
× CPU_COUNT. particular instance.
• The LARGE_POOL_SIZE parameter specifies The total size of the SGA cannot exceed the value
the size of the large pool. The default is zero specified in the Oracle parameter SGA_MAX_SIZE
unless the init.ora Oracle parameter PARALLEL_ and can be computed with the following formulas for
AUTOMATIC_TUNING is set to TRUE, in which both the Oracle9i and Oracle10g versions:
case the default is automatically calculated.
• Total SGA size for Oracle9i =
• The JAVA_POOL_SIZE parameter specifies the
size of the Java pool. The default is 24MB. Other DB_CACHE_SIZE
parameters that can be used to limit the amount + DB_2K_CACHE_SIZE
of memory used by each Java session include + DB_4K_CACHE_SIZE
JAVA_SOFT_SESSIONSPACE_LIMIT (the + DB_8K_CACHE_SIZE
default is 1MB) and JAVA_MAX_ + DB_16K_CACHE_SIZE
SESSIONSPACE_SIZE (the default is 4GB). + DB_32K_CACHE_SIZE
+ DB_KEEP_CACHE_SIZE
• The STREAMS_POOL_SIZE parameter specifies + DB_RECYCLE_CACHE_SIZE
the size of the streams pool. If this parameter is set + SHARED_POOL_SIZE
to 0, then by default up to 10% of the shared pool + LARGE_POOL_SIZE
is allocated for the streams pool. If this parameter + JAVA_POOL_SIZE
is greater than zero, then the value is used to + LOG_BUFFER
specify the size of the streams pool. + 1MB
As I mentioned earlier, the Oracle SGA plays < SGA_MAX_SIZE
a role in database caching efficiency, database file
I/O, database latch contention, and rollback segment • Total SGA size for Oracle10g =
contention. Let’s look at how you can optimize these
areas within the Oracle database, starting with data- <Total SGA size for Oracle9i>
base caching efficiency. + STREAMS_POOL_SIZE
< SGA_MAX_SIZE
Let’s now turn our attention to ways you can
improve the performance of database file I/O by
Database caching efficiency relocating files appropriately.
The most significant improvement you can make
to any Oracle database is to manage the buffers
containing database data that has been cached from
disk into system memory. The Oracle DBA speci-
Database file I/O
fies the memory size for the cached data with the Proper placement of database files can reduce
Oracle init.ora parameter DB_CACHE_SIZE. contention for resources. The Oracle utility
The DB_CACHE_SIZE parameter replaces the STATSPACK provides a list of all database files
DB_BLOCK_BUFFERS parameter of Oracle8i. and the associated amount of I/O. Verify the balance
Since Oracle9i can support databases for different of I/O activity across all available disks. If multiple
block sizes, you can now change the size of all database files on the same disk cause contention,
Oracle caches such as the buffer cache, the shared move one of the files to a less active disk. Do not
pool, the large pool, and the fixed size while the move any of the database files to the application
instance is running, so you do not have to shut it disk, however, since this disk is usually quite active.
# rm /fromdisk/<tbl-space-datafile>.dbf
Another area ripe for performance improvement is The cache buffer chains latch often experiences
database latches. Next we’ll look at how to identify contention, as does the cache buffer LRU chain and
latches that are causing excessive resource consumption. the cache buffer handles latch. These latches typically
indicate that tuning the number of the SGA buffers is
required.
Database latch contention The last area we will look at is rollback segment
contention, and how you can improve performance by
Database latches are simple low-level serialization
correctly sizing the segments.
mechanisms used to protect Oracle SGA shared data
structures. Their implementation is OS-dependent. If
a process cannot obtain a latch immediately, it spins
while it waits for the latch and thus consumes CPU
cycles. Rollback segment contention
Latches control access to the log buffer. The Rollback segments are made up of contiguous multi-
Oracle statistical gathering tools — STATSPACK and block pieces known as extents, and they contain
UTLBSTAT/UTLESTAT — provide a list of all rollback entries. The correct size of the rollback
latches and the amount of contention for them. To segments depends on the normal transaction activity
identify latch contention, you need to determine the of the database. Choosing the wrong size can affect
ratio between the columns TIMEOUTS and database performance.
IMMEDIATE. If the ratio of TIMEOUTS to
IMMEDIATE is greater than 15%, then latch The size is specified by the storage parameters of
contention exists. If the value of latch_free for the the rollback segment itself. The best way to avoid
output from v$system_event seems to be causing rollback segment contention is to create many rollback
contention, then you can use the output from segments large enough to contain the rollback entries
v$session_wait to determine which latches are causing for the transactions, and to assign each transaction to
the contention. The latch number is given in the p2 its own rollback segment with the use of the SQL SET
field, and you can identify it with this query form: TRANSACTION statement. For example:
SQL> select latch#, name from v$latch SQL> set transaction use rollback
where latch#=8; segment prs_45;
To find out which Oracle parameters are underscored (valid, but should be used only if absolutely
necessary) or obsolete, query the X$KSPPO view on your version of the Oracle RDBMS as follows:
SQL> SELECT kspponm,
2 DECODE(ksppoflg, 1,'Obsolete', 2, 'Underscored')
3 FROM x$ksppo
4 ORDER BY kspponm;
Executing this query on Oracle 9i (9.2.0.1.0), for example, produces the following results:
KSPPONM DECODE(KSPP)
----------------------------------------------------------------------------------
_average_dirties_half_life Obsolete
_db_no_mount_lock Obsolete
_lm_multiple_receivers Obsolete
_lm_statistics Obsolete
_seq_process_cache_const Obsolete
allow_partial_sn_results Obsolete
always_anti_join Underscored
always_semi_join Underscored
arch_io_slaves Underscored
b_tree_bitmap_plans Underscored
backup_disk_io_slaves Underscored
cache_size_threshold Obsolete
cleanup_rollback_entries Underscored
close_cached_open_cursors Underscored
compatible_no_recovery Underscored
complex_view_merging Underscored
cpu_count Underscored
db_block_checkpoint_batch Obsolete
db_block_lru_extended_statistics Obsolete
db_block_lru_latches Underscored
db_block_lru_statistics Obsolete
db_block_max_dirty_target Underscored
db_file_simultaneous_writes Obsolete
delayed_logging_block_cleanouts Obsolete
discrete_transactions_enabled Underscored
distributed_recovery_connection_hold_time Underscored
distributed_transactions Obsolete
fast_full_scan_enabled Underscored
freeze_DB_for_fast_instance_recovery Obsolete
gc_defer_time Underscored
gc_latches Underscored
gc_lck_procs Obsolete
gc_releasable_locks Obsolete
gc_rollback_locks Obsolete
hash_multiblock_io_count Underscored
instance_nodeset Obsolete
job_queue_interval Obsolete
job_queue_keep_connections Obsolete
large_pool_min_alloc Underscored
lgwr_io_slaves Underscored
lm_locks Underscored
lm_procs Underscored
lm_procs Underscored
lm_ress Underscored
lock_sga_areas Underscored
log_block_checksum Obsolete
log_files Obsolete
log_files Obsolete
log_simultaneous_copies Underscored
log_small_entry_max_size Obsolete
max_transaction_branches Obsolete
ogms_home Underscored
ops_admin_group Obsolete
ops_interconnects Obsolete
optimizer_percent_parallel Underscored
optimizer_search_limit Underscored
parallel_broadcast_enabled Underscored
parallel_default_max_instances Underscored
parallel_min_message_pool Underscored
parallel_server_idle_time Underscored
parallel_transaction_resource_timeout Obsolete
push_join_predicate Underscored
row_cache_cursors Underscored
sequence_cache_entries Obsolete
sequence_cache_hash_buckets Obsolete
shared_pool_reserved_min_alloc Underscored
snapshot_refresh_interval Obsolete
snapshot_refresh_keep_connections Obsolete
snapshot_refresh_processes Obsolete
sort_direct_writes Obsolete
sort_multiblock_read_count Underscored
sort_read_fac Obsolete
sort_spacemap_size Obsolete
sort_write_buffer_size Obsolete
sort_write_buffers Obsolete
spin_count Underscored
standby_preserves_names Obsolete
temporary_table_locks Obsolete
text_enable Obsolete
use_ism Underscored
79 rows selected.
SQL>
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Now that I’ve shown you ways to optimize the processes generally cannot read data directly from
performance of your Oracle databases using Oracle datafiles, which is why all data must first be read into
utilities, let’s see what you can do with the tuning this buffer cache.
tools available with SAP R/3.
When a user process requests a data block that is
already in the data buffer, it can be read without
having to access the disk again, assuming that the
block has not been changed since it was last read into
SAP/Oracle Database the buffer. This saves considerable processing time. In
Performance Monitor this situation, the user process has made a “hit” on
that data block. A user process request on a data block
The SAP/Oracle Database Performance Monitor
that is not in the data buffer is called a “miss.” The
shows the most important Oracle database perform-
relationship between hits and misses is known as the
ance indicators. To display the monitor, from the main
“hit ratio.” The hit ratio also can be thought of as the
SAP R/3 screen follow the menu path Tools →
quality of the database buffer cache.
Administration → Computing Center → Management
System → Control → Performance Menu → Database To improve performance of the database buffer
→ Activity, or use transaction ST04. cache, you may need to create multiple buffer pools.
Manually assign objects to the KEEP buffer pool if
The information on the main screen is subdivided they are likely to be reused. Assign them to the
into eight sections — Data buffer, Shared Pool, Log RECYCLE buffer pool if there is little chance of
buffer, Calls, Time statistics, Redo logging, Table scans reuse. Otherwise, they will automatically go to the
& fetches, and Sorts — which each contain various DEFAULT buffer pool. Objects in the KEEP buffer
subsections, as shown in Figure 2 on page 48. In the pool will be reused rather than reloaded from disk.
next sections, we will examine the most important
information sections and subsections on this screen. This SQL example specifies the INDEX Cust_idx
to be kept in the KEEP buffer pool at the time of
index creation by using the STORAGE clause:
Quality
Size
The data buffer quality indicates how successful the
Data buffer size is determined by the product of the Oracle RDBMS is at finding data blocks in memory
block size (Oracle parameter DB_BLOCK_SIZE) that have been requested by a database server process.
and the number of database block buffers (Oracle Every time this activity is successful, the quality
parameter DB_BLOCK_BUFFERS) specified in the improves, and every time it is not successful, the
quality degrades. SAP recommends that you maintain it might indicate excessive contention for this
a data buffer quality of at least 96%. particular class.
Parses The sum of the values for short and long tables
This field shows the total number of times an SQL gives the total number of full table scans performed
statement was parsed. To calculate the average parse since database instance startup. A high number of full
ratio, divide parses by user calls. If this ratio is above table scans on long tables might indicate missing table
25%, there may be a problem with retaining cursors in indexes. Check whether indexes are missing via the
the shared cursor cache. Check the hit rates discussed Missing Indexes button on the Tables and Indexes
in the shared SQL area statistics; it may be necessary screen (from the SAP R/3 main menu, choose Tools →
to increase the Oracle SHARED_POOL_SIZE Administration → Computing Center → Management
parameter. System → Control → Performance Menu → Database
→ Tables / Indexes, or use transaction DB02).
Database system
Refresh RSORATDB is started immediately to update all statistical data.
Checks Up-to-date statistics are created, and some statistics already generated with RSORATDB are
displayed. Details on extents and missing indexes are always up-to-date.
Space statistics Shows the history of the database size. These values are read from table MONI. Click on
Refresh if you require more up-to-date status data; this starts RSORATDB again. Use this
option only if necessary, as it can take considerable time to determine all the information
depending on the size of the database.
Tablespaces
Current sizes These details are determined during the last RSORATDB run.
Space statistics History of tablespace size. These values are read from table MONI.
Freespace statistics These details are determined during the last RSORATDB run.
Space critical objects These details are determined during the last RSORATDB run.
Space statistics History of table/index size. These values are read from table MONI.
Click on the Space critical objects button in the Tables ABAP Dictionary. To use this check, click on the
and indexes frame to search for tablespaces that are Checks button on the Tables and Indexes screen
too full.3 (Figure 4), which takes you to the Database
Checks screen (Figure 6).
Three different functions are provided for checking
tablespace data consistency between the ABAP • Missing unique indexes displays database tables
Dictionary and the database: without a unique index. To use this check, click
• Missing indexes displays indexes that are not on the Checks button on the Tables and Indexes
known in the database or ABAP Dictionary. To screen (Figure 4), which takes you to the Database
use this check, click on the Missing indexes Checks screen (Figure 6).
button on the Tables and Indexes screen (Figure 4). Check results are displayed in a top, middle, and
• Database <-> ABAP Dictionary checks the lowest hierarchy, as described in Figure 7.
existence of all database objects defined in the
Extents affect the way the tables and indexes are
growing, and they can pose performance issues. To
3
For more on handling tablespace freespace, see the article “Boost SAP
analyze the extent structure, click on Checks in the
R/3 Performance by Reorganizing Your Oracle Database: A Proven
Reorganization Strategy” in the July/August 2005 SAP Professional Database system section of the Tables and Indexes
Journal. screen (Figure 4), which takes you to the Database
Top Distinction between the objects defined in the ABAP Dictionary and the objects defined in the
database.
Middle Subdivision by object type (for example by table, view, or index) with the number of missing
objects displayed.
Checks screen (Figure 6). The Check for reorganiza- job. The MAXEXTENTS value for SAP objects
tions section provides the following options: is usually set to 300. This is a soft limit and not
necessarily what is allowed by Oracle. Any table
• Extents of tables and indexes displays all objects
or index whose MAXEXTENTS value comes
with more than 10 extents. Alongside the size of
close to this limit may result in a problem such as
the objects (in kilobytes and blocks), the number
abnormal transaction termination. The solution is
of used extents and the value defined for the object
to monitor and increase the MAXEXTENTS value
for MAXEXTENTS are displayed. The DBA
for the particular table or index. If you reach
should check these details regularly to avoid
the maximum value allowed by Oracle for the
possible problems with Maximum Number of
MAXEXTENTS, your only option is object
Extents. The value for the NEXT storage param-
reorganization.
eter is also listed. If you want, you can start a
detailed storage space analysis as a background • Extents per tablespace allows you to analyze the
extent structure for all tablespaces. In addition to reaching the limit for the number of extents set
this list output, a second overview displays all in the MAXEXTENTS parameter. You can also
tables and indexes with more than four extents. display a detailed history of an object (Figure 8)
Alongside the size of the objects (in kilobytes and by selecting the Detailed analysis button (on the
blocks), the number of used extents and the value DB02 transaction screen) in order to examine the
defined for the object for MAXEXTENTS are also selected tablespace in more detail.
displayed. If you want, you can start a detailed
storage space analysis as a background job.
• Check next extent size displays all objects that
have exhibited critical growth within the last four
weeks. This allows you to trace the growth in
number and size of extents. You can immediately Putting the database analysis
see the size of the first extent and the NEXT value
defined for the object. You will also find details on
techniques to use
how close the number of extents has come to Figure 9 gives you an idea of how much you can do
www.sappro.com