Oracle Bulkload
The Oracle Bulkload source reads all available data from multiple Oracle tables, then stops the flow. The source can use multiple threads to enable the parallel processing of data. For information about supported versions, see Supported systems and versions.
Use the Oracle Bulkload source to quickly read database tables, such as when you want to migrate tables to another database or system. You can use the source to read from static tables or non-static tables.
When you configure the Oracle Bulkload source, you specify connection information and the tables to read. You can also use a connection to configure the source.
You can configure advanced properties, such as the number of threads to use, the number of batches to include in each transaction request, and whether to consider the case of schemas and tables when executing queries.
By default, the source generates field attributes that provide additional information about each field.
The source can generate events for an event stream. For more information about dataflow triggers and the event framework, see Dataflow triggers overview.
Prerequisite
Before using the Oracle Bulkload source, install the Oracle JDBC driver for the database. The source cannot access the database until you install this driver.
- Download the Oracle JDBC driver from the Oracle website.Note: Writing XML data to Oracle requires installing the Oracle Data Integrator Driver for XML. For more information, see the Oracle documentation.
- Install the driver as an external library into the JDBC Oracle stage library,
streamsets-datacollector-jdbc-oracle-lib, which includes the source.
For information about installing additional drivers, see Install external libraries.
Static and non-static tables
You can use the Oracle Bulkload source to read static tables, tables that do not change while the flow runs, or to read non-static tables, tables that change while the source runs.
When using the source to read from non-static tables that might change as the flow runs, configure the stage to use isolation levels. With isolation levels enabled, the source uses the serializable isolation level and only reads changes committed when the flow starts. The source does not capture changes made to the table while the flow runs. Oracle consistency checks that occur with this isolation level can significantly reduce throughput in an environment with many concurrent transactions.
After using the source to migrate data from static tables, you can use a separate flow that includes the Oracle CDC or Oracle CDC Client source to process CDC data from LogMiner redo logs or the JDBC Multitable Consumer source to read data continuously from tables.
After using the source to migrate data from non-static tables, processing CDC data does not capture changes made while migrating data, resulting in loss of data. Therefore, processing CDC data is not recommended after using the source to migrate data from non-static tables.
Batch processing
Unlike most Data Collector sources, the Oracle Bulkload source performs batch processing only. After processing all data, the source stops the flow, rather than waiting for additional data as with streaming flows.
The Oracle Bulkload source does not maintain an offset during processing. Each time that you run a flow that includes the source, the source processes the available data in the specified tables. Then the source stops the flow gracefully, allowing processes to complete.
Schema and table names
When you configure the Oracle Bulkload source, you specify the tables that you want to read. To specify the tables, you define the schema and a table name pattern.
You can use SQL wildcards to define a set of tables within a schema or across multiple schemas.
sales schema that
start with SALES_. You can use the following configuration to specify
the tables to process: - Schema:
sales - Table Name Pattern:
SALES_%
You can configure the source to consider the case of schema and table names when executing queries.
Multithreaded processing
The Oracle Bulkload source performs parallel processing and enables the creation of a multithreaded flow.
When you start the flow, the Oracle Bulkload source retrieves the list of tables defined in the table configuration. The source then uses multiple concurrent threads for processing based on the Maximum Pool Size property on the Advanced tab.
As the flow runs, Oracle creates blocks of data in memory. The Oracle Bulkload source creates a task from a block of data and passes it to an available flow runner. The flow runner creates batches from the task for processing based on the maximum batch size configured for the source.
A flow runner is a sourceless flow instance - an instance of the flow that includes all of the processors, executors, and targets in the flow and handles all flow processing after the source. Each flow runner processes one batch at a time, just like a flow that runs on a single thread.
When tasks created from Oracle blocks are smaller than desired, like when they are smaller than the maximum batch size, you can configure the source to merge small tasks. Use the Minimum Task Size property on the Advanced tab to specify the minimum number of records to include in a task. When set, smaller tasks are merged to enable more efficient processing.
Multithreaded flows preserve the order of records within each batch, just like a single-threaded flow. But since tasks are processed by different flow runners, the order that batches are written to targets is not ensured.
For more information about multithreaded flows, see Multithreaded flow overview.
Field attributes
The Oracle Bulkload source generates field attributes for columns converted to the Decimal or Datetime data types in Data Collector. The attributes provide additional information about each field.
- The Oracle Number data type is converted to the Data Collector Decimal data type, which does not store scale and precision.
- The Oracle Timestamp data type is converted to the Data Collector Datetime data type, which does not store nanoseconds.
| Data Collector Data Type | Generated Field Attribute | Description |
|---|---|---|
| Decimal | precision | Provides the original precision for every number column. |
| Decimal | scale | Provides the original scale for every number column. |
| Datetime | nanoSeconds | Provides the original nanoseconds for every timestamp column. |
You can use the record:fieldAttribute or
record:fieldAttributeOrDefault functions to access the information
in the attributes. For more information about working with field attributes, see Field attributes.
Event generation
The Oracle Bulkload source can generate events that you can use in an event stream.
- With the Email executor to send a custom email
after receiving an event.
For an example, see Sending email during flow processing.
- With a target to store event information.
For an example, see Preserving an audit trail of events.
For more information about dataflow triggers and the event framework, see Dataflow triggers overview.
Event record
| Record Header Attribute | Description |
|---|---|
| sdc.event.type | Event type. Uses the following type:
|
| sdc.event.version | Integer that indicates the version of the event record type. |
| sdc.event.creation_timestamp | Epoch timestamp when the stage created the event. |
The Oracle Bulkload source can generate the following event record:
- table-finished
- The Oracle Bulkload source generates a table-finished event record when the source completes processing all data within a table.
Configuring an Oracle Bulkload source
Configure an Oracle Bulkload source to read data from one or more static database tables.
About this task
Before you use the source in a flow, complete the prerequisite task.