0% found this document useful (0 votes)
8 views

MultiLoad General Code

Uploaded by

Ravi S
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

MultiLoad General Code

Uploaded by

Ravi S
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 55

Teradata Utility Error Handling - Multiload

Top of Form

Bottom of Form

Article by cjdewey on 01 Feb 2010 0 comments

Tags:

error handling

high availability

MultiLoad

The Teradata Multiload utility provides the capability to perform batch


maintenance on tables (insert, update, delete and upsert). It loads data
from external sources and provides the capability to restart jobs interrupted
by errors, exceptions and failures.

A Multiload job executes in 5 phases:

1. Preliminary

Parses and validates all of the MultiLoad commands and Tera-data SQL
statements in your MultiLoad job

Establishes sessions and process control with the Teradata Database

Submits special Teradata SQL requests to the Teradata Data-base

Creates and protects temporary work tables and error tables in the Teradata
Database

2. DML Transaction

Submits the DML statements specifying the insert, update, and delete tasks
to the Teradata Database
3. Acquisition

Imports data from the specified input data source

Evaluates each record according to specified application con-ditions

Loads the selected records into the worktables in the Tera-data Database

There is no acquisition phase activity for a MultiLoad delete task.

4. Application

Acquires locks on the specified target tables and views in the Teradata
Database

For an import task, inserts the data from the temporary work tables into the
target tables or views in the Teradata Data-base

For a delete task, deletes the specified rows from the target table in the
Teradata Database

Updates the error tables associated with each MultiLoad task

5. Cleanup

Forces an automatic restart/rebuild if an AMP went offline and came back


online during the application phase

Releases all locks on the target tables and views

Drops the temporary work tables and all empty error tables from the
Teradata Database

Reports the transaction statistics associated with the import and delete
tasks.

Multiload returns the returns codes described previously (0, 4, 8, 12) to the
operating system or calling program.

Restarts

It is possible to restart a Multiload job in any of the phases after an er-ror or


failure has interrupted an executing Multiload job. There are differences in
the restart procedures in some of the phases that will be described. It is also
possible to rerun an interrupted Multiload job in some of the phases which
will also be discussed.

A Multiload job creates a restart log table that must be present for a job to
be restarted and must be dropped before a job can be rerun. It creates a
work table for each input source. These tables must be pre-sent for a job to
restart and must be dropped to rerun a job. Multiload also creates two error
tables for each target table that must be present for a restart and that must
be dropped to rerun a Multiload job.

A Multiload job can not be restarted or rerun if these tables are not present
for an interruption that occurs during the APPLICATION PHASE.

Checkpoint frequency can be set for checkpoint to occur after a num-ber of


records have been read from an input source. The checkpoints are taken
during the acquisition phase. A restart after an interruption in the acquisition
phase will start reading the input source at the point following the last
checkpoint executed before the interruption.

Interruptions that occur during the application phase will be restarted based
on internal checkpoints created by the database.

The following is a simple Multiload script that will be use to illustrate the
Multiload restart capabilities.

Code

1 .logtable test.tranmllog;

2 .LOGON test/testuser,test;

4 .begin import

5 mload tables test.tran

6 checkpoint 20000;

8 .layout tranlayout;
9 .FIELD STORE * varchar(10);

10 .field TRAN_NO * varchar (10);

11 .field TRAN_DATE * varchar (10);

12 .field TRAN_TIME * varchar (10);

13 .field TRAN_TYPE * varchar (1);

14 .field TRAN_TERMINAL * varchar (3);

15 .field CLERK * varchar (10);

16 .field CUST_NO * varchar (10);

17 .field NAME * varchar (30);

18 .field TOTAL_SALE * varchar (14);

19 .field SALES_TAX * varchar (14);

20 .field DISCOUNT * varchar (14);

21 .field DISC_PCT * varchar (10);

22 .field DISC_TAKEN_FLAG * varchar (1);

23 .field CASH_TENDERED * varchar (14);

24 .field CHANGE_GIVEN * varchar (14);

25 .field CHARGE_TENDERED* varchar (14);

26 .field CHECK_NUMBER * varchar (20);

27 .field CHECK_TENDERED * varchar (14);

28 .field BANKCARD_TENDERED * varchar (14);

29 .field PURCHASE_ORDER_NUM * varchar (20);

30

31.dml label insdml;

32insert into test.tran.*;


33

34.import infile C:\DataIntegration\Data\TRAN2.DAT

35 format vartext '|'

36 layout tranlayout

37 apply insdml;

38.end mload;

39.logoff;

This script inserts rows into one table, “TRAN”. It set a checkpoint every
20000 input records.

Restart after database reset

The following is an example of an automatic restart that occurs for an


interruption and reset that occurred during the acquisition phase.

Code

1 C:\DataIntegration\Scripts>mload -b < tran.ml

2 **** 22:11:09 UTY2414 BRIEF option is enabled.

3 ============================================
============================
4
= MultiLoad Utility Release MLOD.13.00.00.000 =
5
= Platform WIN32 =
6
============================================
7
============================
8
= Copyright 1990-2009, Teradata Corporation. ALL RIGHTS
9 RESERVED. =

1 ============================================
0 ============================
1 **** 22:11:09 UTY2411 Processing start date: SUN AUG 09, 2009
1
============================================
1 ============================
2
= Logon/Connection =
1
============================================
3
============================
1
0001 .logtable test.tranmllog;
4
0002 .LOGON test/testuser,;
1
5 **** 22:11:11 UTY8400 Teradata Database Release: 12.00.01.24

1 **** 22:11:11 UTY8400 Teradata Database Version: 12.00.01.24


6
**** 22:11:11 UTY8400 Default character set: ASCII
1
7 **** 22:11:11 UTY8400 Current RDBMS has interval support

1 **** 22:11:11 UTY8400 Current RDBMS has UDT support


8
**** 22:11:11 UTY8400 Maximum supported buffer size: 1M
1
**** 22:11:11 UTY8400 Data Encryption supported by RDBMS server
9
**** 22:11:12 UTY6211 A successful connect was made to the RDBMS.
2
0 **** 22:11:12 UTY6217 Logtable 'test.tranmllog' has been created.

2
1
0003 .begin import
2
mload tables test.tran
2
checkpoint 20000;
2
3 ============================================
============================
2
4 = Processing MultiLoad Statements =
2 ============================================
5 ============================
2
6
0004 .layout tranlayout;
2
0005 .FIELD STORE * varchar(10);
7
0006 .field TRAN_NO * varchar (10);
2
8 0007 .field TRAN_DATE * varchar (10);
2 0008 .field TRAN_TIME * varchar (10);
9
0009 .field TRAN_TYPE * varchar (1);
3
0 0010 .field TRAN_TERMINAL * varchar (3);

3 0011 .field CLERK * varchar (10);


1
0012 .field CUST_NO * varchar (10);
3
0013 .field NAME * varchar (30);
2
0014 .field TOTAL_SALE * varchar (14);
3
3 0015 .field SALES_TAX * varchar (14);

3 0016 .field DISCOUNT * varchar (14);


4
0017 .field DISC_PCT * varchar (10);
3
0018 .field DISC_TAKEN_FLAG * varchar (1);
5
0019 .field CASH_TENDERED * varchar (14);
3
6 0020 .field CHANGE_GIVEN * varchar (14);
3 0021 .field CHARGE_TENDERED* varchar (14);
7
0022 .field CHECK_NUMBER * varchar (20);
3
8 0023 .field CHECK_TENDERED * varchar (14);

3 0024 .field BANKCARD_TENDERED * varchar (14);


9
0025 .field PURCHASE_ORDER_NUM * varchar (20);
4
0 0026 .dml label insdml;

4 0027 insert into test.tran.*;


1

4
0028 .import infile C:\DataIntegration\Data\TRAN2.DAT
2
format vartext '|'
4
3 layout tranlayout
4 apply insdml;
4
0029 .end mload;
4
5 ============================================
============================
4
6 = MultiLoad Initial Phase =

4 ============================================
7 ============================

4 **** 22:11:12 UTY0829 Options in effect for this MultiLoad import task:
8
. Sessions: One session per available amp.
4
. Checkpoint: 20000 records.
9
. Tenacity: 4 hour limit to successfully connect load sessions.
5
0 . Errlimit: No limit in effect.

5 . AmpCheck: In effect for apply phase transitions.


1
**** 22:11:13 UTY0815 MLOAD session(s) connected: 2.
5
============================================
2
============================
5
= MultiLoad Acquisition Phase =
3
============================================
5
============================
4
**** 22:11:16 UTY1812 A checkpoint is being initiated because 20000
5 output recor
5
ds have been
5
sent to the RDBMS.
6
**** 22:11:17 UTY0827 A checkpoint has been taken, recording that
5
input record 2
7
0000 has been
5
8 processed for IMPORT 1 of this MultiLoad Import task.
5 **** 22:11:17 UTY1812 A checkpoint is being initiated because 40000
9 output recor

6 ds have been
0
sent to the RDBMS.
6
1 **** 22:11:43 UTY0817 MultiLoad submitting the following request:

6 CHECKPOINT LOADING INTERVAL 2;


2
**** 22:11:43 UTY0806 RDBMS error, 2825: NO RECORD OF THE LAST
6 REQUEST WAS FOUND
3
AFTER DBC
6
RESTART
4
**** 22:11:43 UTY1804 Re-starting this MultiLoad task because The
6
RDBMS crashed.
5

6
6 ============================================
============================
6
7 = MultiLoad Initial Phase =

6 ============================================
8 ============================

6 **** 22:11:43 UTY0829 Options in effect for this MultiLoad import task:
9
7 . Sessions: One session per available amp.
0
. Checkpoint: 20000 records.
7
. Tenacity: 4 hour limit to successfully connect load sessions.
1
. Errlimit: No limit in effect.
7
2 . AmpCheck: In effect for apply phase transitions.
7 **** 22:11:44 UTY0815 MLOAD session(s) connected: 2.
3
============================================
7 ============================
4
= MultiLoad Acquisition Phase =
7
5 ============================================
============================
7
6 **** 22:11:46 UTY1806 This MultiLoad Import task is re-starting from
checkpoint
7
7 taken at

7 record 20000 of IMPORT 1.


8
**** 22:11:47 UTY1812 A checkpoint is being initiated because 40000
7 output recor
9
ds have been
8
sent to the RDBMS.
0
**** 22:11:48 UTY0827 A checkpoint has been taken, recording that
8
input record 4
1
0000 has been
8
2 processed for IMPORT 1 of this MultiLoad Import task.

8 **** 22:11:49 UTY1812 A checkpoint is being initiated because 60000


3 output recor

8 ds have been
4
8 sent to the RDBMS.
5
**** 22:11:50 UTY0827 A checkpoint has been taken, recording that
8 input record 6
6
0000 has been
8
processed for IMPORT 1 of this MultiLoad Import task.
7
**** 22:11:51 UTY0826 A checkpoint has been taken, recording that end
8
of file ha
8
s been reached
8
9 for IMPORT 1 of this MultiLoad Import task.
9 **** 22:11:51 UTY1803 Import processing statistics
0
. IMPORT 1 Total thus far
9
1 . ========= ==============

9 Candidate records considered:........ 67817....... 67817


2
Apply conditions satisfied:.......... 67817....... 67817
9
Candidate records not applied:....... 0....... 0
3
Candidate records rejected:.......... 0....... 0
9
4 ============================================
============================
9
5 = MultiLoad Application Phase =

9 ============================================
6 ============================

9 **** 22:12:10 UTY0818 Statistics for table test.tran:


7
Inserts: 67817
9
Updates: 0
8
Deletes: 0
9
9 ============================================
1 ============================
0
= MultiLoad Task Cleanup =
0
============================================
1
============================
0
1 **** 22:12:10 UTY0821 Error table test.ET_tran is EMPTY, dropping
table.
1
0 **** 22:12:11 UTY0821 Error table test.UV_tran is EMPTY, dropping
2 table.

1 **** 22:12:11 UTY0825 Error table statistics for:


0
3

1 Target table 1: test.tran


0
Number of Rows Error Table Name
4
==============
1
==============================================
0
==========
5
0 test.ET_tran
1
0 0 test.UV_tran
6

1
**** 22:12:12 UTY0822 MultiLoad processing complete for this MultiLoad
0
import ta
7
sk.
1
0 ============================================
8 ============================

1 = MultiLoad Task Complete =


0
9 ============================================
============================
1
1
0 0030 .logoff;

1 ============================================
1 ============================
1
= Logoff/Disconnect =
1
============================================
1
============================
2
**** 22:12:12 UTY6216 The restart log table has been dropped.
1
1 **** 22:12:12 UTY6212 A successful disconnect was made from the
3 RDBMS.

1 **** 22:12:12 UTY2410 Total processor time used = '1.625 Seconds'


1
4 . Start : 22:11:09 - SUN AUG 09, 2009

1 . End : 22:12:12 - SUN AUG 09, 2009


1
. Highest return code encountered = '0'.
5

1
1
6

1
1
7

1
1
8

1
1
9

1
2
0

1
2
1

1
2
2

1
2
3

1
2
4

1
2
5

1
2
6

1
2
7

1
2
8

1
2
9

1
3
0

1
3
1
1
3
2

1
3
3

1
3
4

1
3
5

1
3
6

1
3
7

1
3
8

1
3
9

1
4
0

1
4
1

1
4
2

1
4
3

1
4
4

1
4
5

1
4
6

1
4
7

1
4
8

1
4
9

1
5
0

1
5
1

1
5
2

1
5
3

1
5
4

1
5
5

1
5
6

1
5
7

1
5
8

1
5
9

1
6
0

1
6
1

1
6
2

1
6
3
1
6
4

1
6
5

An automatic restart may also occur if an interruption occurs during the


application phase. The following output illustrates this type of re-start.

code

1 C:\DataIntegration\Scripts>mload -b < tran.ml

2 **** 22:22:57 UTY2414 BRIEF option is enabled.

3 ============================================
============================
4
= MultiLoad Utility Release MLOD.13.00.00.000 =
5
= Platform WIN32 =
6
============================================
7
============================
8
= Copyright 1990-2009, Teradata Corporation. ALL RIGHTS
9 RESERVED. =

1 ============================================
0 ============================

1 **** 22:22:57 UTY2411 Processing start date: SUN AUG 09, 2009
1
============================================
1 ============================
2
= Logon/Connection =
1
============================================
3
============================
1
4 0001 .logtable test.tranmllog;

1 0002 .LOGON test/testuser,;


5
**** 22:23:00 UTY8400 Teradata Database Release: 12.00.01.24
1
**** 22:23:00 UTY8400 Teradata Database Version: 12.00.01.24
6
**** 22:23:00 UTY8400 Default character set: ASCII
1
7 **** 22:23:00 UTY8400 Current RDBMS has interval support

1 **** 22:23:00 UTY8400 Current RDBMS has UDT support


8
**** 22:23:00 UTY8400 Maximum supported buffer size: 1M
1
9 **** 22:23:00 UTY8400 Data Encryption supported by RDBMS server

2 **** 22:23:00 UTY6211 A successful connect was made to the RDBMS.


0
**** 22:23:00 UTY6217 Logtable 'test.tranmllog' has been created.
2
1
0003 .begin import
2
2 mload tables test.tran

2 checkpoint 20000;
3
============================================
2 ============================
4
= Processing MultiLoad Statements =
2
============================================
5
============================
2
6
0004 .layout tranlayout;
2
7 0005 .FIELD STORE * varchar(10);
2 0006 .field TRAN_NO * varchar (10);
8
2 0007 .field TRAN_DATE * varchar (10);
9
0008 .field TRAN_TIME * varchar (10);
3
0009 .field TRAN_TYPE * varchar (1);
0
0010 .field TRAN_TERMINAL * varchar (3);
3
1 0011 .field CLERK * varchar (10);
3 0012 .field CUST_NO * varchar (10);
2
0013 .field NAME * varchar (30);
3
3 0014 .field TOTAL_SALE * varchar (14);

3 0015 .field SALES_TAX * varchar (14);


4
0016 .field DISCOUNT * varchar (14);
3
0017 .field DISC_PCT * varchar (10);
5
0018 .field DISC_TAKEN_FLAG * varchar (1);
3
6 0019 .field CASH_TENDERED * varchar (14);

3 0020 .field CHANGE_GIVEN * varchar (14);


7
0021 .field CHARGE_TENDERED* varchar (14);
3
0022 .field CHECK_NUMBER * varchar (20);
8
0023 .field CHECK_TENDERED * varchar (14);
3
9 0024 .field BANKCARD_TENDERED * varchar (14);
4 0025 .field PURCHASE_ORDER_NUM * varchar (20);
0

4
1 0026 .dml label insdml;

4 0027 insert into test.tran.*;


2

4
0028 .import infile C:\DataIntegration\Data\TRAN2.DAT
3 format vartext '|'

4 layout tranlayout
4
apply insdml;
4
0029 .end mload;
5
============================================
4
============================
6
= MultiLoad Initial Phase =
4
7 ============================================
============================
4
8 **** 22:23:00 UTY0829 Options in effect for this MultiLoad import task:

4 . Sessions: One session per available amp.


9
. Checkpoint: 20000 records.
5
0 . Tenacity: 4 hour limit to successfully connect load sessions.

5 . Errlimit: No limit in effect.


1
. AmpCheck: In effect for apply phase transitions.
5
**** 22:23:01 UTY0815 MLOAD session(s) connected: 2.
2
============================================
5
============================
3
= MultiLoad Acquisition Phase =
5
4 ============================================
============================
5
5 **** 22:23:04 UTY1812 A checkpoint is being initiated because 20000
output recor
5
6 ds have been

5 sent to the RDBMS.


7
**** 22:23:05 UTY0827 A checkpoint has been taken, recording that
5 input record 2
8
0000 has been
5
processed for IMPORT 1 of this MultiLoad Import task.
9
**** 22:23:06 UTY1812 A checkpoint is being initiated because 40000
6
output recor
0
ds have been
6
1 sent to the RDBMS.
6 **** 22:23:07 UTY0827 A checkpoint has been taken, recording that
2 input record 4

6 0000 has been


3
processed for IMPORT 1 of this MultiLoad Import task.
6
4 **** 22:23:07 UTY1812 A checkpoint is being initiated because 60000
output recor
6
5 ds have been

6 sent to the RDBMS.


6
**** 22:23:08 UTY0827 A checkpoint has been taken, recording that
6 input record 6
7
0000 has been
6
processed for IMPORT 1 of this MultiLoad Import task.
8
**** 22:23:10 UTY0826 A checkpoint has been taken, recording that end
6
of file ha
9
s been reached
7
0 for IMPORT 1 of this MultiLoad Import task.

7 **** 22:23:10 UTY1803 Import processing statistics


1
. IMPORT 1 Total thus far
7
. ========= ==============
2 Candidate records considered:........ 67817....... 67817

7 Apply conditions satisfied:.......... 67817....... 67817


3
Candidate records not applied:....... 0....... 0
7
Candidate records rejected:.......... 0....... 0
4
============================================
7
============================
5
= MultiLoad Application Phase =
7
6 ============================================
============================
7
7 **** 22:24:19 UTY0817 MultiLoad submitting the following request:

7 EXEC MLOAD test.tran;


8
**** 22:24:19 UTY0805 RDBMS failure, 2828: Request was rolled back
7 during system
9
recovery.
8
0 **** 22:24:19 UTY1804 Re-starting this MultiLoad task because The
RDBMS crashed.
8
1

8 ============================================
2 ============================

8 = MultiLoad Initial Phase =


3
============================================
8 ============================
4
**** 22:24:19 UTY0829 Options in effect for this MultiLoad import task:
8
. Sessions: One session per available amp.
5
. Checkpoint: 20000 records.
8
6 . Tenacity: 4 hour limit to successfully connect load sessions.
8 . Errlimit: No limit in effect.
7
. AmpCheck: In effect for apply phase transitions.
8
**** 22:24:20 UTY0815 MLOAD session(s) connected: 2.
8
============================================
8
============================
9
= MultiLoad Application Phase =
9
0 ============================================
============================
9
1 **** 22:24:27 UTY0818 Statistics for table test.tran:

9 Inserts: 67817
2
Updates: 0
9
3 Deletes: 0

9 ============================================
4 ============================

9 = MultiLoad Task Cleanup =


5
============================================
9 ============================
6
**** 22:24:27 UTY0821 Error table test.ET_tran is EMPTY, dropping
9 table.
7
**** 22:24:27 UTY0821 Error table test.UV_tran is EMPTY, dropping
9 table.
8
**** 22:24:27 UTY0825 Error table statistics for:
9
9
Target table 1: test.tran
1
0 Number of Rows Error Table Name
0
==============
1 ==============================================
0 ==========
1
0 test.ET_tran
1
0 test.UV_tran
0
2

1 **** 22:24:28 UTY0822 MultiLoad processing complete for this MultiLoad


0 import ta
3
sk.
1
0 ============================================
4 ============================

1 = MultiLoad Task Complete =


0
============================================
5
============================
1
0
6 0030 .logoff;

1 ============================================
0 ============================
7
= Logoff/Disconnect =
1
============================================
0
============================
8
**** 22:24:29 UTY6216 The restart log table has been dropped.
1
0 **** 22:24:29 UTY6212 A successful disconnect was made from the
9 RDBMS.

1 **** 22:24:29 UTY2410 Total processor time used = '1.70313 Seconds'


1
0 . Start : 22:22:57 - SUN AUG 09, 2009

1 . End : 22:24:29 - SUN AUG 09, 2009


1
. Highest return code encountered = '0'.
1
1
1
2

1
1
3

1
1
4

1
1
5

1
1
6

1
1
7

1
1
8

1
1
9

1
2
0

1
2
1

1
2
2

1
2
3

1
2
4

1
2
5

1
2
6

1
2
7

1
2
8

1
2
9

1
3
0

1
3
1

1
3
2

1
3
3

1
3
4

1
3
5

1
3
6

1
3
7

1
3
8

1
3
9

1
4
0

1
4
1

1
4
2

1
4
3
1
4
4

1
4
5

1
4
6

1
4
7

1
4
8

1
4
9

1
5
0

1
5
1

1
5
2

1
5
3

1
5
4

1
5
5

1
5
6

1
5
7

1
5
8

Restarts after client failure

A Multiload job may be restarted after it is interrupted by a failure of the


Multiload process or the client processing platform. This type of er-ror may
be a system error or can be a programming error or data er-ror. The system
can be restarted by correcting the problem and re-running the Multiload job.
The following output is an example of a re-start for a failure of a Multiload
process during the acquisition phase.

code

1 C:\DataIntegration\Scripts>mload -b < tran.ml

2 **** 22:35:51 UTY2414 BRIEF option is enabled.

3 ============================================
============================
4
= MultiLoad Utility Release MLOD.13.00.00.000 =
5
= Platform WIN32 =
6
============================================
7
8 ============================

9 = Copyright 1990-2009, Teradata Corporation. ALL RIGHTS


RESERVED. =
1
0 ============================================
============================
1
1 **** 22:35:51 UTY2411 Processing start date: SUN AUG 09, 2009

1 ============================================
2 ============================

1 = Logon/Connection =
3
============================================
1 ============================
4
0001 .logtable test.tranmllog;
1
0002 .LOGON test/testuser,;
5
**** 22:35:53 UTY8400 Teradata Database Release: 12.00.01.24
1
6 **** 22:35:53 UTY8400 Teradata Database Version: 12.00.01.24

1 **** 22:35:53 UTY8400 Default character set: ASCII


7
**** 22:35:53 UTY8400 Current RDBMS has interval support
1
8 **** 22:35:53 UTY8400 Current RDBMS has UDT support

1 **** 22:35:53 UTY8400 Maximum supported buffer size: 1M


9
**** 22:35:53 UTY8400 Data Encryption supported by RDBMS server
2
**** 22:35:54 UTY6211 A successful connect was made to the RDBMS.
0
**** 22:35:54 UTY6217 Logtable 'test.tranmllog' has been created.
2
1

2 0003 .begin import


2
mload tables test.tran
2
3 checkpoint 20000;

2 ============================================
4 ============================

2 = Processing MultiLoad Statements =


5
============================================
2 ============================
6

2
0004 .layout tranlayout;
7
0005 .FIELD STORE * varchar(10);
2
8 0006 .field TRAN_NO * varchar (10);
2 0007 .field TRAN_DATE * varchar (10);
9
0008 .field TRAN_TIME * varchar (10);
3
0 0009 .field TRAN_TYPE * varchar (1);

3 0010 .field TRAN_TERMINAL * varchar (3);


1
0011 .field CLERK * varchar (10);
3
0012 .field CUST_NO * varchar (10);
2
0013 .field NAME * varchar (30);
3
3 0014 .field TOTAL_SALE * varchar (14);

3 0015 .field SALES_TAX * varchar (14);


4
0016 .field DISCOUNT * varchar (14);
3
0017 .field DISC_PCT * varchar (10);
5
0018 .field DISC_TAKEN_FLAG * varchar (1);
3
6 0019 .field CASH_TENDERED * varchar (14);
3 0020 .field CHANGE_GIVEN * varchar (14);
7
3 0021 .field CHARGE_TENDERED* varchar (14);
8
0022 .field CHECK_NUMBER * varchar (20);
3
0023 .field CHECK_TENDERED * varchar (14);
9
0024 .field BANKCARD_TENDERED * varchar (14);
4
0 0025 .field PURCHASE_ORDER_NUM * varchar (20);
4
1
0026 .dml label insdml;
4
2 0027 insert into test.tran.*;

4
3
0028 .import infile C:\DataIntegration\Data\TRAN2.DAT
4
format vartext '|'
4
layout tranlayout
4
5 apply insdml;

4 0029 .end mload;


6
============================================
4 ============================
7
= MultiLoad Initial Phase =
4
============================================
8
============================
4
**** 22:35:54 UTY0829 Options in effect for this MultiLoad import task:
9
. Sessions: One session per available amp.
5
0 . Checkpoint: 20000 records.
5 . Tenacity: 4 hour limit to successfully connect load sessions.
1
. Errlimit: No limit in effect.
5
2
5 . AmpCheck: In effect for apply phase transitions.
3
**** 22:35:54 UTY0815 MLOAD session(s) connected: 2.
5
============================================
4
============================
5
= MultiLoad Acquisition Phase =
5
============================================
5
============================
6
**** 22:35:57 UTY1812 A checkpoint is being initiated because 20000
5
output reco
7
ds have been
5
8 sent to the RDBMS.
5 **** 22:35:58 UTY0827 A checkpoint has been taken, recording that input
9 record

6 0000 has been


0
processed for IMPORT 1 of this MultiLoad Import task.
6
1 **** 22:35:59 UTY1812 A checkpoint is being initiated because 40000
output reco
6
2 ds have been

6 sent to the RDBMS.


3
**** 22:36:00 UTY0827 A checkpoint has been taken, recording that input
6 record
4
0000 has been
6
processed for IMPORT 1 of this MultiLoad Import task.
5
**** 22:36:01 UTY1812 A checkpoint is being initiated because 60000
6
output reco
6
ds have been
6
7
6 sent to the RDBMS.
8

6
9

7
0

7
1

7
2

7
3

7
4

7
5

7
6

7
7

7
8

7
9

8
0

8
1

8
2

8
3

8
4

8
5

8
6

8
7

8
8

8
9

9
0

The gateway sessions associated with the Multiload job will remain ac-tive
for the gateway timeout time (20 minutes default). These sessions can be
killed using the gtwglobal utility in the same manner that was described for
the Fastload utility.

The interrupted Multiload job can be restarted by re-executing the job. The
following output is from a re-execution of the example Multiload job.

code

1 C:\DataIntegration\Scripts>mload -b < tran.ml

2 **** 22:42:35 UTY2414 BRIEF option is enabled.

3 ============================================
============================
4 = MultiLoad Utility Release MLOD.13.00.00.000 =

5 = Platform WIN32 =

6 ============================================
============================
7
= Copyright 1990-2009, Teradata Corporation. ALL RIGHTS
8
RESERVED. =
9
============================================
1 ============================
0
**** 22:42:35 UTY2411 Processing start date: SUN AUG 09, 2009
1
============================================
1
============================
1
= Logon/Connection =
2
============================================
1
============================
3
0001 .logtable test.tranmllog;
1
4 0002 .LOGON test/testuser,;

1 **** 22:42:38 UTY8400 Teradata Database Release: 12.00.01.24


5
**** 22:42:38 UTY8400 Teradata Database Version: 12.00.01.24
1
**** 22:42:38 UTY8400 Default character set: ASCII
6
**** 22:42:38 UTY8400 Current RDBMS has interval support
1
7 **** 22:42:38 UTY8400 Current RDBMS has UDT support

1 **** 22:42:38 UTY8400 Maximum supported buffer size: 1M


8
**** 22:42:38 UTY8400 Data Encryption supported by RDBMS server
1
9 **** 22:42:38 UTY6211 A successful connect was made to the RDBMS.

2 **** 22:42:38 UTY6210 Logtable 'test.tranmllog' indicates that a restart


0 is in p
2 rogress.
1

2
0003 .begin import
2
mload tables test.tran
2
3 checkpoint 20000;
2 ============================================
4 ============================

2 = Processing MultiLoad Statements =


5
============================================
2 ============================
6

2
7 0004 .layout tranlayout;

2 0005 .FIELD STORE * varchar(10);


8
0006 .field TRAN_NO * varchar (10);
2
0007 .field TRAN_DATE * varchar (10);
9
0008 .field TRAN_TIME * varchar (10);
3
0 0009 .field TRAN_TYPE * varchar (1);

3 0010 .field TRAN_TERMINAL * varchar (3);


1
0011 .field CLERK * varchar (10);
3
0012 .field CUST_NO * varchar (10);
2
0013 .field NAME * varchar (30);
3
3 0014 .field TOTAL_SALE * varchar (14);
3 0015 .field SALES_TAX * varchar (14);
4
0016 .field DISCOUNT * varchar (14);
3
5
3 0017 .field DISC_PCT * varchar (10);
6
0018 .field DISC_TAKEN_FLAG * varchar (1);
3
0019 .field CASH_TENDERED * varchar (14);
7
0020 .field CHANGE_GIVEN * varchar (14);
3
8 0021 .field CHARGE_TENDERED* varchar (14);
3 0022 .field CHECK_NUMBER * varchar (20);
9
0023 .field CHECK_TENDERED * varchar (14);
4
0 0024 .field BANKCARD_TENDERED * varchar (14);

4 0025 .field PURCHASE_ORDER_NUM * varchar (20);


1

4
0026 .dml label insdml;
2
0027 insert into test.tran.*;
4
3

4 0028 .import infile C:\DataIntegration\Data\TRAN2.DAT


4
format vartext '|'
4
layout tranlayout
5
apply insdml;
4
6 0029 .end mload;

4 ============================================
7 ============================

4 = MultiLoad Initial Phase =


8
============================================
4 ============================
9
**** 22:42:38 UTY0829 Options in effect for this MultiLoad import task:
5
0
5 . Sessions: One session per available amp.
1
. Checkpoint: 20000 records.
5
. Tenacity: 4 hour limit to successfully connect load sessions.
2
. Errlimit: No limit in effect.
5
3 . AmpCheck: In effect for apply phase transitions.
5 **** 22:42:39 UTY0815 MLOAD session(s) connected: 2.
4
============================================
5 ============================
5
= MultiLoad Acquisition Phase =
5
6 ============================================
============================
5
7 **** 22:42:40 UTY1806 This MultiLoad Import task is re-starting from
checkpoint
5
8 taken at

5 record 40000 of IMPORT 1.


9
**** 22:42:40 UTY1812 A checkpoint is being initiated because 60000
6 output recor
0
ds have been
6
sent to the RDBMS.
1
**** 22:42:41 UTY0827 A checkpoint has been taken, recording that
6
input record 6
2
0000 has been
6
3 processed for IMPORT 1 of this MultiLoad Import task.

6 **** 22:42:43 UTY0826 A checkpoint has been taken, recording that end
4 of file ha

6 s been reached
5
6 for IMPORT 1 of this MultiLoad Import task.
6
**** 22:42:43 UTY1803 Import processing statistics
6
. IMPORT 1 Total thus far
7
. ========= ==============
6
8 Candidate records considered:........ 67817....... 67817
6 Apply conditions satisfied:.......... 67817....... 67817
9
Candidate records not applied:....... 0....... 0
7
0 Candidate records rejected:.......... 0....... 0

7 ============================================
1 ============================

7 = MultiLoad Application Phase =


2
============================================
7 ============================
3
**** 22:42:57 UTY0818 Statistics for table test.tran:
7
Inserts: 67817
4
Updates: 0
7
5 Deletes: 0

7 ============================================
6 ============================

7 = MultiLoad Task Cleanup =


7
============================================
7 ============================
8
**** 22:42:57 UTY0821 Error table test.ET_tran is EMPTY, dropping
7 table.
9
**** 22:42:57 UTY0821 Error table test.UV_tran is EMPTY, dropping
8 table.
0
8 **** 22:42:57 UTY0825 Error table statistics for:
1

8
Target table 1: test.tran
2
Number of Rows Error Table Name
8
3 ==============
==============================================
8
==========
4
0 test.ET_tran
8
5 0 test.UV_tran
8
6
**** 22:42:58 UTY0822 MultiLoad processing complete for this MultiLoad
8 import ta
7
sk.
8
8 ============================================
============================
8
9 = MultiLoad Task Complete =

9 ============================================
0 ============================

9
1
0030 .logoff;
9
============================================
2
============================
9
= Logoff/Disconnect =
3
============================================
9
============================
4
**** 22:42:59 UTY6216 The restart log table has been dropped.
9
5 **** 22:42:59 UTY6212 A successful disconnect was made from the
9 RDBMS.
6
**** 22:42:59 UTY2410 Total processor time used = '0.8125 Seconds'
9
. Start : 22:42:35 - SUN AUG 09, 2009
7
. End : 22:42:59 - SUN AUG 09, 2009
9
8 . Highest return code encountered = '0'.
9
9

1
0
0

1
0
1

1
0
2

1
0
3

1
0
4

1
0
5

1
0
6

1
0
7

1
0
8

1
0
9

1
1
0

1
1
1

1
1
2

1
1
3

1
1
4

1
1
5

1
1
6

1
1
7

1
1
8

1
1
9

1
2
0

1
2
1

1
2
2

1
2
3

1
2
4

1
2
5

1
2
6

1
2
7

1
2
8
1
2
9

1
3
0

1
3
1

A Multiload job may also be restarted if interrupted during the application


phase.

It is important to note that the restart log and error tables must be
available. If they are not the Multiload job can not be restarted or rerun. In
this case the table must be reloaded from backup or source because they
are unusable.

The following output is an example of a Multiload job restarted after an


interruption during the application phase.

code

1 C:\DataIntegration\Scripts>mload -b < tran.ml

2 **** 22:53:17 UTY2414 BRIEF option is enabled.

3 ============================================
============================
4
= MultiLoad Utility Release MLOD.13.00.00.000 =
5
= Platform WIN32 =
6
============================================
7
============================
8
= Copyright 1990-2009, Teradata Corporation. ALL RIGHTS
9 RESERVED. =
1 ============================================
0 ============================

1 **** 22:53:17 UTY2411 Processing start date: SUN AUG 09, 2009
1
============================================
1 ============================
2
= Logon/Connection =
1
============================================
3
============================
1
0001 .logtable test.tranmllog;
4
0002 .LOGON test/testuser,;
1
5 **** 22:53:19 UTY8400 Teradata Database Release: 12.00.01.24

1 **** 22:53:19 UTY8400 Teradata Database Version: 12.00.01.24


6
**** 22:53:19 UTY8400 Default character set: ASCII
1
7 **** 22:53:19 UTY8400 Current RDBMS has interval support

1 **** 22:53:19 UTY8400 Current RDBMS has UDT support


8
**** 22:53:19 UTY8400 Maximum supported buffer size: 1M
1
**** 22:53:19 UTY8400 Data Encryption supported by RDBMS server
9
**** 22:53:19 UTY6211 A successful connect was made to the RDBMS.
2
0 **** 22:53:19 UTY6210 Logtable 'test.tranmllog' indicates that a restart
is in p
2
1 rogress.

2
2
0003 .begin import
2
mload tables test.tran
3
checkpoint 20000;
2
4 ============================================
2 ============================
5
= Processing MultiLoad Statements =
2
============================================
6
============================
2
7
0004 .layout tranlayout;
2
8 0005 .FIELD STORE * varchar(10);
2 0006 .field TRAN_NO * varchar (10);
9
0007 .field TRAN_DATE * varchar (10);
3
0 0008 .field TRAN_TIME * varchar (10);

3 0009 .field TRAN_TYPE * varchar (1);


1
0010 .field TRAN_TERMINAL * varchar (3);
3
0011 .field CLERK * varchar (10);
2
0012 .field CUST_NO * varchar (10);
3
3 0013 .field NAME * varchar (30);

3 0014 .field TOTAL_SALE * varchar (14);


4
0015 .field SALES_TAX * varchar (14);
3
0016 .field DISCOUNT * varchar (14);
5
0017 .field DISC_PCT * varchar (10);
3
6 0018 .field DISC_TAKEN_FLAG * varchar (1);
3 0019 .field CASH_TENDERED * varchar (14);
7
0020 .field CHANGE_GIVEN * varchar (14);
3
8 0021 .field CHARGE_TENDERED* varchar (14);

3 0022 .field CHECK_NUMBER * varchar (20);


9
4 0023 .field CHECK_TENDERED * varchar (14);
0
0024 .field BANKCARD_TENDERED * varchar (14);
4
0025 .field PURCHASE_ORDER_NUM * varchar (20);
1

4
2 0026 .dml label insdml;

4 0027 insert into test.tran.*;


3

4
4 0028 .import infile C:\DataIntegration\Data\TRAN2.DAT

4 format vartext '|'


5
layout tranlayout
4
apply insdml;
6
0029 .end mload;
4
7 ============================================
============================
4
8 = MultiLoad Initial Phase =

4 ============================================
9 ============================

5 **** 22:53:19 UTY0829 Options in effect for this MultiLoad import task:
0
. Sessions: One session per available amp.
5
. Checkpoint: 20000 records.
1
. Tenacity: 4 hour limit to successfully connect load sessions.
5
2 . Errlimit: No limit in effect.
5 . AmpCheck: In effect for apply phase transitions.
3
**** 22:53:20 UTY0815 MLOAD session(s) connected: 2.
5
4 ============================================
5 ============================
5
= MultiLoad Application Phase =
5
============================================
6
============================
5
**** 22:53:25 UTY0818 Statistics for table test.tran:
7
Inserts: 67817
5
8 Updates: 0
5 Deletes: 0
9
============================================
6 ============================
0
= MultiLoad Task Cleanup =
6
1 ============================================
============================
6
2 **** 22:53:25 UTY0821 Error table test.ET_tran is EMPTY, dropping
table.
6
3 **** 22:53:26 UTY0821 Error table test.UV_tran is EMPTY, dropping
table.
6
4 **** 22:53:26 UTY0825 Error table statistics for:

6
5
Target table 1: test.tran
6
Number of Rows Error Table Name
6
==============
6
==============================================
7
==========
6
0 test.ET_tran
8
0 test.UV_tran
6
9
7
0
**** 22:53:27 UTY0822 MultiLoad processing complete for this MultiLoad
7 import ta
1
sk.
7
============================================
2
============================
7
= MultiLoad Task Complete =
3
============================================
7
============================
4

7
5 0030 .logoff;

7 ============================================
6 ============================

7 = Logoff/Disconnect =
7
============================================
7 ============================
8
**** 22:53:27 UTY6216 The restart log table has been dropped.
7
9 **** 22:53:27 UTY6212 A successful disconnect was made from the
RDBMS.
8
0 **** 22:53:27 UTY2410 Total processor time used = '0.671875 Seconds'

8 . Start : 22:53:17 - SUN AUG 09, 2009


1
. End : 22:53:27 - SUN AUG 09, 2009
8
. Highest return code encountered = '0'.
2

8
3

8
4

8
5

8
6

8
7

8
8

8
9

9
0

9
1

9
2

9
3

9
4

9
5

9
6

9
7

9
8
9
9

1
0
0

1
0
1

1
0
2

1
0
3

1
0
4

1
0
5

1
0
6

1
0
7

1
0
8

1
0
9
Rerun

Multiload jobs that are interrupted before the application phase starts or
after the application phase ends may be rerun. Jobs that are inter-rupted
during the application phase must be restarted.

To rerun an entire Multiload job the following actions must be taken before
the job is rerun:

Use BTEQ to execute RELEASE MLOAD command for each target table in
Multiload script

Drop work table for each target table

Drop acquisition error table for each target table

Drop application error table for each target table

Drop restart log table

These actions can be executed by a BTEQ SQL script that is run as part of a
Multiload script or run by an external job scheduling system.

The following is an example of a SQL script that will allow this example to be
rerun.

code

1 .logon test/testuser,test

3 database test;

5 release mload tran;

6 drop table uv_tran;

7 drop table et_tran;


8 drop table wt_tran;

9 drop table log_tran;

10

11.logoff

12.quit

This script can be executed as part of a Multiload script that executes this
script with BTEQ and then executes the Multiload job as illustrated in the
following Multiload script.

code

1.system 'bteq < c:\DataIntegration\scripts\tranreset.sql';

2.run file c:\DataIntegration\scripts\tranload.ml;

4.logoff;

This script can always be run when the intent is to run the entire Multi-load
job.

In the next article in this series we will look at the Tpump Utility.

You might also like