5
Restarting Fastload Author: Geeta Ranbhor Project Details: Project Name: SBCSMSMF H/W Platform: OS/390 S/W Environment: MVS Operating System Project Type: Maintenance Target Readers: Teradata users Keywords: AMP, Checkpoints

Fastload Restarting

Embed Size (px)

Citation preview

Page 1: Fastload Restarting

8/3/2019 Fastload Restarting

http://slidepdf.com/reader/full/fastload-restarting 1/4

Restarting Fastload

Author: Geeta Ranbhor

Project Details:

Project Name: SBCSMSMFH/W Platform: OS/390

S/W Environment: MVS Operating SystemProject Type: Maintenance

Target Readers:

Teradata users

Keywords:

AMP, Checkpoints

Page 2: Fastload Restarting

8/3/2019 Fastload Restarting

http://slidepdf.com/reader/full/fastload-restarting 2/4

Fastload:

In many applications, it is required to load data from files to the tables in the

database. The Fastload utility is used to load large amount of data into tables.Fastload works at very high speed. The restriction with fast load is that the table in

which the data is to be loaded should be empty. Fastload can load data from multiplefiles into a single table. The document will talk about loading data from multiple filesinto a single table using fastload and the restarting fastload.

Fastload can run in the Unix, Windows and Mainframe environments.

Fastload works in 2 phases:

First is the data acquisition phase and the second is the data writing phase.

Phase 1: Data Acquisition Phase

In the data acquisition phase, data is written from the file to the AMP.

AMP is a logical storage unit in Teradata architecture.Data is not written to the disk in this phase.

So to load data from multiple source files into 1 target table, this phase can becarried out multiple times. After collecting data from all the files, phase 2 should be

executed. This will write the data to the disk.

Phase 2: Data Loading Phase

Phase 2 writes data to the disk. It releases the locks acquired in phase 1 and deletesthe empty error tables.

Page 3: Fastload Restarting

8/3/2019 Fastload Restarting

http://slidepdf.com/reader/full/fastload-restarting 3/4

FASTLOAD

LOGON <USERNAME>,<PASSWORD>;

BEGIN LOADING TABLENAME

ERRORFILES TABLEERR1,TABLEERR2;

DEFINE A (INTEGER)

B (INTEGER)FILE= <INPUTFILE.DAT>;

INSERT INTO <TABLENAME> VALUES(:A

,:B);

END LOADING;

LOGOFF;

THIS IS THE EMPTY TABLE

START OF PHASE 1

DEFINITION OF INPUTRECORD

INSERT STATEMENT TOINSERT DATA FROM FILE

TO TABLE

START OF PHASE 2

Page 4: Fastload Restarting

8/3/2019 Fastload Restarting

http://slidepdf.com/reader/full/fastload-restarting 4/4

Restarting Fastload:-

Scenarios are mentioned in which you might require to restart the fastload along

with the steps to be taken for restarting.

• There might be a case in which an abend occurs in first phase, i.e the data

acquisition phase.This abend indicates that the data acquisition is incomplete.

Solution:

Resubmit the fastload script.

Fastload will begin from record 1 or the first recordafter the last checkpoint.

(Checkpoint is used to verify that the rows are transmitted and processed.)

• If Abend occurs in second phase. This indicates that the data acquisition iscomplete.

Solution:

This indicates that phase 1, i.e the data acquisition phase is complete. So only

phase 2 needs to be resubmitted. Submit only BEGIN and END LOADINGstatements. In this case there is no need to resubmit the entire fastload

script.

• Normal end of Phase 1. More data to acquire, thus there is no ‘end loading’ 

statement in the script.

Solution:

Such a case indicates that more data needs to be acquired. So resubmit the

script. Fastload should be positioned to first record or the first record after the

last checkpoint.

• Normal end of Phase 1. No more data to acquire, thus there is no ‘endloading’ statement in the script.

Solution:

If phase 1 is complete and there is no need to acquire more data, then restartonly step 2 i.e. the phase in which data is loaded to the table. Submit BEGIN

and END LOADING statements.