Class SqlUtils
java.lang.Object
io.debezium.connector.oracle.logminer.SqlUtils
This utility class contains SQL statements to configure, manage and query Oracle LogMiner
todo handle INVALID file member (report somehow and continue to work with valid file), handle adding multiplexed files,
todo SELECT name, value FROM v$sysstat WHERE name = 'redo wastage';
todo SELECT GROUP#, STATUS, MEMBER FROM V$LOGFILE WHERE STATUS='INVALID'; (drop and recreate? or do it manually?)
todo table level supplemental logging
todo When you use the SKIP_CORRUPTION option to DBMS_LOGMNR.START_LOGMNR, any corruptions in the redo log files are skipped during select operations from the V$LOGMNR_CONTENTS view.
todo if file is compressed?
// For every corrupt redo record encountered,
// a row is returned that contains the value CORRUPTED_BLOCKS in the OPERATION column, 1343 in the STATUS column, and the number of blocks skipped in the INFO column.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringaddLogFileStatement(String option, String fileName) static StringallMinableLogsQuery(Scn scn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName) Obtain a query to fetch all available minable logs, both archive and online redo logs.(package private) static String(package private) static String(package private) static String(package private) static String(package private) static StringdeleteLogFileStatement(String fileName) static StringgetScnByTimeDeltaQuery(Scn scn, Duration duration) private static StringlocalArchiveLogDestinationsOnlyQuery(String archiveDestinationName) Returns a SQL predicate clause that should be applied to anyARCHIVED_LOG_VIEWqueries so that the results are filtered to only include the local destinations and not those that may be generated by tools such as Oracle Data Guard.static StringoldestFirstChangeQuery(Duration archiveLogRetention, String archiveDestinationName) (package private) static String(package private) static StringstartLogMinerStatement(Scn startScn, Scn endScn, OracleConnectorConfig.LogMiningStrategy strategy, boolean continuousMining) This returns statement to build LogMiner view for online redo log files(package private) static StringswitchHistoryQuery(String archiveDestinationName) (package private) static String
-
Field Details
-
DATABASE_VIEW
- See Also:
-
LOG_VIEW
- See Also:
-
LOGFILE_VIEW
- See Also:
-
ARCHIVED_LOG_VIEW
- See Also:
-
ARCHIVE_DEST_STATUS_VIEW
- See Also:
-
ALL_LOG_GROUPS
- See Also:
-
-
Constructor Details
-
SqlUtils
public SqlUtils()
-
-
Method Details
-
redoLogStatusQuery
-
switchHistoryQuery
-
currentRedoNameQuery
-
currentRedoLogSequenceQuery
-
databaseSupplementalLoggingAllCheckQuery
-
databaseSupplementalLoggingMinCheckQuery
-
tableSupplementalLoggingCheckQuery
-
oldestFirstChangeQuery
-
allMinableLogsQuery
public static String allMinableLogsQuery(Scn scn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName) Obtain a query to fetch all available minable logs, both archive and online redo logs.- Parameters:
scn- oldest system change number to search byarchiveLogRetention- duration archive logs will be minedarchiveLogOnlyMode- true if to only mine archive logs, false to mine all available logsarchiveDestinationName- configured archive log destination to use, may benull- Returns:
- the query string to obtain minable log files
-
localArchiveLogDestinationsOnlyQuery
Returns a SQL predicate clause that should be applied to anyARCHIVED_LOG_VIEWqueries so that the results are filtered to only include the local destinations and not those that may be generated by tools such as Oracle Data Guard.- Parameters:
archiveDestinationName- archive log destination to be used, may benullto auto-select
-
startLogMinerStatement
static String startLogMinerStatement(Scn startScn, Scn endScn, OracleConnectorConfig.LogMiningStrategy strategy, boolean continuousMining) This returns statement to build LogMiner view for online redo log files- Parameters:
startScn- mine fromendScn- mine tillstrategy- Log Mining strategycontinuousMining- whether to use continuous mining- Returns:
- statement todo: handle corruption. STATUS (Double) — value of 0 indicates it is executable
-
addLogFileStatement
-
deleteLogFileStatement
-
getScnByTimeDeltaQuery
-