How Procedural Replication Works

Procedural replication executes your procedure call in the local database and queues a call to the procedure in all other master databases in the replication group, using whatever parameters you pass. This mechanism requires a “wrapper” procedure that calls the procedure that locally does the queueing. It also requires that the procedure be registered as a replicated object in all databases in the replication group.

As an example, suppose that we have a package procedure USER_ADMIN.CREATE_USER and a replicated wrapper package DEFER_USER_ADMIN. A call to the wrapper package results in the following chain of events:

  1. Call to DEFER_USER_ADMIN.CREATE_USER('SCOTT', ‘TIGER').

  2. DEFER_USER_ADMIN calls USER_ADMIN.CREATE_USER('SCOTT', ‘TIGER').

  3. Procedure USER_ADMIN.CREATE_USER executes locally.

  4. DEFER_USER_ADMIN builds a remote call to USER_ADMIN.CREATE_USER in other master databases in the same replication group. The remote call is placed in the deferred transaction queue.

  5. Procedure USER_ADMIN.CREATE_USER executes at remote databases.

Figure 14.1 depicts these events.

How procedural replication works

Figure 14-1. How procedural replication works

Get Oracle Distributed Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.