Class LogMinerQueryBuilder

java.lang.Object
io.debezium.connector.oracle.logminer.LogMinerQueryBuilder

public class LogMinerQueryBuilder extends Object
A builder that is responsible for producing the query to be executed against the LogMiner view.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • LogMinerQueryBuilder

      public LogMinerQueryBuilder()
  • Method Details

    • build

      public static String build(OracleConnectorConfig connectorConfig)
      Builds the LogMiner contents view query. The returned query will contain 2 bind parameters that the caller is responsible for binding before executing the query. The first bind parameter is the lower-bounds of the SCN mining window that is not-inclusive while the second is the upper-bounds of the SCN mining window that is inclusive. The built query relies on the following columns from V$LOGMNR_CONTENTS:
           SCN - the system change number at which the change was made
           SQL_REDO - the reconstructed SQL statement that initiated the change
           OPERATION - the database operation type name
           OPERATION_CODE - the database operation numeric code
           TIMESTAMP - the time when the change event occurred
           XID - the transaction identifier the change participated in
           CSF - the continuation flag, identifies rows that should be processed together as single row, 0=no, 1=yes
           TABLE_NAME - the name of the table for which the change is for
           SEG_OWNER - the name of the schema for which the change is for
           USERNAME - the name of the database user that caused the change
           ROW_ID - the unique identifier of the row that the change is for, may not always be set with valid value
           ROLLBACK - the rollback flag, value of 0 or 1.  1 implies the row was rolled back
           RS_ID - the rollback segment idenifier where the change record was record from
       
      Parameters:
      connectorConfig - connector configuration, should not be null
      Returns:
      the SQL string to be used to fetch changes from Oracle LogMiner
    • resolveExcludedSchemaPredicate

      private static String resolveExcludedSchemaPredicate(String fieldName)
      Resolve the built-in excluded schemas predicate.
      Parameters:
      fieldName - the query field name the predicate applies to, should never be null
      Returns:
      the predicate