Teradata Utilities - 3

download Teradata Utilities - 3

of 6

Transcript of Teradata Utilities - 3

  • 7/23/2019 Teradata Utilities - 3

    1/6

    USING INFORMATICA WITH TERADATA UTILITIES -III(Script creation)

    TPUMP:

    The basic steps involved in the TPUMP script creation:

    (a) Setting up a Logtabe an! Logging onto Te"a!ata: Thelogtable is defined using the .logtable command. The table name is

    arbitrary. However to avoid duplication, usage of target table nameis preferred. By default, the ntegration !ervice uses

    T"#$target#table#name%$partition#number%. The database

    where the table has to be located is also specified li&e in the belowe'. ()*+#B.")-#PUMP where ()*+#B is the database name

    and ")-#PUMP is the table name/. The .*U0 1"2 command isused to run the logon file.

    NOTE:The logtable in case of all the 3 loaders stores the information

    about the progress during the load.

    (b) #egin oa! p"o$e%%& a!! Pa"a'ete"%& na'ing t(e e""o"

    tabe:n this section of the script the parameters such as!2!!)0, P45+ 145T)*, 2**)* "MT are defined based on the

    re6uirements.1or e'. the P45+ 145T)* has been defined as 78

    which means that TPUMP would pac& 78 rows at a time and load.

    The error table names are also specified here.(c) De)ining t(e INPUT )at )ie:The ."49)UT command is used to

    define the layout. The different layouts supported by TPUMP are

    mentioned in )ig *. The column names and their data types are

    listed using the .12" command. The ;< is used as a separatorbetween the columns or the .1""2* command for positioning the

    cursor for the ne't field.

  • 7/23/2019 Teradata Utilities - 3

    2/6

    Fig *

    (d) De)ining t(e DML a$ti+itie% to o$$u":The 0!2*T, UP4T2

    and 2"2T2 !="s are defined in this section. The M4*+ and

    -0)*2 parameters are defined to define the type of errors to be

    stored and the ones to be neglected respectively.(e) Na'ing t(e IMPORT )ie an! !e)ining it% FORMAT: The

    .MP)*T 0"02 command is used to define the input file and its

    format. n the below e'. >5(#2'port.t't> is the input file.

    (f) A%%o$iate !ata ,it( !e%$"iption:1or the input file imported alayout such as 1"2"49)UT is specified.

    (g) Teing t(e %%te' to %ta"t oa!ing !ata "o,%: 1inally the4PP"9 .M" "4B2" to instruct TPUMP to start loading data in to the

    target tables. The e'ample below is for a simple 0!2*T script

    hence there is a single .M" label. n case of UP!2*T scriptsseparate .M" "4B2"! can also be defined and conditional

    statements can be defined in the 4PP"9 statement of .MP)*Tclause to e'ecute the labels.

    (h) Fini%(ing oa!ing an! ogging o)) o) Te"a!ata:The .20")4 command tells TPUMP to finish the load and .")-)11

    command causes TPUMP to log off and e'it from Teradata.

    http://popimage%28%27img_55%27%2C%27http//images.books24x7.com/bookimages/id_5565/fig6-1_0.jpg','1000','579')
  • 7/23/2019 Teradata Utilities - 3

    3/6

    Sa'pe Tpu'p %$"ipt .Si'pe In%e"t/

    MLOAD:

    !teps involved in a simple MU"T")4 script:

    Setting up a Logtabe: This step is similar to that of TPUMP

    using the .")-T4B"2 command followed by logging into Teradata.The order of these commands is interchangeable but it is better to

    define the logtable and then logon into Teradata. The default

    logtable name is M"#$target#table#name%. I!enti)ing t(e Ta"get& Wo"0 an! E""o" tabe%: The target,

    wor& and error table names are defined here. Their names and the

    database where they are to be located have to be specified. M")4creates them automatically. f unspecified integration service uses

    (T#$target#table#name%, 2T#$target#table#name% and

    U?#$target#table#name%.The .4T4B4!2 command can be used

    http://popimage%28%27img_58%27%2C%27http//images.books24x7.com/bookimages/id_5565/fig6-4_0.jpg','562','1000')
  • 7/23/2019 Teradata Utilities - 3

    4/6

    to specify the database for all the tables to be created or thedatabase can be defined individually for each of the tables.

    De)ining t(e INPUT )at )ie: The input flat file structure is

    defined. ata input files come in a variety of formats but Multi"oadis fle'ible enough to handle many of them. Multi"oad supports thefollowing five format options: B04*9, 14!T")4, T2@T, U01)*M4T

    and ?4*T2@T same as a TPUMP A "e)e" to )ig */

    De)ining t(e DML a$ti+itie% to o$$u": !=" for the various

    M" operation are defined .The error trac&ing conditions can also

    be defined here. M4*+ and -0)*2 parameters/. "i&e TPUMPmultiple labels can be defined for performing various M"

    operations.

    Na'ing t(e IMPORT )ie& aout an! %ta"t !ata oa!: Usingthe .MP)*T label the input file name and its format is specifiedand then the 4PP"9 label triggers the load.

    Fini%(ing oa!ing an! ogging o)) o) Te"a!ata:The .20

    M")4 command is used to finish the data load and finally the

    .")-)11 command to e'it Teradata.

    http://popimage%28%27img_39%27%2C%27http//images.books24x7.com/bookimages/id_5565/fig5-7_0.jpg','878','1000')
  • 7/23/2019 Teradata Utilities - 3

    5/6

    Sa'pe MLOAD %$"ipt .%i'pe in%e"t %$"ipt/

    FLOAD:

    Logging onto Te"a!ata:The fastload script begins by definingthe no. of sessions that would be needed to e'ecute the load

    followed by the Teradata logon. De)ining t(e Te"a!ata tabe t(at ou ,ant to oa! .ta"get

    tabe/: The structure of the empty table which has to be

    fastloaded is specified. The 5*24T2 T4B"2 statement can be usedto define the structure or the .2102 command can be used to

    define the internal flat file structure. However the usage of 5*24T2

    T4B"2 is not considered a good practice. nstead by ust defining atcolumn level using .2102 the 1astload automatically creates the

    table from the script. De)ining t(e INPUT !ata )ie:The input file structure with its

    layout type is specified. The layouts supported are T2@T,U01)*M4TT2 )* ?4*T2@T.

    Teing t(e %%te' to %ta"t oa!ing:The .B2-0 ")40-

    command is used to initiate the load. n this statement the target

    table name and the two error table names are defined. The

    5H25+P)0T parameter can also be defined in this section. Thisparameter is optional but is useful during restartability as it &eeps a

    trac& of the no. of rows loaded successfully. The 0!2*T !=" for

    loading the rows is defined below the .B2-0 ")40- label. Fini%(ing t(e oa! an! ogging o)): The last step is to logoff

    from all the sessions. 4t this point the table loc&s are released and

    error tables are dropped automatically. f however there is anyentry into the error table then the data has to be chec&ed and the

    table has to be dropped manually.

  • 7/23/2019 Teradata Utilities - 3

    6/6

    Si'pe Fa%toa! %$"ipt

    Re)e"en$e%:

    Teradata Utilities C Brea&ing the Barriers by Tom 5offingwww.teradata.com

    Cont"ibute! #:*aala&shmi!2

    Best BuyM5

    http://popimage%28%27img_26%27%2C%27http//images.books24x7.com/bookimages/id_5565/fig4-3_0.jpg','568','1000')