📅  最后修改于: 2023-12-03 15:05:33.693000             🧑  作者: Mango
Teradata MultiLoad is a powerful utility provided by Teradata Corporation for loading, updating, and deleting large volumes of data into Teradata Database tables. It is designed to handle high-volume batch loads efficiently and provides parallel data loading capabilities.
High-performance: Teradata MultiLoad leverages the parallel processing capabilities of Teradata Database to load, update, and delete data quickly and efficiently.
Robust and fault-tolerant: It offers features like restartability, checkpoints, and error logging to ensure data integrity and recoverability.
Multiple data operations: MultiLoad supports inserting, updating, deleting, and upserting (insert/update) operations on Teradata Database tables.
Data transformations: It provides support for various data transformations and manipulations, such as data type conversions, value mapping, and column splitting.
Error handling: MultiLoad includes error handling mechanisms to identify and handle erroneous data. It logs errors and continues processing valid data separately.
Parallelism: It distributes the data across multiple AMPs (Access Module Processors) in the Teradata Database, enabling parallel data loading and processing for improved performance.
Teradata MultiLoad follows a specific workflow to load, update, or delete data from Teradata Database tables:
Acquisition: The input data is acquired from external sources such as flat files or ODBC connections. MultiLoad supports various input data formats.
Preliminary Phase: MultiLoad performs preliminary tasks like logon, data definition, and error table setup. It builds the target table structure, defines the load and error tables, and establishes database connections.
DML Phase: In this phase, MultiLoad applies the data modifications like insert, update, or delete operations to the target table. It leverages Teradata parallelism to process data in parallel using multiple AMPs.
End Phase: The final phase involves the post-processing tasks like error handling, clean-up, and termination. MultiLoad logs error details, cleans up temporary objects, and releases database resources.
Teradata MultiLoad is typically used through its command-line interface or by scripting the commands in a file. Here's an example usage for loading data into a Teradata Database table:
1. Create a MultiLoad script file 'load_script.mload' with the following contents:
```
.LOGON tduser/tdpassword;
.BEGIN IMPORT MLOAD TABLES target_table;
.LAYOUT input_layout;
.FIELD field1 * INTEGER;
.FIELD field2 * VARCHAR(100);
.DML LABEL Insert_Label;
INSERT INTO target_table (:field1, :field2);
.IMPORT INFILE 'input_data.csv'
LAYOUT input_layout
APPLY Insert_Label;
.END MLOAD;
.LOGOFF;
```
2. Run the MultiLoad script using the command:
```
multiload < load_script.mload
```
This example demonstrates a simple data load scenario using MultiLoad, where data from an input file 'input_data.csv' is loaded into a target table in the Teradata Database.