Class LogMinerQueryBuilder
java.lang.Object
io.debezium.connector.oracle.logminer.LogMinerQueryBuilder
A builder that is responsible for producing the query to be executed against the LogMiner view.
- Author:
- Chris Cranford
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classQuery helper to construct a SQL in-clauseprivate static classQuery helper to construct a SQL in-clause based a tuple of include/exclude value listsprivate static classQuery helper to construct an Oracle SQL REGEXP_LIKE list based on include/exclude value lists -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbuild(OracleConnectorConfig connectorConfig) Builds the LogMiner contents view query.private static Stringprivate static StringgetMultiTenantPredicate(OracleConnectorConfig connectorConfig) Get the multi-tenant predicate based on the configured pluggable database name.private static StringgetOperationCodePredicate(OracleConnectorConfig connectorConfig) Get the redo entry operation code predicate.private static StringgetSchemaNamePredicate(OracleConnectorConfig connectorConfig) Get the schema-based predicate.getSignalDataCollectionId(OracleConnectorConfig connectorConfig) private static StringgetTableNamePredicate(OracleConnectorConfig connectorConfig) private static StringgetUserNamePredicate(OracleConnectorConfig connectorConfig) Generate a username based predicate for include/exclude usernames.private static booleanmatches(Collection<Pattern> patterns, String searchValue) private static StringresolveExcludedSchemaPredicate(String fieldName) Resolve the built-in excluded schemas predicate.private static booleantableIncludeListContains(Collection<String> values, TableId searchValue) toUpperCase(Collection<String> values)
-
Field Details
-
EMPTY
- See Also:
-
LOGMNR_CONTENTS_VIEW
- See Also:
-
UNKNOWN_USERNAME
- See Also:
-
UNKNOWN_SCHEMA_NAME
- See Also:
-
UNKNOWN_TABLE_NAME_PREFIX
- See Also:
-
OPERATION_CODES_LOB
-
OPERATION_CODES_NO_LOB
-
-
Constructor Details
-
LogMinerQueryBuilder
public LogMinerQueryBuilder()
-
-
Method Details
-
build
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 benull- Returns:
- the SQL string to be used to fetch changes from Oracle LogMiner
-
getOperationCodePredicate
Get the redo entry operation code predicate.- Parameters:
connectorConfig- connector configuration, should not benull- Returns:
- operation code predicate, never
nullnorEMPTY.
-
getDdlPredicate
-
getMultiTenantPredicate
Get the multi-tenant predicate based on the configured pluggable database name.- Parameters:
connectorConfig- connector configuration, should not benull- Returns:
- multi-tenant predicate, may be an empty string if multi-tenancy is not enabled
-
getUserNamePredicate
Generate a username based predicate for include/exclude usernames.- Parameters:
connectorConfig- connector configuration, should not benull- Returns:
- the username predicate, may be an empty string if no predicate is generated
-
getSchemaNamePredicate
Get the schema-based predicate.- Parameters:
connectorConfig- connector configuration, should not benull- Returns:
- the schema predicate, may be an empty string if no predicate is generated
-
getTableNamePredicate
-
getSignalDataCollectionId
-
tableIncludeListContains
-
matches
-
resolveExcludedSchemaPredicate
Resolve the built-in excluded schemas predicate.- Parameters:
fieldName- the query field name the predicate applies to, should never benull- Returns:
- the predicate
-
getBuiltInExcludedSchemas
-
getTableIncludeExcludeListAsInValueList
-
toUpperCase
-