You are on page 1of 12

BTEQ

Basic TEradata Query (BTEQ) is pronounced Bee-Teeeek.


BTEQ was the first utility and query tool for Teradata. BTEQ can be used as a Query tool, to load data a row
at a time into Teradata and to export data off of Teradata a row at a time.
Scripts are sent from the client to the Teradata Database where the actual process occurs. You can also use
BTEQ to import and export data between your client and database tables.

BTEQs streamed package format design ensures fast processing and effective resource utilization.
We will also get some experience using BTEQ to import and export data to and from Teradata.

There are four type of BTEQ Export modes.

Export DATA
This is set by .EXPORT DATA.
Generally, users will export data to a flat file format. This is called Record Mode or DATA mode.
If the data has no headers or white space between the data contained in each column and the data is
written to the file in a normal format.
Export INDICDATA
This is set by .EXPORT INDICDATA.
This mode is used to export data with extra indicator bytes to indicate NULLs in column for a row.
Export REPORT
This is set by .EXPORT REPORT
In this mode the output of BTEQ export would return the column headers for the fields, white space,
expanded packed or binary data.
Its just looks like a report with column headers and data.

Export DIF
This called as Data Interchange Format, which allows users to export data from Teradata to be directly
utilized for spreadsheet applications like Excel, FoxPro and Lotus.

FAST EXPORT
FastExport ,the name itself is spells to exports data from Teradata to a Flat file. But BTEQ also does the same
thing. The main difference is BTEQ exports data in rows and FastExport exports data in 64K blocks. So if its
required to load data with lightning speed Fast export is the best choice.
Basic fundamentals of FastExport
FastExport EXPORTS data from Teradata.

FastExport only supports the SELECT statement.


Choose FastExport over BTEQ when Exporting Data of more than half a million+ rows
FastExport supports multiple SELECT statements and multiple tables in a single run
FastExport supports conditional logic, conditional expressions, arithmetic calculations, and data
conversions.
FastExport does NOT support error files or error limits.
FastExport supports user-written routines INMODs and OUTMODs

FastExport Modes
FastExport has two modes: RECORD or INDICATOR
RECORD mode is the default, but you can use INDICATOR mode if required.
The difference between the two modes is INDICATOR mode will set the indicator bits to 1 for column
values containing NULLS.
FastExport Formats
FastExport can export data in below formats
BINARY
TEXT
UNFORMAT

Teradata Fast Load


Fastload, the name itself telling that loads data in a fast way. That means it loads huge amount of data from flat
file into EMPTY tables.
Mainly FastLoad was developed to load millions of rows into empty Teradata tables so it is fast.
FastLoad will create a Teradata session for each AMP in order to maximize parallel processing. This gives
awesome performance in loading data.
Main use: to load empty tables at high speed.
The target tables must be empty in order to use FastLoad
Supports inserts only - it is not possible to perform updates or deletes in FastLoad
Although Fastload uses multiple sessions to load the data, only one target table can be processed at a time

Teradata Fastload does not support join indexes, foreign key references in target tables and tables with
secondary index defined.
It is necessary to drop any of the constraints listed before loading and recreate them afterwards.
The maximum number of concurrent Teradata Fastload tasks can be adjusted by a system administrator.

Fastload runs in two operating modes: Interactive and Batch


Duplicate rows will not be loaded

There are more reasons why FastLoad is so fast. Below are limitations of Fast load.
1) No Secondary Indexes are allowed on the Target Table: Usually UPI and NUPI are used in Teradata to
distribute the rows evenly across the AMPs. Secondary indexes are stored in a sub table block and
many times on a different AMP from the data row.
2)No Referential Integrity is allowed: The Referential Integrity defined on a table would take more system
checking to prevent referential constraints.
3)No Triggers are allowed at load time: Fast load focused on data load with high speed. So triggers not
allowed.
4)Duplicate Rows (in Multi-Set Tables) are not supported: Multiset tables are allowed duplicate data.
Fastload can load the data into multiset tables but duplicate rows are discarded.

5)No AMPs may go down (i.e., go offline) while FastLoad is processing: The down AMP must be repaired
before the load process can be restarted
6)No more than one data type conversion is allowed per column: Data type conversion cause high
resource utilization on the system

Fastload requires mainly three components

Log table
Log table stores the processing record information during load. This table contains one row for every
FastLoad running on the system
Empty Target table
As mentioned earlier target tables should be empty.
Error tables(two)
Each FastLoad requires two error tables. These are automatically created during run. These will populated
only errors occurred during the load.
The first error table is for any translation errors or constraint violations
For example, if a column is defined as integer but the data from source the data is coming in CHAR format.
i.e wrong data.
The second error table is for errors caused by duplicate values for Unique Primary Indexes.

Teradata Multi Load


MultiLoad has the capability to load multiple tables at one time from either a LAN or Channel environment.
That why its names as MULTI LOAD.
The data load can perform multiple types of DML operations, including INSERT, UPDATE, DELETE and UPSERT
on up to five (5) empty or populated target tables at a time.

Main use: Load, update and delete large tables in Teradata in a bulk mode
Efficient in loading very large tables
Multiple tables can be loaded at a time.
Updates data in a database in a block mode (one physical write can update multiple rows)
Uses table-level locks
Resource consumption: loading at the highest possible throughput
Duplicate rows allowed

Teradata Parallel Transport (TPT)


TPT stands for Teradata parallel transporter. As the name implies Parallel Transporting.
This is the new generation Load/unload utility provided by teradata.
This acts as a integrated ETL suite which helps to EXTRACT data from multiple source, apply the
TRANSFORMATION logic and LOAD the data in target Teradata database.
TPT has all the features to run the stand alone teradata load/unload utilities i.e (mload, tpump, fastexport,
fastload) .
Important Features of TPT
The most important feature of TPT is its Scalability and Parallelism behaviour.
The TPT operator equivalent to standalone utilities are listed below
Mload=Update

Tpump=Stream
Fastload=Load
FastExport=Export

TPT is a utility tool of teradata and has all the capabilities of ETL along the
with features of other teradata load/unload utilities.
In simple terms TPT can be described as nutshell of all teradata standalone
utilities along with additional features.
The TPT script can be created in step so that incase of failure of job the job
process can be restarted from the step where it has failed.
Parallel Transporter can be invoked through 4 interfaces:
Application Program Interface (API) used by leading ETL vendors for tight,
parallel, high-performance integration
Script used when a customer doesnt have an ETL tool
Command line (sometimes referred to as the Easy Loader interface) used
to load data from a flat file with a single command line
Wizard used to generate simple scripts. Use this tool as a way to learn the
script language and not as a production load interface.

TERADATA PARALLEL DATA PUMP (TPUMP)


Main use: to load or update a small amount of target table rows
Sends data to a database as a statement which is much slower than using
bulk mode
TPump uses row-level hash locks
Resource consumption: loading speed can be adjusted using a built-in
resource consumption management utility. The throughput can be turned
down in peak periods.
TPump does not support MULTI-SET tables.

You might also like