Using the Commit Sequence Number

This appendix contains information about using the Oracle GoldenGate Commit Sequence Number (CSN) with Oracle and non-Oracle databases.

All database platforms except Oracle, Db2 LUW, and Db2 z/OS have fixed-length CSNs, which are padded with leading zeroes as required to fill the fixed length. CSNs that contain multiple fields can be padded within each field. For more information on CSN, see in Overview: Commit Sequence Number (CSN) in the Oracle GoldenGate Microservices guide.

MySQL does not create a transaction ID as part of its event data, so Oracle GoldenGate considers a unique transaction identifier to be a combination of the following:

  • the log file number of the log file that contains the START TRANSACTION record for the transaction that is being identified

  • the record offset of that record

Table 15-2 Oracle GoldenGate CSN Values Per Database

Database CSN Value

Db2 for i

sequence_number

Where:

  • sequence_number is the fixed-length, 20 digit, decimal-based Db2 for i journal sequence number.

Example:

12345678901234567890

Db2 LUW

LRI

Where:

For version 10.1 and later, LRI is a period-separated pair of numbers for the Db2 log record identifier.

Example:

123455.34645

Db2 z/OS

LSN

where:

  • LSN is, up to 20 hexadecimal digit representation of the 10 byte LSN in the transaction log.

    Note:

    Oracle GoldenGate uses LSN to represent both the non-data sharing LSN and data sharing LRSN as the format is same.

Example:

0x1A3367F6BA12289

MySQL

LogNum:LogPosition

Where:

  • LogNum is the the name of the log file that contains the START TRANSACTION record for the transaction that is being identified.

  • LogPosition is the event offset value of that record. Event offset values are stored in the record header section of a log record.

For example, if the log number is 12 and the log position is 121, the CSN is:

000012:000000000000121

MySQL (Group Replication)

SeqNum:GTID
In the preceding syntax:
  • SeqNum is the Oracle GoldenGate sequence number.

  • GTID the MySQL global transaction identifier.

For example, if the sequence number is 00000000000000000001 and the GTID is f77024f9-f4e3-11eb-a052-0021f6e03f10:0000000000000010654, then the CSN value is:
00000000000000000001:f77024f9-f4e3-11eb-a052-0021f6e03f10:0000000000000010654

Oracle

system_change_number

Where:

  • system_change number is the Oracle SCN value.

Example:

6488359

SQL Server

Can be any of these, depending on how the database returns it:

  • Colon separated hex string (8:8:4) padded with leading zeroes and 0X prefix

  • Colon separated decimal string (10:10:5) padded with leading zeroes

  • Colon separated hex string with 0X prefix and without leading zeroes

  • Colon separated decimal string without leading zeroes

  • Decimal string

Where:

  • The first value is the virtual log file number, the second is the segment number within the virtual log, and the third is the entry number.

Examples:

0X00000d7e:0000036b:01bd
0000003454:0000000875:00445
0Xd7e:36b:1bd
3454:875:445
3454000000087500445