If a database is opened manually, the RCS process is started as part of the open
operation. If a database is opened automatically, the RCS, by default, is started
when a row cache is referenced for the first time.
When the last user disconnects from the database (with the database open setting
set to automatic) or when the database is closed manually, the RCS process
performs a final checkpoint to the database. When this operation completes, all
marked rows have been written back to the database. The RCS process writes
out its checkpoint information to indicate that backing files are no longer needed
if there is a need to recover from a node failure. At this time, the cache backing
files, if any, are deleted by default. If you want to preserve the backing files and
have them be reused at database startup, define the logical RDM$BIND_RCS_
KEEP_BACKING_FILES to ‘‘1’’.
Details of the RCS actions can be seen by creating an RCS process log file. Before
opening the database, define the RDM$BIND_RCS_LOG_FILE system logical
name to indicate the device, directory, and file name of the RCS process log file
you want to create. If no device and directory are specified, the RCS log file is
created in the same directory as that which contains the database root file.
A.1.5 Node and Process Failure Recovery
The following sections describe how the row cache feature interacts with node
and process failure recovery.
To understand how database recovery works with row caches, you should
understand the interactions that occur when writing to row caches, writing to
the recovery-unit journal (RUJ) files, and writing to the after-image journal (AIJ)
files. This interaction is identical to the interactions that occur among database
page buffers, RUJ journaling, and AIJ journaling. For more information, see the
Oracle Rdb Guide to Database Performance and Tuning.
The AIJ fast commit feature is a prerequisite for enabling row caching. This
means that updates to the database are not flushed back to the database pages
at the time a transaction is committed. In the case of row caching, the modified
rows reside in the in-memory row caches. However, all after-image (updated
rows) must be flushed to the AIJ file when the transaction is committed. In the
event of a failure, the committed, updated rows can be reapplied to the database
from the AIJ file.
Recovery-unit journaling is critical in ensuring that rows can be returned to their
previous state when either a SQL statement or transaction rolls back or aborts
abnormally. A row’s before-image must be preserved BEFORE any modification is
made to a row on a database page or in a row cache. Before-images are placed in
an in-memory RUJ buffer. Only when that buffer becomes full or when a modified
page or modified row cache entry is being put back must the RUJ information
first be synchronously written to the RUJ file. For a database without row caches,
this means the write IO to the RUJ file must be performed before a database page
containing a modified row can be written to disk.
With row caches, Oracle Rdb is frequently modifying only memory, not database
pages. The requirement for RUJ information being written BEFORE a
modification is put back into the row cache still exists. Writing synchronous
IOs to the RUJ before modifying in-memory row caches doesn’t make muct sense.
Oracle Rdb minimizes this behavior in two ways:
• A modification to a row cache entry is first done in a local copy. Only when
this local copy of the row must be flushed back to the row cache is the RUJ
information written out.
Implementing Row Cache A–5