Loading to Teradata

download Loading to Teradata

of 58

Transcript of Loading to Teradata

  • 7/23/2019 Loading to Teradata

    1/58

    Loading to Teradata

    When you load to Teradata targets, use one of the following external loaders:

    M

    u

    lt

    il

    o

    a

    d

    .

    P

    e

    rf

    o

    r

    m

    s

    i

    n

    s

    e

    rt,

    u

    p

    d

    at

    e,

    d

    el

    ete,

    a

    n

    d

    u

    p

  • 7/23/2019 Loading to Teradata

    2/58

    s

    e

    rt

    o

    p

    e

    r

    at

    i

    o

    n

    s

    f

    o

    r

    la

    r

    g

    e

    v

    o

    l

    um

    e

    i

    n

    c

    r

    e

    m

    en

    ta

    l

    l

    o

    a

  • 7/23/2019 Loading to Teradata

    3/58

    d

    s.

    U

    s

    e

    t

    h

    is

    l

    o

    a

    d

    e

    r

    w

    h

    e

    n

    y

    o

    u

    r

    un

    a

    s

    e

    s

    si

    o

    n

    wit

    h

    a

    si

    n

    g

  • 7/23/2019 Loading to Teradata

    4/58

    le

    p

    a

    rt

    it

    i

    o

    n

    .

    M

    u

    lt

    il

    o

    a

    d

    a

    c

    q

    u

    ir

    e

    sta

    b

    le

    le

    v

    el

    l

    o

    ck

    s,

    m

    a

    k

    i

  • 7/23/2019 Loading to Teradata

    5/58

    n

    g

    it

    a

    p

    p

    r

    o

    p

    ri

    at

    e

    f

    o

    r

    o

    ff

    li

    n

    e

    l

    o

    ad

    i

    n

    g

    .

    T

    P

    um

    p

    .

    P

    e

    rf

  • 7/23/2019 Loading to Teradata

    6/58

    o

    r

    m

    s

    i

    n

    s

    e

    rt

    ,

    u

    p

    d

    at

    e,

    d

    el

    et

    e,

    a

    n

    d

    up

    s

    e

    rt

    o

    p

    e

    r

    ati

    o

    n

    s

    f

    o

  • 7/23/2019 Loading to Teradata

    7/58

    r

    r

    el

    at

    i

    v

    el

    y

    l

    o

    w

    v

    o

    l

    u

    m

    e

    u

    p

    d

    at

    e

    s.U

    s

    e

    t

    h

    is

    l

    o

    ad

    e

    r

    w

    h

    e

  • 7/23/2019 Loading to Teradata

    8/58

    n

    y

    o

    u

    r

    u

    n

    a

    s

    e

    s

    si

    o

    n

    w

    it

    h

    m

    u

    lt

    i

    p

    lep

    a

    rt

    it

    i

    o

    n

    s.

    TP

    u

    m

    p

    a

    c

  • 7/23/2019 Loading to Teradata

    9/58

    q

    u

    ir

    e

    s

    r

    o

    w

    -

    h

    a

    s

    h

    l

    o

    c

    k

    s

    o

    n

    t

    h

    eta

    b

    le

    ,

    al

    l

    o

    w

    in

    g

    o

    t

    h

    e

  • 7/23/2019 Loading to Teradata

    10/58

    r

    u

    s

    e

    rs

    t

    o

    a

    c

    c

    e

    s

    s

    t

    h

    e

    ta

    b

    le

    a

    s

    T

    Pu

    m

    p

    l

    o

    a

    d

    s

    to

    it

    .

    F

    a

  • 7/23/2019 Loading to Teradata

    11/58

    st

    L

    o

    a

    d

    .

    P

    e

    rf

    o

    r

    m

    s

    i

    n

    s

    e

    rt

    o

    p

    e

    r

    ati

    o

    n

    s

    f

    o

    r

    h

    ig

    h

    v

    o

    l

    u

  • 7/23/2019 Loading to Teradata

    12/58

    m

    e

    i

    n

    it

    ia

    l

    l

    o

    a

    d

    s,

    o

    r

    f

    o

    r

    h

    i

    g

    h

    v

    ol

    u

    m

    e

    tr

    u

    n

    c

    ate

    a

    n

    d

    r

    el

  • 7/23/2019 Loading to Teradata

    13/58

    o

    a

    d

    o

    p

    e

    r

    at

    i

    o

    n

    s.

    U

    s

    e

    t

    h

    is

    l

    o

    a

    d

    er

    w

    h

    e

    n

    y

    o

    u

    ru

    n

    a

    s

    e

    s

  • 7/23/2019 Loading to Teradata

    14/58

    si

    o

    n

    w

    it

    h

    a

    si

    n

    g

    le

    p

    a

    rt

    it

    i

    o

    n

    .

    U

    s

    e

    th

    is

    l

    o

    a

    d

    e

    r

    on

    e

    m

    p

    t

    y

  • 7/23/2019 Loading to Teradata

    15/58

    ta

    b

    le

    s

    w

    it

    h

    n

    o

    s

    e

    c

    o

    n

    d

    a

    r

    y

    i

    n

    d

    e

    e

    s.

    If you use a Teradata external loader to perform update or upsert operations, use the Target Update

    Override option in the Mapping Designer to override the UPDT! statement in the external loader "ontrol

    file# $or upsert, the I%&!'T statement in the external loader "ontrol file remains un"hanged#

    Rules and Guidelines for Teradata External Loaders

    Use the following rules and guidelines when you use external loaders to load to Teradata:

    T

    h

    e

    !

    n

  • 7/23/2019 Loading to Teradata

    16/58

    te

    g

    r

    at

    i

    o

    n

    "

    e

    r

    v

    ic

    e

    c

    a

    n

    u

    s

    e

    T

    e

    r

    ad

    at

    a

    e

    te

    r

    n

    all

    o

    a

    d

    e

    rs

  • 7/23/2019 Loading to Teradata

    17/58

    t

    o

    l

    o

    a

    d

    fi

    e

    d

    -

    w

    i

    d

    t

    h

    a

    n

    d

    d

    el

    i

    mit

    e

    d

    fl

    at

    fi

    le

    s

    to

    a

    T

    e

    r

    a

  • 7/23/2019 Loading to Teradata

    18/58

    d

    at

    a

    d

    at

    a

    b

    a

    s

    e.

    "

    i

    n

    c

    e

    al

    l

    T

    e

    r

    a

    d

    ata

    l

    o

    a

    d

    e

    rs

    d

    eli

    m

    it

    i

    n

    d

  • 7/23/2019 Loading to Teradata

    19/58

    i

    v

    i

    d

    u

    al

    r

    e

    c

    o

    r

    d

    s

    u

    si

    n

    g

    t

    h

    e

    li

    n

    e-

    f

    e

    e

    d

    #$

    n

    %

    ch

    a

    r

    a

    ct

    e

  • 7/23/2019 Loading to Teradata

    20/58

    r,

    y

    o

    u

    c

    a

    n

    n

    o

    t

    u

    s

    e

    t

    h

    e

    li

    n

    e

    -

    f

    e

    ed

    c

    h

    a

    r

    a

    ct

    e

    ra

    s

    a

    d

    el

    i

  • 7/23/2019 Loading to Teradata

    21/58

    m

    it

    e

    r

    f

    o

    r

    T

    e

    r

    a

    d

    at

    a

    l

    o

    a

    d

    e

    rs

    .

    !fa

    s

    e

    s

    si

    o

    n

    c

    on

    ta

    i

    n

    s

    o

  • 7/23/2019 Loading to Teradata

    22/58

    n

    e

    p

    a

    rt

    it

    i

    o

    n

    ,

    t

    h

    e

    ta

    r

    g

    et

    o

    u

    t

    p

    u

    tfi

    le

    n

    a

    m

    e,

    i

    n

    clu

    d

    i

    n

    g

    t

  • 7/23/2019 Loading to Teradata

    23/58

    h

    e

    fi

    le

    e

    te

    n

    si

    o

    n

    ,

    m

    u

    st

    n

    o

    t

    e

    c

    e

    ed

    &

    '

    c

    h

    a

    r

    a

    cte

    rs

    .

    !f

    t

    h

  • 7/23/2019 Loading to Teradata

    24/58

    e

    s

    e

    s

    si

    o

    n

    c

    o

    n

    ta

    i

    n

    s

    m

    u

    lt

    i

    p

    le

    p

    a

    rtit

    i

    o

    n

    s,

    t

    h

    e

    tar

    g

    et

    o

    u

    t

  • 7/23/2019 Loading to Teradata

    25/58

    p

    u

    t

    fi

    le

    n

    a

    m

    e,

    i

    n

    cl

    u

    d

    i

    n

    g

    t

    h

    e

    fi

    le

    e

    te

    n

    si

    o

    n

    ,

    m

    ust

    n

    o

    t

    e

  • 7/23/2019 Loading to Teradata

    26/58

    c

    e

    e

    d

    &

    (

    c

    h

    a

    r

    a

    ct

    e

    rs

    .

    U

    s

    e

    t

    h

    e

    Te

    r

    a

    d

    at

    a

    e

    ter

    n

    al

    l

    o

    a

  • 7/23/2019 Loading to Teradata

    27/58

    d

    e

    rs

    t

    o

    l

    o

    a

    d

    m

    u

    lt

    i

    b

    y

    te

    d

    at

    a.

    )

    o

    uc

    a

    n

    n

    o

    t

    u

    s

    et

    h

    e

    T

    e

    r

  • 7/23/2019 Loading to Teradata

    28/58

    a

    d

    at

    a

    e

    te

    r

    n

    al

    l

    o

    a

    d

    e

    rs

    t

    o

    l

    o

    a

    d

    bi

    n

    a

    r

    y

    d

    at

    a.

    *

    h

    e

    n

    y

    o

  • 7/23/2019 Loading to Teradata

    29/58

    u

    l

    o

    a

    d

    t

    o

    T

    e

    r

    a

    d

    at

    a

    u

    si

    n

    g

    n

    a

    m

    e

    dp

    i

    p

    e

    s,

    s

    et

    t

    he

    c

    h

    e

    c

    k

  • 7/23/2019 Loading to Teradata

    30/58

    p

    o

    i

    n

    t

    v

    al

    u

    e

    t

    o

    +

    t

    o

    p

    r

    e

    v

    e

    n

    t

    e

    te

    r

    n

    al

    l

    o

    a

    d

    ers

    fr

    o

    m

    p

  • 7/23/2019 Loading to Teradata

    31/58

    e

    rf

    o

    r

    m

    i

    n

    g

    c

    h

    e

    c

    k

    p

    o

    i

    n

    t

    o

    p

    e

    r

    ati

    o

    n

    s.

    )

    o

    u

    ca

    n

    s

    p

    e

    ci

  • 7/23/2019 Loading to Teradata

    32/58

    f

    y

    e

    rr

    o

    r,

    l

    o

    g

    ,

    o

    r

    w

    o

    r

    k

    ta

    b

    le

    n

    a

    m

    es,

    d

    e

    p

    e

    n

    d

    i

    ng

    o

    n

    t

    h

    e

  • 7/23/2019 Loading to Teradata

    33/58

    l

    o

    a

    d

    e

    r

    y

    o

    u

    u

    s

    e.

    )

    o

    u

    c

    a

    n

    al

    s

    o

    s

    pe

    ci

    f

    y

    e

    rr

    o

    r,

    lo

    g

    ,

    o

    r

    w

  • 7/23/2019 Loading to Teradata

    34/58

    o

    r

    k

    d

    at

    a

    b

    a

    s

    e

    n

    a

    m

    e

    s.

    )

    o

    u

    c

    a

    n

    ov

    e

    rr

    i

    d

    e

    t

    h

    ec

    o

    n

    tr

    o

    l

  • 7/23/2019 Loading to Teradata

    35/58

    fi

    le

    i

    n

    t

    h

    e

    s

    e

    s

    si

    o

    n

    p

    r

    o

    p

    e

    rt

    ie

    s.

    *h

    e

    n

    y

    o

    u

    u

    s

    eT

    e

    r

    a

    d

    at

  • 7/23/2019 Loading to Teradata

    36/58

    a,

    y

    o

    u

    c

    a

    n

    e

    n

    te

    r

    P

    m

    u

    ll

    P

    a

    s

    s

    w

    d

    as

    t

    h

    e

    d

    at

    a

    b

    as

    e

    p

    a

    s

    s

  • 7/23/2019 Loading to Teradata

    37/58

    w

    o

    r

    d

    t

    o

    p

    r

    e

    v

    e

    n

    t

    t

    h

    e

    p

    a

    s

    s

    w

    o

    rd

    fr

    o

    m

    a

    p

    p

    ea

    ri

    n

    g

    i

    n

  • 7/23/2019 Loading to Teradata

    38/58

    t

    h

    e

    c

    o

    n

    tr

    o

    l

    fi

    le

    .

    !

    n

    st

    e

    a

    d

    ,

    t

    h

    e

    !n

    te

    g

    r

    at

    i

    o

    n

    "e

    r

    v

    ic

    e

    w

  • 7/23/2019 Loading to Teradata

    39/58

    ri

    te

    s

    a

    n

    e

    m

    p

    t

    y

    st

    ri

    n

    g

    f

    o

    r

    t

    h

    e

    p

    a

    ss

    w

    o

    r

    d

    i

    n

    t

    he

    c

    o

    n

    tr

    o

  • 7/23/2019 Loading to Teradata

    40/58

    l

    fi

    le

    .

    Overriding the Control File

    When you edit the loader "onne"tion in a session, you "an override the "ontrol file# (ou might want to

    override the "ontrol file to "hange some loader properties that you "annot edit in the loader "onne"tion# $or

    example, you "an spe"ify the tra"ing option in the "ontrol file#

    When you override the "ontrol file, the Wor)flow Manager saves the "ontrol file to the repository# The

    Integration &ervi"e uses the saved "ontrol file when you run the session and for ea"h su*se+uent session

    run until you "lear the "ontrol file attri*ute# If you "hange a target or loader "onne"tion setting after you edit

    the "ontrol file, the "ontrol file does not in"lude those "hanges# To in"lude those "hanges, you must generate

    the "ontrol file again and edit it#

    If you do not override the "ontrol file, the Integration &ervi"e generates a new "ontrol file *ased on the

    session and loader properties ea"h time you run a session# The Integration &ervi"e generates the "ontrol file

    in the output file dire"tory# It overwrites ea"h time you run the session#

    Note:The Wor)flow Manager does not validate the "ontrol file syntax# Teradata verifies the "ontrol file

    syntax when you run a session# If the "ontrol file is invalid, the session fails#

    (ou "an view the edited "ontrol file *y opening the ontrol $ile !ditor#

    To override a "ontrol file:

    .

    !n

    th

    e

    *

    or

    kf

    lo

    w

    M

    an

    ag

    er,

    op

  • 7/23/2019 Loading to Teradata

    41/58

    en

    th

    e

    se

    ssi

    on

    pr

    op

    ert

    ie

    s.

    &

    .

    l

    ick

    th

    e

    M

    ap

    pi

    ng

    ta

    ban

    d

    op

    en

    th

    e

    Tr

    an

    sfor

    m

    ati

    on

    s

    vi

  • 7/23/2019 Loading to Teradata

    42/58

    e

    w.

    /

    .

    l

    ick

    th

    e

    Ta

    rg

    et

    s

    no

    de.

    0

    .

    !n

    th

    e

    on

    ne

    ction

    s

    se

    tti

    ng

    s,

    in

    th

    e1a

    lu

    e

    fie

    ld,

    cli

  • 7/23/2019 Loading to Teradata

    43/58

    ck

    ha

    ng

    e.

    (

    .

    !n

    th

    e

    on

    tr

    ol

    2ile

    on

    te

    nt

    3

    ve

    rri

    defie

    ld,

    cli

    ck

    3

    pe

    n.

    T

    he

    on

    tr

    ol

    2i

  • 7/23/2019 Loading to Teradata

    44/58

    le

    4

    dit

    or

    di

    al

    og

    bo

    ap

    pe

    ar

    s.

    5

    .

    l

    ic

    k

    6

    en

    er

    at

    e.

    T

    he

    *

    or

    kf

    lo

    w

    M

    an

    ag

    er

    ge

    ne

    rat

    es

  • 7/23/2019 Loading to Teradata

    45/58

    th

    e

    co

    nt

    ro

    l

    fil

    e

    ba

    se

    d

    on

    th

    e

    se

    ssi

    on

    an

    d

    lo

    ad

    er

    prop

    ert

    ie

    s.

    '

    .

    4

    dit

    th

    ege

    ne

    rat

    ed

    co

    nt

  • 7/23/2019 Loading to Teradata

    46/58

    ro

    l

    fil

    e

    an

    d

    cli

    ck

    3

    7

    to

    sa

    ve

    th

    e

    ch

    an

    ge

    s.

    Configuring External Loading in a Session

    -efore you "an "onfigure external loading in a session, you must "reate an external loader "onne"tion in the

    Wor)flow Manager and "onfigure the external loader attri*utes#

    omplete the following steps to use an external loader for a session:

    .

    on

    fi

    gu

    re

    th

    e

    se

    ssi

    on

    to

  • 7/23/2019 Loading to Teradata

    47/58

    wr

    ite

    to

    fla

    t

    fil

    e

    in

    st

    ea

    d

    of

    to

    a

    rel

    ati

    on

    al

    da

    ta

    ba

    se.

    &

    .

    on

    fi

    gu

    re

    th

    e

    fil

    epr

    op

    ert

    ie

    s.

  • 7/23/2019 Loading to Teradata

    48/58

    /

    ."e

    le

    ct

    an

    e

    ter

    na

    l

    lo

    ad

    er

    co

    nn

    ec

    tio

    n

    in

    th

    e

    se

    ssi

    on

    prop

    ert

    ie

    s.

    Configuring a Session to Write to a File

    To use an external loader, "reate the target definition in the mapping a""ording to the target data*ase type#

    The session "onfigures a relational target type *y default# To sele"t an external loader "onne"tion, you must

    "onfigure the session to write to a file instead of a relational target# To "onfigure the session to write to a

    file, "hange the writer type from relational writer to file writer# (ou "hange the writer type using the Writers

    settings on the Mapping ta*#

    To "hange the writer type for the target, sele"t the target instan"e and "hange the writer type from

    'elational Writer to $ile Writer#

  • 7/23/2019 Loading to Teradata

    49/58

    Configuring File Properties

    fter you "onfigure the session to write to a file, you "an set the file properties# (ou need to spe"ify the

    output file name and dire"tory, and the re.e"t file name and dire"tory# (ou "onfigure these properties in the

    Properties settings on the Mapping ta*# To set the file properties, sele"t the target instan"e#

    The following ta*le shows the attri*utes in Properties settings:

    Attribute

    3utput 2ile 8irectory

    3utput 2ilename

    9e:ect 2ile 8irectory

    9e:ect 2ilename

    "et 2ile Properties

    Note:Do not sele"t Merge Partitioned $iles or enter a merge file name# (ou "annot merge partitioned output

    files when you use an external loader#

    Seleting an External Loader Connetion

    fter you "onfigure file properties, you "an sele"t the external loader "onne"tion# To sele"t the external

    loader "onne"tion, "hoose the "onne"tion type and the "onne"tion o*.e"t# (ou "onfigure "onne"tion options

    in the onne"tions settings on the Mapping ta*#

  • 7/23/2019 Loading to Teradata

    50/58

    If the session "ontains multiple partitions, and you "hoose a loader that "an load from multiple output files,

    you "an sele"t a different "onne"tion for ea"h partition, *ut ea"h "onne"tion must *e of the same type# $or

    example, you "an sele"t different Teradata TPump external loader "onne"tions for ea"h partition, *ut you

    "annot sele"t a Teradata TPump "onne"tion for one partition and an Ora"le "onne"tion for another partition#

    If the session "ontains multiple partitions, and you "hoose a loader that "an load from only one output file,

    use round/ro*in partitioning to route data to a single target file# (ou "an "hoose a loader for ea"h

    "onne"tion, *ut the Integration &ervi"e uses the "onne"tion for the first partition#

    To sele"t an external loader "onne"tion:

    . 3n the Mapping tab, select the target instance in the avigator.

    &

    . "elect the ;oader connection type.

    /

    . lick the 3pen button in the 1alue field.

    0

    ."elect a connection ob:ect or variable