You are on page 1of 7

TD Utilities FastExport Utility: FastExport is a command-driven utility that uses multiple sessions to quickly transfer large amounts of data

from tables and views of the Teradata Database to a client-based application. ASCII, EBCDIC, UTF-8, and UTF-16 Some commands: ACCEPT variables like file, variable DATEFROM specify form of the date DISPLAY write message to specified destination IF ELSE ENDIF LOGOFF LOGON LOGTABLE - Specifies a restart log table for the FastExport checkpoint information RUN FILE-Invokes specified external file ROUTE MESSAGES SET - Assigns a data type and a value to a utility variable SYSTEM-Suspends operation of FastExport and executes any valid local operating system command BEGIN EXPORT EXPORT FILED FILLER IMPORT LAYOUT-Specifies, in conjunction with an immediately following sequence of FIELD and FILLER commands END EXPORT + TD SQL statements

MultiLoad Utility
The MultiLoad utility is an efficient way to deal with batch maintenance of large databases. MultiLoad is a command-driven utility for fast, high-volume maintenance on multiple tables and views of a Teradata Database. Each MultiLoad import task can do multiple data insert, update, and delete functions on up to five different tables or views. Each MultiLoad delete task can remove large numbers of rows from a single table.
Phases of MultiLoad Operation

Phase MultiLoad Operation Preliminary 1 Parses and validates all of the MultiLoad commands and Teradata SQL statements in a MultiLoad job 2 Establishes sessions and process control with the Teradata Database 3 Submits special Teradata SQL requests to the Teradata Database 4 Creates and protects temporary work and error tables in the Teradata Database DML Transaction Submits the DML statements specifying the insert, update, and delete tasks to the Teradata Database. Acquisition 1 Imports data from the specified input data source 2 Evaluates each record according to specified application conditions 3 Loads the selected records into the worktables in the Teradata Database (There is no acquisition phase activity for a MultiLoad delete task.) Application 1 Acquires locks on the specified target tables and views in the Teradata Database 2 For an import task, inserts the data from the temporary work tables into the target tables or views in the Teradata Database 3 For a delete task, deletes the specified rows from the target table in the Teradata Database 4 Updates the error tables associated with each MultiLoad task Cleanup 1 Forces an automatic restart/rebuild if an AMP went offline and came back online during the application phase 2 Releases all locks on the target tables and views 3 Drops the temporary work tables and all empty error tables from the Teradata Database 4 Reports the transaction statistics associated with the import and delete tasks Task Status Reporting
MultiLoad has three ways to provide information utility messages: Logoff/disconnect, Options messages- SESSIONS, CHECKPOINT, TENACITY, SLEEP, ERRLIMIT, AMPCHECK The QrySessn Utility provides real-time phase-oriented progress at selected intervals. Statistics messages present information at the end of the MultiLoad job.

Data Conversion Capabilities:


The types of data conversions can be specified are: Numeric-to-numeric (for example integer-to-decimal) Character-to-numeric Character-to-date Date-to-character C:\Users\matangi>mload ======================================================================== = = = MultiLoad Utility Release MLOD.13.00.00.005 = = Platform WIN32 = = = ======================================================================== = = = Copyright 1990-2009 Teradata Corporation. ALL RIGHTS RESERVED. = = = ======================================================================== **** 14:48:07 UTY2411 Processing start date: SAT MAR 16, 2013 ======================================================================== = = = Logon/Connection = = = ======================================================================== .logtable mload_log; 0001 .logtable mload_log; .logon 127.0.0.1/tduser,tduser; 0002 .logon 127.0.0.1/tduser,; **** 14:48:34 UTY8400 Teradata Database Release: 13.00.00.12 **** 14:48:34 UTY8400 Teradata Database Version: 13.00.00.12 **** 14:48:34 UTY8400 Default character set: ASCII **** 14:48:34 UTY8400 Current RDBMS has interval support **** 14:48:34 UTY8400 Current RDBMS has UDT support **** 14:48:34 UTY8400 Maximum supported buffer size: 1M **** 14:48:34 UTY8400 Data Encryption supported by RDBMS server **** 14:48:35 UTY6211 A successful connect was made to the RDBMS. **** 14:48:35 UTY6217 Logtable 'TDUSER.mload_log' has been created. ======================================================================== = = = Processing Control Statements = = = ======================================================================== DATABASE personnel; 0003 DATABASE personnel; **** 14:48:50 UTY1016 'DATABASE' request successful. CREATE TABLE employee_ml ( EmpNo SMALLINT FORMAT '9(5)' BETWEEN 10001 AND 32001 NOT NULL, Name VARCHAR(12), DeptNo SMALLINT FORMAT '999' BETWEEN 100 AND 900 , PhoneNo SMALLINT FORMAT '9999' BETWEEN 1000 AND 9999, JobTitle VARCHAR(12),

Salary DECIMAL(8,2) FORMAT 'ZZZ,ZZ9.99' BETWEEN 1.00 AND 999000.00 , YrsExp BYTEINT FORMAT 'Z9' BETWEEN -99 AND 99 , DOB DATE FORMAT 'MMMbDDbYYYY', Sex CHAR(1) UPPERCASE, Race CHAR(1) UPPERCASE, MStat CHAR(1) UPPERCASE, EdLev BYTEINT FORMAT 'Z9' BETWEEN 0 AND 22, HCap BYTEINT FORMAT 'Z9' BETWEEN -99 AND 99 ) UNIQUE PRIMARY INDEX( EmpNo ) INDEX( Name ); 0004 CREATE TABLE employee_ml ( EmpNo SMALLINT FORMAT '9(5)' BETWEEN 10001 AND 32001 NOT NULL, Name VARCHAR(12), DeptNo SMALLINT FORMAT '999' BETWEEN 100 AND 900 , PhoneNo SMALLINT FORMAT '9999' BETWEEN 1000 AND 9999, JobTitle VARCHAR(12), Salary DECIMAL(8,2) FORMAT 'ZZZ,ZZ9.99' BETWEEN 1.00 AND 999000.00 , YrsExp BYTEINT FORMAT 'Z9' BETWEEN -99 AND 99 , DOB DATE FORMAT 'MMMbDDbYYYY', Sex CHAR(1) UPPERCASE, Race CHAR(1) UPPERCASE, MStat CHAR(1) UPPERCASE, EdLev BYTEINT FORMAT 'Z9' BETWEEN 0 AND 22, HCap BYTEINT FORMAT 'Z9' BETWEEN -99 AND 99 ) UNIQUE PRIMARY INDEX( EmpNo ) INDEX( Name ); **** 14:49:49 UTY1016 'CREATE' request successful. .begin import mload tables employee_ml; 0005 .begin import mload tables employee_ml; ======================================================================== = = = Processing MultiLoad Statements = = = ======================================================================== .layout inslayout; 0006 .layout inslayout; .field EmpNo 2 char(9); 0007 .field EmpNo 2 char(9); .field Name 12 char(12); 0008 .field Name 12 char(12); .field DeptNo 25 char(3); 0009 .field DeptNo 25 char(3); .field PhoneNo 29 char(4); 0010 .field PhoneNo 29 char(4); .field JobTitle 34 char(12); 0011 .field JobTitle 34 char(12); .field Salary 47 char(9); 0012 .field Salary 47 char(9); .field YrsExp 57 char(2); 0013 .field YrsExp 57 char(2); .field DOB 60 char(11);

0014 .field DOB 60 char(11); .field Sex 72 char(1); 0015 .field Sex 72 char(1); .field Race 74 char(1); 0016 .field Race 74 char(1); .field MStat 76 char(1); 0017 .field MStat 76 char(1); .field EdLev 78 char(2); 0018 .field EdLev 78 char(2); .field HCap 81 char(2); 0019 .field HCap 81 char(2); .dml label insdml; 0020 .dml label insdml; insert into employee_ml.*; 0021 insert into employee_ml.*; .import infile insert.input format text layout inslayout apply insdml; 0022 .import infile insert.input format text layout inslayout apply insdml; .end mload; 0023 .end mload; ======================================================================== = = = MultiLoad Initial Phase = = = ======================================================================== **** 14:51:52 UTY0829 Options in effect for this MultiLoad import task: . Sessions: One session per available amp. . Checkpoint: 15 minute(s). . Tenacity: 4 hour limit to successfully connect load sessions. . Errlimit: No limit in effect. . AmpCheck: In effect for apply phase transitions. **** 14:51:52 UTY0817 MultiLoad submitting the following request: Select NULL from TDUSER.mload_log where (LogType = 125) and (Seq = 1) and (MloadSeq = 0); **** 14:51:52 UTY0817 MultiLoad submitting the following request: Select NULL from TDUSER.mload_log where (LogType = 120) and (Seq = 1); **** 14:51:53 UTY0815 MLOAD session(s) connected: 2. **** 14:51:53 UTY0817 MultiLoad submitting the following request: BEGIN MLOAD employee_ml WITH INTERVAL; **** 14:51:53 UTY0817 MultiLoad submitting the following request: INS TDUSER.mload_log (LogType, Seq, MLoadSeq)VALUES(130, 1, 10); **** 14:51:53 UTY0817 MultiLoad submitting the following request: MLOAD employee_ml with WT_employee_ml errortables ET_employee_ml, UV_employee_ml; ======================================================================== = =

= MultiLoad DML Transaction Phase = = = ======================================================================== **** 14:51:53 UTY0817 MultiLoad submitting the following request: BT; **** 14:51:53 UTY0817 MultiLoad submitting the following request: USING EMPNO(CHAR(9)), NAME(CHAR(12)), DEPTNO(CHAR(3)), PHONENO(CHAR(4)), JOBTITLE(CHAR(12)), SALARY(CHAR(9)), YRSEXP(CHAR(2)), DOB(CHAR(11)), SEX(CHAR(1)), RACE(CHAR(1)), MSTAT(CHAR(1)), EDLEV(CHAR(2)), HCAP(CHAR(2)) insert into employee_ml VALUES(:EmpNo, :Name, :DeptNo, :PhoneNo, :JobTitle, :Salary, :YrsExp, :DOB, :Sex, :Race, :MStat, :EdLev, :HCap); **** 14:51:53 UTY0817 MultiLoad submitting the following request: INS TDUSER.mload_log (LogType, Seq, MLoadSeq)VALUES(130, 1, 20); **** 14:51:53 UTY0817 MultiLoad submitting the following request: ET; ======================================================================== = = = MultiLoad Acquisition Phase = = = ======================================================================== **** 14:51:53 UTY0817 MultiLoad submitting the following request: BEGIN TRANSACTION; **** 14:51:53 UTY0817 MultiLoad submitting the following request: CHECKPOINT LOADING INTERVAL 0; **** 14:51:53 UTY0817 MultiLoad submitting the following request: CHECKPOINT LOADING INTERVAL 0; **** 14:51:54 UTY0817 MultiLoad submitting the following request: CHECKPOINT LOADING INTERVAL 0; **** 14:51:55 UTY0817 MultiLoad submitting the following request: USING Ckpt(VARBYTE(1024)) INSERT TDUSER.mload_log (Logtype, Seq, MLoadSeq, MLoadImpSeq, MLoadSrcSeq, MiscInt1,MiscInt2,MiscInt3,MiscInt4, MiscInt5,MiscInt6,MiscInt7,MiscInt8,CkptInterval,MLoadCkpt) VALUES (110, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, :Ckpt); **** 14:51:55 UTY4203 Attempted to access out of range input data in field 'EDLEV', fi 'insert.input',record number '1'. **** 14:51:55 UTY1803 Import processing statistics . IMPORT 1 Total thus far . ========= ============== Candidate records considered:........ 1....... 1 Apply conditions satisfied:.......... 0....... 0 Candidate records not applied:....... 0....... 0 Candidate records rejected:.......... 0....... 0 ======================================================================== = = = Logoff/Disconnect = = = ======================================================================== **** 14:51:57 UTY6212 A successful disconnect was made from the RDBMS. **** 14:51:57 UTY2410 Total processor time used = '0.296402 Seconds' . Start : 14:48:07 - SAT MAR 16, 2013

. .

End : 14:51:57 - SAT MAR 16, 2013 Highest return code encountered = '12'.

C:\Users\matangi>

Transferring Large Amounts of Data


The Teradata application utilities reside in the host computer, whether it be the Application Processor, a mainframe, or a workstation. BTEQ supports all 4 DMLs: SELECT, INSERT, UPDATE and DELETE. BTEQ also supports IMPORT/EXPORT protocols. FastLoad, MultiLoad, and TPump transfer data from the host to Teradata. FastExport performs high volume SELECTs to export data from Teradata to the host.
In Teradata mode, a BTEQ DELETE ALL function does not use the Transient Journal. An INSERT/SELECT of 1,000,000 million rows into an empty table is faster than an INSERT/SELECT of 1,000,000 rows into a table with 1 row. BTEQ: CONDITIONAL LOGIC

DELETE FROM Million_Dollar_Customer ALL; .IF ERRORCODE = 0 THEN .GOTO TableOK CREATE TABLE Million_Dollar_Customer (Account_Number INTEGER ,Customer_Last_Name VARCHAR(20) ,Customer_First_Name VARCHAR(15) ,Balance_Current DECIMAL(9,2)); .LABEL TableOK INSERT INTO Million_Dollar_Customer SELECT A.Account_Number, C.Last_Name, C.First_Name, A.Balance_Current FROM Accounts A INNER JOIN Account_Customer AC INNER JOIN Customer C ON C.Customer_Number = AC.Customer_Number ON A.Account_Number = AC.Account_Number WHERE A.Balance_Current GT 1000000; .IF ACTIVITYCOUNT > 0 THEN .GOTO Continue .QUIT .LABEL Continue IF TABLE doesnot exists then error code non-zero ACTIVITYCOUNT no of rows. .SET ERRORLEVEL 2168 SEVERITY 4 .SET MAXERROR 100 For channel connected system fixed length format are users.so, IMPORT .INDIACADATA mode used to identif NULLS.