| |
 |
|
Don't use the OPTIMAL Parameter
Oracle Tips by Burleson Consulting
Don Burleson
|
Don't use the OPTIMAL Parameter
Don Burleson
|
The Oracle
documentation on rollback segment rollback segment sizing is wrong in many
spots, especially regarding the OPTIMAL parameter. The OPTIMAL
parameter assumes growth, followed by a shrink. If the rollback
segment is sized properly, they should never grow. Hence, I do not
recommend using the OPTIMAL parameter. The "optimal" size of the
rollback segment occurs when you do not get “snapshot too old” errors, and
your rollback segment does not grow (it must then shrink later to OPTIMAL
size).
Here is the approach
that my consultants use to iteratively optimize the rollback segment size in
Oracle8i:
a) Create
multiple rollback segment, each rollback segment with 20 minextents and set
maxextents to 255. Also set INITIAL=NEXT=(your_optimal_size/20).
b)
Place each rollback
segment in its own tablespace. The tablespace should be able to
AUTOEXTEND ON.
c) Monitor
the growth of each rollback segment beyond 20 extents.
d) During
scheduled maintenance, manually take each rollback segment offline, drop the
rollback segment, and re-allocate with the right-sized datafile for 20
extents (based on historical growth in v$rollstat).
e) Large
batch update jobs (that may get ORA-01555 "snapshot too old" errors), can be
altered to use a single large rollback segment. The rollback segment
can be explicitly assigned with the "set transaction use rollback segment"
command.
Sizing the Rollback
Segments (rollback segment) is an iterative process and requires several
scheduled maintenance windows to re-size the rollback segment, based on the
DML load. The optimal rollback segment size is a function of system
update load (as determined by v$rollstat and v$transaction):
a)
The COMMIT frequency.
b)
The size of RAM log
buffers.
c)
Specific Oracle
parameters (log_buffer, db_writer_processes, log_checkpoint_interval).
d)
The size of the rollback
segment data files.
The total size of the
UNDO area for a specific transaction is as follows:
If the undo is 'x' bytes for 'n' number of rows then
T = x * (N / n) * 1.05
Where T = Approximate
Total undo for the transaction in bytes.
x = Undo for the individual transaction.
N = Total number of rows in the original table.
n = Total number of rows in the test table.
Optimal rollback
segment sizing is an iterative process, and is normally "tuned" over a
period of several weeks. Generally, we build spreadsheets to track
usage and determine the optimal size:
Many related topics
are covered in my upcoming new book Oracle Tuning: The Definitive Reference by Rampant TechPress. This book will be printed in
just a few weeks, and is available at this link:
http://www.rampant-books.com/book_1002_oracle_tuning_definitive_reference_2nd_ed.htm
|