||Oracle Tips by Burleson
Oracle 10g Pre-Commit Handlers
With Oracle Database 10g, you can use a new type
of apply handler called pre-commit handler to record information
about commits processed by an apply process. This is an optional
handler that can help to record information about commits processed
by an APPLY process.
The APPLY process applies the captured or user-enqueued
events. For a captured row LCR, a commit directive contains the
commit SCN of the transaction from the source database, but for a
user-enqueued event, the commit SCN is generated by the apply
This handler is triggered when a commit LCR is
encountered by the apply process. The commit SCN within the commit
LCR is passed to the precommit handler. This allows you to perform
actions before the events associated with that LCR are committed or
to perform actions when all the user-enqueued messages in
transaction have been equeued.
For example, you may be using Streams within an
application that caches some information in memory, such as cursors,
temporary LOBs, or session information. By using a pre-commit
handler, you can create a procedure that releases the objects cached
during the length of the transaction.
You can associate a pre-commit handler with an
apply process, for this use the precommit_handler parameter in the
alter_apply or create_apply procedure of dbms_apply_adm. Here is an
example showing how to set the pre-commit handler for an apply
process named sales_apply to the audit_commit procedure in the
audit_commit(commit_number IN NUMBER) IS
info in the audit table
Get the complete story:
To get the code instantly, click here:
Need an Oracle Mentor?
BEI is now offering personal mentors for Oracle DBAs where you can have an
Oracle expert right at your fingertips, anytime day or night. We work with
hundreds of Oracle databases every year, so we know exactly how to quickly
assist you with any Oracle question.
Why risk an unplanned outage? You can now get telephone access to Don
Burleson or any of his Oracle Certified DBAs with more than 20 years of
full-time IT experience. Click here for details: