Data available to apply sessions

The sessions used by APPLY can access various information pertaining to the data being applied. See also Triggers.

Oracle

On 10.2.0.5 and 11.2.0.2 and later, the session is marked as an APPLY session, so Oracle does not fire triggers that have trigger firing property set.

The DBRSAPPLY_PKG package is created in the Replicate schema (default: DBVREP) that has several global variables available to user conflict handlers, triggers etc.:

  • is_dbreplicate_session: set to true in APPLY session.
  • xid, sid, serial, cuser, luser, cliinfo, osuser, machine, osterm, osproc, osprog, scn, datetime: audit information from the source. Identical to values described in Event Streaming Real-Time Data Warehousing. By default, this is set on transaction start and before execution of PL/SQL conflict handler.

  • conflict_sqlerrm: error message of current conflict. Updated before execution of PL/SQL conflict handler.

MSSQL

Only flag to identify that the session was spawned by APPLY process is available: 

@is_dbreplicate_session is set to 1

MySQL

Only flag to identify that the session was spawned by APPLY process is available: 

context_info is set to 1