Fast Load like technology, T-PUMP like functionality
Support upto 5 populated tables
Tables may contain pre-existing data
It can populate both empty as well as populated tables
It neither supports table with secondary indexes nor referential intergrity
Ability to perform multiple maintenance operations with one pass of input files
Ability to perform conditional maintenance based on 'Apply' condition
Ability to do Insert, Update, delete and upserts
Each affected data blocks written only once
Host and Lan support
Full restart capability with log files,even AMP is down
Programmable error limits
Error reporting via error tables
INMOD support
Limitations
No retrieval capability (No select statment)
Concatenation of input files allowed
Host will not process arithmetic, aggregate or exponentiation function
Cannot process table defined with USI,
refrential integrity, join index, hash indexes or triggers
However NUSI & soft referential integrity are allowed
Import task require use of Index
Types of tasks
Import task
Upto 5 intermix of SQL/DML statements depends on 'APPLY' condition
It is always primary Index operation
Permits non-exclusive access to target tables from other users except during
Application Phase.
Phases
Preliminary phase
Basic Setup
Validate all statements
Start all sessions
#AMPS + 2 (handling SQL and loggine + alternate logging
Create work table
Create on each AMP for each target table
Create error table
2 error tables for each target table
Error table 1; Holds general error
Error table 2: For uniqueness violation
Create restart log
Apply locks to the table
Utility lock on table headers which disallows any DDL to the table
DML phase
Steps
Send prototype DML to the Teradata Database - Store DML steps in work tables
Add a USING modifier to the request - Host data to be filled in from input file
Add a “Match Tag” to the request - Allows link between DML and transaction records
Acquisition phase
Steps
Get the data from host
and apply it to appropriate
AMP worktables
-Duplicate “input records” record for each successful APPLY.
– Add “Match Tag” information to record.
– Make blocks and send “quickpath” to AMPs.
– Deblock and resend record to “correct” AMP.
Reblock and store
in worktable of target table
– Sort the reblocked records in the work tables.
– Sort by hash value and sequence to be applied.
Set up transition
to the Application
phase
– Upgrade locks on target tables to Write.
– Set table headers for Application phase.
– This is effectively the “point of no return”.
– There is no acquisition phase activity for a DELETE Task.
- Error goes to error tables
Application Phase
Execute MLOAD for each
target table as a single
multi-statement request
– End of host interaction until end of phase.
– AMPs independently apply changes to target tables.
– Executed as a single transaction without rollback.
– Restartable based on last checkpoint.
– No transient journal needed.
Error goes to application error table(Default name : UV_tablename)
End Phase (Cleanup)
Steps
Execute END MLOAD processing as a series of transactions performed by the host utility
– All locks are released.
– Table headers are restored across all AMPs.
– Dictionary cache of Target Tables is spoiled.
– Statistics are reported.
– Final Error Code is reported.
– Target tables are made available to other users.
– Work Tables are dropped.
– Empty Error Tables are dropped.
– Log Table is dropped (if Error Code = 0).
MLOAD Session Logoff:
– LOGOFF request is sent to each AMP with a session
Delete task
Execute single delete statement on single table
Advantages
Minimum use PE
Gets the input data to the AMP as quickly as possible
Uses multiple AMP sessions
Uses the parallelism of the amps to apply the changes
Keeps the BYNET activity low with AMP-Local processing
Avoid transient journaling overhead
Allows checkpoint and restartability even with down AMPs
Prevents lengthy rollback of aborted jobs
Allows for max access to the table during processing
Posts error to the special error tables
Provides extensive error statistics
Basic Mload statements
.LOGTABLE
Define restart log table
.LOGON
.BEGIN MLOAD TABLES
Tables which will participate in mload
.LAYOUT
.FIELD
.FILLER
.DML LABEL
.IMPORT INFILE --references the name of the input file.
FROM m FOR n --optionally defines starting # and ending #
THRU k -- of records to process from input file.
FORMAT --options – FASTLOAD
BINARY
TEXT
UNFORMAT
VARTEXT ‘,’
LAYOUT --references previously defined LAYOUT.
APPLY references LABEL to be applied and conditions under which to do so.