Professional Documents
Culture Documents
Oracle 11g New Tuning Features: Donald K. Burleson
Oracle 11g New Tuning Features: Donald K. Burleson
Oracle 11g New Tuning Features: Donald K. Burleson
Tuning Features
Donald K. Burleson
Burleson Oracle Consulting
About Don Burleson:
Chief Tech Officer – BC Remote DBA
Full-time DBA since 1983
Adjunct IT professor
Author of five Oracle Press books
www.guidehorse.org
On-site custom Oracle training
Oracle Tuning & Oracle RAC Support
Remote DBA Support
11g new tuning features:
Objects
– Table compression
– Function-based virtual columns
SQL & Optimizer
– Improved dbms_stats (extended stats)
– Real Application Testing (RAT)
Database workload replay
SQL Performance advisor
Instance management
– Automated Memory Management
– Instance caging
– Flash cache
11g compression
alter table
table_name
compress
for all operations;
How it works (source: Oracle)
"The algorithm works by eliminating duplicate
values within a database block, even across
multiple columns. Compressed blocks contain
a structure called a symbol table that
maintains compression metadata.
When a block is compressed, duplicate values
are eliminated by first adding a single copy of
the duplicate value to the symbol table. Each
duplicate value is then replaced by a short
reference to the appropriate entry in the
symbol table."
11g inline compression
Up to a 3x disk savings - Depending on the
nature of your data, Oracle compression will
result in huge savings on disk space.
Cheaper solid-state disk - Because
compressed tables reside on fewer disk
blocks, shops that might not otherwise be able
to afford solid-state flash disk can now enjoy
I/O speeds up to 300x faster than platter disk.
11g inline compression
Faster full scan/range scan operations -
Because tables will reside on less data
blocks, full table scans and index range scans
can retrieve the rows with less disk I/O.
Reduced network traffic - Because the data
blocks are compressed/decompressed only
within Oracle, the external network packets
will be significantly smaller.
Compression issues
Overhead at DML time - Whenever a SQL update,
insert of delete changes a data block in RAM, Oracle
must determine if the data block should be unlinked
from the freelist (this threshold is defined by the
PCTFREE parameter).
Compression on write - An outbound data block
must be compressed to fit into it's tertiary block size
(as defined by db_block_size and the tablespace
blocksize keyword). For example, an uncompressed
block in RAM might occupy up to 96k in RAM and be
compressed into it's tertiary disk blocksize of 32k
upon a physical disk write.
Compression issues
Decompress on read - At physical read time,
incoming disk blocks must be expanded once and
stored in the RAM data buffer. The exact mechanism
for this expansion is not published in the Oracle11g
documentation, but it's most likely a block versioning
scheme similar to the one used for maintaining read
consistency.
Increased likelihood of disk contention - Because
the data is tightly compressed on the data blocks,
more rows can be stored, thus increasing the
possibility of "hot" blocks on disk. Of course, using
large data buffers and/or solid-state disk (RAM-SAN)
will alleviate this issue.
Function-based virtual columns
2 – Next, we run
dbms_stats.create_extended_stats to relate
the columns together.
Extended stats
Below, we might create the column
histograms and column relationships where
the total_price column relates to the row
expression where total_price =
product_price+sales_tax:
Select
dbms_stats.create_extended_stats
(NULL, 'sales',
'(product_price+sales_tax)')
from dual;
CBO expression stats:
begin
dbms_stats.gather_table_stats (
ownname => 'SCOTT',
tabname => ‘SALES',
estimate_percent=> 100,
method_opt => 'FOR ALL COLUMNS SIZE
SKEWONLY FOR COLUMNS
(region_amt_sold)',
cascade => true
Database workload replay
Two components:
Upsides
– Keeps a “runaway instance” from hogging CPU
– Allows virtualization (processor affinity)
Downsides
– Does not affectively allow for sharing of
computing resources
– Does not fence RAM resources
Flash cache (re Oracle docs)
A flash cache is an extension of the database
buffer cache that lives on a flash disk, which is
a solid state storage device that uses flash
memory.
Without flash cache, the database re-uses
each clean buffer in main memory as needed,
overwriting it. If the overwritten buffer is
needed later, then the database must read it
from magnetic disk.
Flash cache (re Oracle)
bc oracle Forum
www.dba-oracle.com