Teradata Normalized Transformation

39
Teradata 13.0 Normalization Transformation using Fast load Utility Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Guide for building financial data model in Teradata. The document focuses on how th e real world requirement should be interpreted. The document focuses on converting the transaction model to OLAP model.  Join our professional training program and learn from experts. History: Version Description Change Author Publish Date 0.1 Initial Draft Anil Tekam 12th Aug 2011 0.1 Review#1 Amit Sharma 18 th Aug 2011 www.bispsolutions.com | www.hyperiongu ru.com | www.bisptraini ngs.com | Page 1

Transcript of Teradata Normalized Transformation

Page 1: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 1/39

Teradata 13.0Normalization Transformation using Fast load Utility

Description:BISP is committed to provide BEST learning material to the

beginners and advance learners. In the same series, we haveprepared a complete end-to end Hands-on Guide for building

financial data model in Teradata. The document focuses on howthe real world requirement should be interpreted. Thedocument focuses on converting the transaction model to OLAPmodel.  Join our professional training program and learn fromexperts.

History:Version Description Change Author Publish Date0.1 Initial Draft Anil Tekam 12th Aug 20110.1 Review#1 Amit Sharma 18th Aug 2011

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 1

Page 2: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 2/39

Contents

Contents.......................................................................................................................... 2

Source Data Model ..........................................................................................................3

 Target Data Model...........................................................................................................3

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 2

Page 3: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 3/39

Summary:  In the below, we are going to convert the transitional model with

multiple tables spread across with one subject area. i/e supplier has Suppliers,

Suppier_Type etc. As part of normalization transformation it, the below source data

mode will be de-normalized to start schema.

 

Source Data Model

Target Data Model

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 3

Page 4: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 4/39

Customer Source Model and Mapping Sheet 

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 4

Page 5: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 5/39

 

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 5

Page 6: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 6/39

Supplier Source Model and Mapping Sheet

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 6

Page 7: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 7/39

Product Source Model and Mapping Sheet

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 7

Page 8: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 8/39

Employee Source Model and Mapping Sheet

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 8

Page 9: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 9/39

Store Source Model and Mapping Sheet

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 9

Page 10: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 10/39

Normalize Transformation Using Fast Load UtilityDIM_CUSTOMER:-

Step #1:-First we perform the load operation from multiple tables to single target

table with the help of fast load utility. All the multiple table is normalize table which has

placed in single database and then we create the denormalize table with the help of 

normalize table in other database.

Step #2:- First we use the fast export utility because this utility help for searching the

data from source tables.

1.) BEGIN EXPORT STATEMENT.

2.) DEFINE THE OUTPUT FILE NAME.

3.) THE SELECT PULLS DATA FROM TABLE

(REGION,TERRITORIES,CUSTOMER_TYPE,CUSTOMER).

4.) END THE JOB AND LOGOFF TERADATA.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 10

/* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE

/* @(#) FASTEXPORT SCRIPT */ SCRIPT AND AUTHOR IN/* @(#) Version 1.1 */ COMMENTS/* @(#) Created by BISP Team *//* ---------------------------------------------------------------*/

Page 11: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 11/39

Step #3:- Now the we execute this fast export script in command prompt. After

successful execution it will generate the output log file and system generated data file

or output data file.

Step #4:- Now the fast export script has successfully executed and it has generated

output log file and system generated output data file.

Step #5:- Now we create the fast load flat file script because fast load utility help forloading the data into the target table. We use the system generated output data file for

loading purpose in empty target table. 

1.) LOGIN ONTO TERADATA.

2.) DEFINING INPUT DATA FILE

3.) DEFINING THE ERROR FILES

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 11

Page 12: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 12/39

4.) FAST LOAD PERFORM END LOADING.

5.) DEFINE LOGOFF CONNECTION

1.) LOGIN ONTO TERADATA:- we logon into the teradata fast load utility.

2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load

must know the structure and the name of the flat file to be used as the input flat file or

source file for loading the data.

3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement

for the error tables. This error files work as error table. Fast load automatically

generate both error table. In this instance, they are named err2_cust and UV_cust

table. First error table (err2_cust) contains only constraints based related error and

second error table (UV_cust) contains only unique violation error.

4.) FAST LOAD PERFORM END LOADING:-  The target table must be empty at theloading time and if the loading has completed, then we use the END LOADING

statement. If we don't use the END LOADING statement then we get error i.e. Target

table being loaded and that time we can't access the loading data.

5.) DEFINE LOGOFF CONNECTION:- Now all the sessions has logoff. This is the

last statement of this fast load script. Now the table lock has released and if no rows in

the error table, then that error table automatically dropped and if there is any single

row in error table then we check it, then we take appropriate action and drop that

error table manually.

Step #6:- Now we execute this fast load flat file script in command prompt. It will takefew second for successful execution.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 12

 /* ++++++++++++++++++++++++++++ */ Always good to identify the /* FASTLOAD SCRIPT TO LOAD THE */ script and author in comment.

 /* OLTP.CUSTOMER,CUSTOMER_TYPE,REGION, */ /* TERRITORIES TABLE Version 1.1 */

 /* Created by BISP Team */

 /* ++++++++++++++++++++++++++++ */

Page 13: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 13/39

Step #7:-  This fast load script has successfully executed in command prompt. After

the execution fast load generated the output log file. 

Step #8:- Now we show the output log file of fast load utility. This output log file

generated with three phase's, which is following-

1.) Logon/connection

2.) Insert Phase

3.) End Loading Phase

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 13

Page 14: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 14/39

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfully

created the logon connection of fast load utility.

2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e.

insert operation. In this insert operation, we are sending all 3 records from system

generated output data file (fexp_tp_data.txt) to target table i.e. TRG_CREDIT table.

3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the

loading process into the target table. System has read total 3 records from output data

file and now applied the insert operation in all 3 records. There is no error in error table

1 and error table 2. We can manually drop both the error table from the database,

where the error table place and we are not loading any duplicate rows then total

duplicate rows is zero.

Step #9:- Now we show the target table and that target table has successfully loaded

with the help of fast load utility. This target table is denormalize table and it has

loaded. We can check the target table with the help of following sql query-

SELECT * FROM OLAP.DIM_CUSTOMER;

 This sql query help for loading the data into target table.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 14

Page 15: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 15/39

DIM_SUPPLIER

Step #10:-First we perform the load operation from multiple source tables to single

target table with the help of fast load utility. All the multiple source table is normalize

table which has placed in different database and after that we create the denormalize

table with the help of normalize table and that denormalize table place in different

database.

Step #11:- Now we use the fast export utility because this utility help for searching

the data from source tables. We create the fast export script. This script help for

searching the data.

1.) BEGIN EXPORT STATEMENT.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 15

Page 16: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 16/39

2.) DEFINE THE OUTPUT FILE NAME.

3.) THE SELECT PULLS DATA FROM TABLE (SUPPLIER_TYPE,SUPPLIERS).

4.) END THE JOB AND LOGOFF TERADATA.

Step #12:- Now we execute this fast export script in command prompt. This fast

export script generate the output data file after the successful execution.

Step #13:-  This fast export script has successfully executed and it has generated

output log file and system generated output data file. This data file hold the data which

has come with the help of sql select query.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 16

/* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE

/* @(#) FASTEXPORT SCRIPT */ SCRIPT AND AUTHOR IN

/* @(#) Version 1.1 */ COMMENTS

/* @(#) Created by BISP Team *//* ---------------------------------------------------------------*/

Page 17: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 17/39

Step #14:- Now we show the system generated output data and this data file comewith the help of fast export utility. This file is unreadable form and only system can

read this output data file.

Step #15:- Now we use the fast load utility for loading the data into target table. We

load the data from system generated output data file to empty target table. Now fast

load script are as follow-

1.) LOGIN ONTO TERADATA.

2.) DEFINING INPUT DATA FILE

3.) DEFINING THE ERROR FILES4.) FAST LOAD PERFORM END LOADING.

5.) DEFINE LOGOFF CONNECTION

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 17

 /* ++++++++++++++++++++++++++++ */ Always good to identify the

 /* FASTLOAD SCRIPT TO LOAD THE */ script and author in comment. /* OLTP.SUPPLIER,SUPPLIER_TYPE */

 /* TABLE Version 1.1 */ /* Created by BISP Team */

 /* ++++++++++++++++++++++++++++ */

Page 18: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 18/39

1.) LOGIN ONTO TERADATA:- we logon into the teradata fast load utility.

2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load

must know the structure and the name of the flat file to be used as the input flat file or

source file for loading the data.

3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement

for the error tables. This error files work as error table. Fast load automaticallygenerate both error table. In this instance, they are named err2_cust and UV_cust

table. First error table (err2_cust) contains only constraints based related error and

second error table (UV_cust) contains only unique violation error.

4.) FAST LOAD PERFORM END LOADING:-  The target table must be empty at the

loading time and if the loading has completed, then we use the END LOADING

statement. If we don't use the END LOADING statement then we get error i.e. Target

table being loaded and that time we can't access the loading data.

5.) DEFINE LOGOFF CONNECTION:- Now all the sessions has logoff. This is the

last statement of this fast load script. Now the table lock has released and if no rows in

the error table, then that error table automatically dropped and if there is any single

row in error table then we check it, then we take appropriate action and drop that

error table manually.

Step #16:- Now we execute the fast load flat file script in command prompt. This fast

load script generate the output log file after the successful execution.

Step #17:- Now this fast load script has successfully executed and it has generated

output log file.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 18

Page 19: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 19/39

Step #18:- Now we show the output log file of fast load utility. This output log filegenerated with three phase's, which is following-

1.) Logon/connection

2.) Insert Phase

3.) End Loading Phase

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 19

Page 20: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 20/39

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfullycreated the logon connection of fast load utility.

2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e.

insert operation. In this insert operation, we are sending all 12 records from system

generated output data file (sup_data.txt) to target table i.e. DIM_SUPPLIER table.

3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the

loading process into the target table. System has read total 12 records from output

data file and now applied the insert operation in all 12 records. There is no error in

error table 1 and error table 2. We can manually drop both the error table from thedatabase, where the error table place and we are not loading any duplicate rows then

total duplicate rows is zero.

Step #19:- Now the data has successfully loaded into the target table with the help of 

fast load utility. This target table has placed in different database and this target table

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 20

Page 21: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 21/39

is denormalize table. We can access the record from target table using the following sql

query-

SELECT * FROM OLAP.DIM_SUPPLIER;

 This sql select query help for showing the records from target table.

DIM_PRODUCT

Step #20:- we perform the load operation from multiple source tables to single target

table with the help of fast load utility. All the multiple source table is normalize table

which has placed in different database and after that we create the denormalize table

with the help of normalize table and that denormalize table place in different database.

1.) BEGIN EXPORT STATEMENT.

2.) DEFINE THE OUTPUT FILE NAME.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 21

Page 22: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 22/39

3.) THE SELECT PULLS DATA FROM TABLE (PRODUCTS,BRAND,CATEGORY,PACKAGING).

4.) END THE JOB AND LOGOFF TERADATA.

Step #21:- Now we execute this fast export script in command prompt. This fast

export script generate the output data file after the successful execution.

Step #22:- Fast export script has successfully executed and it has generated output

log file and system generated data file.

Step #23:- Now we are showing the data of system generated data file. This data has

in unreadable form and only system understand this data. We use this data file for

loading purpose in target table.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 22

/* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE

/* @(#) FASTEXPORT SCRIPT */ SCRIPT AND AUTHOR IN

/* @(#) Version 1.1 */ COMMENTS/* @(#) Created by BISP Team *//* ---------------------------------------------------------------*/

Page 23: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 23/39

Step #24:- Now we use the fast load utility for loading the data into target table. We

load the data from system generated output data file to empty target table. Now fast

load script are as follow-

1.) LOGIN ONTO TERADATA.

2.) DEFINING INPUT DATA FILE

3.) DEFINING THE ERROR FILES

4.) FAST LOAD PERFORM END LOADING.

5.) DEFINE LOGOFF CONNECTION

1.) LOGIN ONTO TERADATA:- we logon into the teradata fast load utility.

2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load

must know the structure and the name of the flat file to be used as the input flat file orsource file for loading the data.

3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement

for the error tables. This error files work as error table. Fast load automatically

generate both error table. In this instance, they are named err2_prod and UV_prod

table. First error table (err2_prod) contains only constraints based related error and

second error table (UV_prod) contains only unique violation error.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 23

 /* ++++++++++++++++++++++++++++ */ Always good to identify the

 /* FASTLOAD SCRIPT TO LOAD THE */ script and author in comment. /* OLTP.PRODUCTS */

 /* TABLE Version 1.1 */ /* Created by BISP Team */

 /* ++++++++++++++++++++++++++++ */

Page 24: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 24/39

4.) FAST LOAD PERFORM END LOADING:-  The target table must be empty at the

loading time and if the loading has completed, then we use the END LOADING

statement. If we don't use the END LOADING statement then we get error i.e. Target

table being loaded and that time we can't access the loading data.

5.) DEFINE LOGOFF CONNECTION:- Now all the sessions has logoff. This is the

last statement of this fast load script. Now the table lock has released and if no rows in

the error table, then that error table automatically dropped and if there is any single

row in error table then we check it, then we take appropriate action and drop that

error table manually.

Step #25:- Now we execute the fast load flat file script in command prompt. This fast

load script generate the output log file after the successful execution.

Step #26:- Fast load flat file script has successfully executed and it has generated

output log file.

Step #27:- Now we show the output log file of fast load utility. This output log file

generated with three phase's, which is following-

1.) Logon/connection

2.) Insert Phase

3.) End Loading Phase

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 24

Page 25: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 25/39

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 25

Page 26: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 26/39

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfully

created the logon connection of fast load utility.

2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e.

insert operation. In this insert operation, we are sending all 6 records from system

generated output data file (PROD_data.txt) to target table i.e. DIM_PRODUCT table.

3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the

loading process into the target table. System has read total 6 records from output data

file and now applied the insert operation in all 6 records. There is no error in error table

1 and error table 2. We can manually drop both the error table from the database,

where the error table place and we are not loading any duplicate rows then total

duplicate rows is zero.

Step #28:- Now we are showing the target table records. All the records has

successfully loaded into the denormalize target table. We are using following sql query

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 26

Page 27: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 27/39

for showing the result of target table- SELECT * FROM

OLAP.DIM_PRODUCT;

 This sql query help for showing the result of table.

DIM_EMPLOYEE:-

Step #29:-First we perform the load operation from multiple tables to single target

table with the help of fast load utility. All the multiple table is normalize table which has

placed in single database and then we create the denormalize table with the help of 

normalize table in other database.

Step #30:- First we use the fast export utility because this utility help for searching

the data from source tables.

1.) BEGIN EXPORT STATEMENT.

2.) DEFINE THE OUTPUT FILE NAME.

3.) THE SELECT PULLS DATA FROM TABLE (DEPARTMENT,EMPLOYEE).

4.) END THE JOB AND LOGOFF TERADATA.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 27

Page 28: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 28/39

Step #31:- Now we execute this fast export script in command prompt. This fast

export script generate the output data file after the successful execution.

Step #32:- Fast export script has successfully executed and it has generated output

log file and system generated data file.

Step #33:- Now we are showing the data of system generated data file. This data has

in unreadable form and only system understand this data. We use this data file for

loading purpose in target table.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 28

/* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE

/* @(#) FASTEXPORT SCRIPT */ SCRIPT AND AUTHOR IN

/* @(#) Version 1.1 */ COMMENTS/* @(#) Created by BISP Team *//* ---------------------------------------------------------------*/

Page 29: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 29/39

Step #34:- Now we use the fast load utility for loading the data into target table. We

load the data from system generated output data file to empty target table. Now fast

load script are as follow-

1.) LOGIN ONTO TERADATA.

2.) DEFINING INPUT DATA FILE

3.) DEFINING THE ERROR FILES

4.) FAST LOAD PERFORM END LOADING.5.) DEFINE LOGOFF CONNECTION

1.) LOGIN ONTO TERADATA:- we logon into the teradata fast load utility.2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load

must know the structure and the name of the flat file to be used as the input flat file or

source file for loading the data.

3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement

for the error tables. This error files work as error table. Fast load automatically

generate both error table. In this instance, they are named err2_emp and UV_emp

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 29

 /* ++++++++++++++++++++++++++++ */ Always good to identify the /* FASTLOAD SCRIPT TO LOAD THE */ script and author in comment.

 /* OLTP.PRODUCTS */

 /* TABLE Version 1.1 */ /* Created by BISP Team */

 /* ++++++++++++++++++++++++++++ */

Page 30: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 30/39

table. First error table (err2_emp) contains only constraints based related error and

second error table (UV_emp) contains only unique violation error.

4.) FAST LOAD PERFORM END LOADING:-  The target table must be empty at the

loading time and if the loading has completed, then we use the END LOADING

statement. If we don't use the END LOADING statement then we get error i.e. Target

table being loaded and that time we can't access the loading data.

5.) DEFINE LOGOFF CONNECTION:- Now all the sessions has logoff. This is the

last statement of this fast load script. Now the table lock has released and if no rows in

the error table, then that error table automatically dropped and if there is any single

row in error table then we check it, then we take appropriate action and drop that

error table manually.

Step #35:- Now we execute the fast load flat file script in command prompt. This fast

load script generate the output log file after the successful execution.

Step #36:- Fast load flat file script has successfully executed and it has generated

output log file.

Step #37:- Now we show the output log file of fast load utility. This output log file

generated with three phase's, which is following-

1.) Logon/connection

2.) Insert Phase

3.) End Loading Phase

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 30

Page 31: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 31/39

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 31

Page 32: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 32/39

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfully

created the logon connection of fast load utility.

2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e.

insert operation. In this insert operation, we are sending all 15 records from system

generated output data file (emp_data.txt) to target table i.e. DIM_EMPLOYEE table.

3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the

loading process into the target table. System has read total 15 records from output

data file and now applied the insert operation in all 15 records. There is no error in

error table 1 and error table 2. We can manually drop both the error table from the

database, where the error table place and we are not loading any duplicate rows thentotal duplicate rows is zero.

Step #38:- Now we are showing the target table records. All the records has

successfully loaded into the denormalize target table. We are using following sql query

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 32

Page 33: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 33/39

for showing the result of target table- SELECT * FROM

OLAP.DIM_EMPLOYEE;

 This sql query help for showing the result of table.

DIM_STORE:-

Step #39:-First we perform the load operation from multiple source tables to single

target table with the help of fast load utility. All the multiple source table is normalize

table which has placed in different database and after that we create the denormalize

table with the help of normalize table and that denormalize table place in different

database.

Step #40:- Now we use the fast export utility because this utility help for searching

the data from source tables. We create the fast export script. This script help for

searching the data.

1.) BEGIN EXPORT STATEMENT.

2.) DEFINE THE OUTPUT FILE NAME.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 33

Page 34: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 34/39

3.) THE SELECT PULLS DATA FROM TABLE (STORE,STORE_REGION).

4.) END THE JOB AND LOGOFF TERADATA.

Step #41:- Now we execute this fast export script in command prompt. This fast

export script generate the output data file after the successful execution.

Step #42:- Fast export script has successfully executed and it has generated output

log file and system generated data file.

Step #43:- Now we are showing the data of system generated data file. This data has

in unreadable form and only system understand this data. We use this data file for

loading purpose in target table.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 34

/* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE

/* @(#) FASTEXPORT SCRIPT */ SCRIPT AND AUTHOR IN

/* @(#) Version 1.1 */ COMMENTS/* @(#) Created by BISP Team *//* ---------------------------------------------------------------*/

Page 35: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 35/39

Step #44:- Now we use the fast load utility for loading the data into target table. We

load the data from system generated output data file to empty target table. Now fast

load script are as follow-

1.) LOGIN ONTO TERADATA.

2.) DEFINING INPUT DATA FILE

3.) DEFINING THE ERROR FILES

4.) FAST LOAD PERFORM END LOADING.

5.) DEFINE LOGOFF CONNECTION

1.) LOGIN ONTO TERADATA:- we logon into the teradata fast load utility.

2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load

must know the structure and the name of the flat file to be used as the input flat file or

source file for loading the data.

3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement

for the error tables. This error files work as error table. Fast load automatically

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 35

 /* ++++++++++++++++++++++++++++ */ Always good to identify the /* FASTLOAD SCRIPT TO LOAD THE */ script and author in comment.

 /* OLTP.STORE,STORE_REGION */ /* TABLE Version 1.1 */

 /* Created by BISP Team */ /* ++++++++++++++++++++++++++++ */

Page 36: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 36/39

generate both error table. In this instance, they are named err2_str and UV_str table.

First error table (err2_str) contains only constraints based related error and second

error table (UV_str) contains only unique violation error.

4.) FAST LOAD PERFORM END LOADING:-  The target table must be empty at the

loading time and if the loading has completed, then we use the END LOADING

statement. If we don't use the END LOADING statement then we get error i.e. Target

table being loaded and that time we can't access the loading data.

5.) DEFINE LOGOFF CONNECTION:- Now all the sessions has logoff. This is the

last statement of this fast load script. Now the table lock has released and if no rows in

the error table, then that error table automatically dropped and if there is any single

row in error table then we check it, then we take appropriate action and drop that

error table manually.

Step #45:- Now we execute the fast load flat file script in command prompt. This fast

load script generate the output log file after the successful execution.

Step #46:- Fast load flat file script has successfully executed and it has generated

output log file.

Step #47:- Now we show the output log file of fast load utility. This output log file

generated with three phase's, which is following-

1.) Logon/connection

2.) Insert Phase3.) End Loading Phase

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 36

Page 37: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 37/39

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 37

Page 38: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 38/39

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfully

created the logon connection of fast load utility.

2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e.

insert operation. In this insert operation, we are sending all 28 records from system

generated output data file (str_data.txt) to target table i.e. DIM_STORE table.

3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the

loading process into the target table. System has read total 28 records from output

data file and now applied the insert operation in all 28 records. There is no error in

error table 1 and error table 2. We can manually drop both the error table from the

database, where the error table place and we are not loading any duplicate rows then

total duplicate rows is zero.

Step #48:- Now we are showing the target table records. All the records has

successfully loaded into the denormalize target table. We are using following sql query

for showing the result of target table- SELECT * FROM OLAP.DIM_STORE;

 This sql query help for showing the result of table.

www.bispsolutions.com | www.hyperionguru.com | www.bisptrainings.com |Page 38

Page 39: Teradata Normalized Transformation

7/30/2019 Teradata Normalized Transformation

http://slidepdf.com/reader/full/teradata-normalized-transformation 39/39