Teradata TPump Monitor Macros - Parallel Data Pump

Teradata® Parallel Data Pump Reference

Product
Parallel Data Pump
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-19
dita:mapPath
ioq1544831946920.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-3021
lifecycle
previous
Product Category
Teradata Tools and Utilities

Teradata TPump Monitor provides a set of macros that can be used to update the Monitor Interface table and to monitor and control individual Teradata TPump import jobs. The following Teradata TPump Monitor macros are provided:

Macro TPumpMacro. TPumpUpdateSelect

This macro is provided for database administrators to use to manipulate and monitor individual Teradata TPump jobs:

CREATE MACRO SysAdmin.TPumpUpdateSelect
(
    LogDB          VARCHAR(32),
    LogTable       VARCHAR(32),
    UserName       VARCHAR(32),
    Import         INTEGER,
    RequestChange  CHAR(1),
    StmtsUnLimited CHAR(1),
    StmtsDesired   INTEGER,
    PeriodsDesired INTEGER
)
AS
(
    LOCK ROW WRITE    /* OR LOCKING Sysadmin.TPumpStatus for WRITE */
    SELECT
        RecordsOut     ,
        RecordsSkipped ,
        RecordsRejcted ,
        RecordsRead    ,
        RecordsErrored
    FROM
        SysAdmin.TPumpStatusTbl
    WHERE
        UserName = :UserName  AND
        LogDB    = :LogDB     AND
        Import   = :Import    AND
        LogTable = :LogTable

    ; UPDATE SysAdmin.TPumpStatusTbl
    SET
        RequestChange  = :RequestChange,
        StmtsUnLimited = :StmtsUnLimited,
        StmtsDesired   = :StmtsDesired,
        PeriodsDesired = :PeriodsDesired
    WHERE
        UserName = :UserName  AND
        LogDB    = :LogDB     AND
        LogTable = :LogTable  AND
        Import   = :Import       ;
);mport   = :Import       ;
);

Macro TPumpMacro. UserUpdateSelect

The macro UserUpdateSelect is provided to monitor/update Teradata TPump jobs.

CREATE MACRO TPumpMacro.UserUpdateSelect
(
    LogDB          VARCHAR(32),
    LogTable       VARCHAR(32),
    Import         INTEGER,
    RequestChange  CHAR(1),
    StmtsUnLimited CHAR(1),
    StmtsDesired   INTEGER,
    PeriodsDesired INTEGER
)
AS
(
    LOCK ROW  WRITE /* OR LOCKING Sysadmin.TPumpStatus FOR WRITE */ SELECT
        RecordsOut     ,
        RecordsSkipped ,
        RecordsRejcted ,
        RecordsRead    ,
        RecordsErrored
    FROM
        SysAdmin.TPumpStatusTbl
    WHERE
        UserName = USER       AND
        LogDB    = :LogDB     AND
        Import   = :Import    AND
        LogTable = :LogTable

    ; UPDATE SysAdmin.TPumpStatusTbl
    SET
        RequestChange  = :RequestChange,
        StmtsUnLimited = :StmtsUnLimited,
        StmtsDesired   = :StmtsDesired,
        PeriodsDesired = :PeriodsDesired
    WHERE
        UserName = USER       AND
        LogDB    = :LogDB     AND
        LogTable = :LogTable  AND
        Import   = :Import       ;
);