The Apply process is an optional Oracle
background process. It dequeues the LCR(s) and user messages
from a destination queue. When the Apply process dequeues, the
events may be applied to database objects directly as
transactions or they may be passed on as parameters to user
defined procedures, which are also called user-defined Apply
handlers. The database changes may include the DML or DDL
Figure 5.1 Apply Process and Apply
As shown in Figure 5.1, Apply handlers
typically include Message handler, DML Handler, DDL Handler, and
Pre-Commit handlers. The following is a brief description of the
Message Handler Procedure: This is a
user-defined procedure that can process non-LCR user messages in
a customized way. A message handler for an Apply process can be
specified using the message_handler parameter in the create_apply or the
alter_apply procedure in the dbms_apply_adm package.
DML and DDL Handlers: This is a user
procedure that processes row LCRs resulting from DML
statements. It is called a DML handler. A user procedure that
processes DDL LCRs resulting from DDL statements is called a DDL
handler. An Apply process can have many DML handlers but only
one DDL handler. The DDL handler processes all DDL LCRs
dequeued by the Apply process. These handlers provide a
mechanism to use the LCR information and execute custom
operations on the database tables.
Pre-Commit Handler procedure: - This is a
user-defined PL/SQL procedure that can receive the commit
information for a transaction and process it in a customized
way. It can deal with LCRs and Messages. It helps track the
transactional history and helps in audit process.
More details and examples about the Apply
handlers will be presented in the next Chapter.