Skip to content
Permalink
Browse files

0003866: Support for oracle select hints to run parallel processes

during initial load extraction
  • Loading branch information...
jumpmind-josh committed Jan 29, 2019
1 parent ae60f82 commit 4456268b236e8de8b44c035b47b7eb937e33efa3
@@ -254,7 +254,7 @@ public OracleTriggerTemplate(ISymmetricDialect symmetricDialect) {
"end;\n");

sqlTemplates.put("initialLoadSqlTemplate" ,
"select $(oracleToClob)$(columns) from $(schemaName)$(tableName) t where $(whereClause)");
"select $(oracleQueryHint) $(oracleToClob)$(columns) from $(schemaName)$(tableName) t where $(whereClause)");
}

protected String getCreateTimeExpression(ISymmetricDialect symmetricDialect) {
@@ -237,6 +237,7 @@ private ParameterConstants() {
public final static String DBDIALECT_ORACLE_BULK_LOAD_SQLLDR_CMD = "oracle.bulk.load.sqlldr.cmd";
public final static String DBDIALECT_ORACLE_BULK_LOAD_SQLLDR_OPTIONS = "oracle.bulk.load.sqlldr.options";
public final static String DBDIALECT_ORACLE_BULK_LOAD_EZCONNECT = "oracle.bulk.load.ezconnect";
public final static String DBDIALECT_ORACLE_LOAD_QUERY_HINT_PARALLEL_COUNT = "oracle.load.query.hint.parallel.count";

public final static String DBDIALECT_TIBERO_USE_TRANSACTION_VIEW = "tibero.use.transaction.view";
public final static String DBDIALECT_TIBERO_TEMPLATE_NUMBER_SPEC = "tibero.template.precision";
@@ -257,7 +257,8 @@ public String createInitalLoadSql(Node node, TriggerRouter triggerRouter, Table
sql = FormatUtils.replace("prefixName", symmetricDialect.getTablePrefix(), sql);
sql = FormatUtils.replace("oracleToClob",
triggerRouter.getTrigger().isUseCaptureLobs() ? toClobExpression(table) : "", sql);

sql = replaceOracleQueryHint(sql);

return sql;
}

@@ -357,7 +358,8 @@ public String createCsvDataSql(Trigger trigger, TriggerHistory triggerHistory, T
sql = FormatUtils.replace("columns", columnsText, sql);
sql = FormatUtils.replace("oracleToClob",
trigger.isUseCaptureLobs() ? toClobExpression(table) : "", sql);

sql = replaceOracleQueryHint(sql);

sql = FormatUtils.replace("tableName", SymmetricUtils.quote(symmetricDialect, table.getName()), sql);
sql = FormatUtils.replace("schemaName",
triggerHistory == null ? getSourceTablePrefix(originalTable)
@@ -370,6 +372,8 @@ public String createCsvDataSql(Trigger trigger, TriggerHistory triggerHistory, T
table.hasPrimaryKey() ? table.getPrimaryKeyColumns() : table.getColumns()),
sql);

sql = replaceOracleQueryHint(sql);

sql = replaceDefaultSchemaAndCatalog(sql);

return sql;
@@ -386,6 +390,8 @@ public String createCsvPrimaryKeySql(Trigger trigger, TriggerHistory triggerHist
sql = FormatUtils.replace("columns", columnsText, sql);
sql = FormatUtils.replace("oracleToClob",
trigger.isUseCaptureLobs() ? toClobExpression(table) : "", sql);
sql = replaceOracleQueryHint(sql);

sql = FormatUtils.replace("tableName", SymmetricUtils.quote(symmetricDialect, table.getName()), sql);
sql = FormatUtils.replace("schemaName",
triggerHistory == null ? getSourceTablePrefix(table)
@@ -1197,4 +1203,11 @@ public int toHashedValue() {
}
return hashedValue;
}

public String replaceOracleQueryHint(String sql) {
return FormatUtils.replace("oracleQueryHint",
this.symmetricDialect.getParameterService().getInt(ParameterConstants.DBDIALECT_ORACLE_LOAD_QUERY_HINT_PARALLEL_COUNT) > 1 ?
"/*+ parallel(" + this.symmetricDialect.getParameterService()
.getString(ParameterConstants.DBDIALECT_ORACLE_LOAD_QUERY_HINT_PARALLEL_COUNT) + ") */": "", sql);
}
}
@@ -1627,6 +1627,12 @@ oracle.bulk.load.sqlldr.options=silent=(header,discards) direct=false readsize=4
# DatabaseOverridable: false
oracle.bulk.load.ezconnect=

# For initial load extracting data to specify the number of parallel processes to use while selecting data from a table
#
# Tags: other
# DatabaseOverridable: true
oracle.load.query.hint.parallel.count=1

# Path to the tbloader executable for running Tibero tbLoader.
# If blank, it will check for TB_HOME environment variable and find tbLoader there.
# Otherwise, it will run "tbloader" and expect the operating system to find it.

0 comments on commit 4456268

Please sign in to comment.
You can’t perform that action at this time.