1.13 Marker commands

Markers are records inserted into the audit trails and log trails to identify application-specific events during Extract and Replicat processing.

For example, to switch from a primary to a backup database, you must determine that all records have been delivered from the primary to the backup database before switching. Markers provide a method for determining this without shutting down all TMF-related activity on the source node.

To determine that all records have been delivered, perform the following tasks:

  1. Shut down application activity against the source database (for example, bring down PATHWAY).

  2. Add a marker to the audit trail.

  3. Wait until the corresponding Replicat process writes an event message indicating that it processed the marker. At this point, Replicat has processed all data from the source database and you can safely switch to the backup database.

Event messages and history records are written each time a marker is processed by GGSCI, Extract, or Replicat.

1.13.1 ADD MARKER

You can add markers:

  • For TMF installations

  • For non-TMF installations

  • Executing TACL commands

  • For a Replicat group

Default

By default, Oracle GoldenGate applies markers to the TMF audit trail.

Syntax

ADD MARKER 
[LOGGER logger_prefix] [freeform_text] |
[TACLCMD program group_name command] |
[GROUPCMD] program group_name command ]
LOGGER logger_prefix freeform_text

See "Adding markers for TMF or non-TMF installations" for information on adding markers for TMF and non-TMF installations

TACLCMD program group_name command

See "Invoking TACL commands" for information on executing TACL commands.

GROUPCMD program group_name command

See "Adding markers for an Extract or Replicat group".

Adding markers for TMF or non-TMF installations

For TMF installations, ADD MARKER creates a marker in the local audit trail. For non-TMF installations, specify ADD MARKER with the LOGGER option.

Default

By default, Oracle GoldenGate applies markers to the TMF audit trail.

Syntax

ADD MARKER [LOGGER logger_prefix] [freeform_text]
LOGGER logger_prefix

Required to send markers to Logger processes and associated log trails. Identifies the Logger process group or an individual Logger process within a group. For example, ADD MARKER LOGGER $GGL specifies the Logger group and sends a marker to all processes beginning with $GGL. The command: ADD MARKER LOGGER $GGL01, sends a marker to the logger $GGL01.

freeform_text

Text you want added to the marker record to distinguish the purpose of the marker, as in:

ADD MARKER BROUGHT DOWN FINANCE
ADD MARKER LOGGER $GGL END OF DAY 2010-07-30

Invoking TACL commands

A special form of marker invokes TACL commands through Extract or Replicat. This lets you fit TACL commands into a stream of database activity. The command is carried out when Extract or Replicat encounters the marker record in the data stream.

Extract or Replicat end abnormally if encountering a problem issuing the command, but will not ABEND if the command itself fails. While the command runs, Extract or Replicat waits until it finishes. Specify NOWAIT as part of the command to return control immediately.

Syntax

ADD MARKER [LOGGER logger_prefix] 
TACLCMD program group_name command
LOGGER logger_prefix

Required to send markers to Logger processes and associated log trails. Identifies the Logger process group or an individual Logger process within a group. For example, ADD MARKER LOGGER $GGL specifies the Logger group and sends a marker to all processes beginning with $GGL. The command: ADD MARKER LOGGER $GGL01, sends a marker to the Logger $GGL01.

TACLCMD program group_name command

The TACLCMD keyword informs the process that a TACL command is to be carried out. TACLCMD must include the following:

program

Either EXTRACT or REPLICAT. This determines which program runs the command.

group_name

The group name to run the command. You can specify a wildcard.

command

The TACL command to invoke. This can be the name of a program, a macro or any command that can be executed from TACL.

Example

In this example, TACLCMD specifies that the command is to be invoked by Extract for the FINANCE group. The command is: FUP PURGEDATA $DATA1.DAT.FILE1

ADD MARKER TACLCMD EXTRACT FINANCE FUP PURGEDATA $DATA1.DAT.FILE1

Adding markers for an Extract or Replicat group

You can use markers to send a command to an Extract or Replicat group.

Syntax

ADD MARKER GROUPCMD program group_name command
GROUPCMD program group_name command

The GROUPCMD keyword informs the process that a group command is to be invoked.

program

Enter Extract or Replicat.

group_name

Enter the Extract or Replicat group name.

command

Enter the command. Currently, CLOSEFILES is the only command available for GROUPCMD. CLOSEFILES instructs Replicat to close all opens on Enscribe files and SQL tables. It instructs Extract to close opens from FETCHCOMPS and FETCHLASTIMAGE.

1.13.2 INFO MARKER

Use INFO MARKER to review recently processed markers. A record is displayed for each occasion on which GGSCI, Logger, Extract or Replicat processed the marker.

Syntax

INFO MARKER [COUNT num_items]
COUNT num_items

Specify COUNT to restrict the list to the most recent number of items, as in: INFO MARKER COUNT 2.

Information returned includes:

PROCESSED

The local time that a program processed the marker.

ADDED

The local time at which the marker was inserted into the audit trails or log trails.

DIFF

The time difference between PROCESSED and ADDED. DIFF can serve as an indicator of the lag between application, Extract, and Replicat activities.

PROG

The process that processed the marker, such as GGSCI, Logger, Extract or Replicat.

GROUP

The Extract or Replicat group or Logger process that processed the marker. N/A is displayed if GGSCI processed the marker.

NODE

The node at which the marker was inserted into the audit trails.

Optional text

The free text you entered in the ADD MARKER command.