book 2 - table of contents - online tutorials ( books &...

1760
Teradata in a Box Teradata Factory Student Binder #2 Course # 9038 Revision 12.3.0 Student Guide

Upload: lythu

Post on 22-Apr-2018

244 views

Category:

Documents


7 download

TRANSCRIPT

  • Teradata in a Box

    Teradata Factory

    Student Binder #2

    Course # 9038

    Revision 12.3.0

    Student Guide

  • Teradata Training

    Notes

  • Table of Contents

    Module 30 Additional Index Choices Additional Index Choices...........................................................................................................30-4 Join Indexes................................................................................................................................30-6 Options for Join Indexes ............................................................................................................30-8 Join Index Considerations ........................................................................................................30-10 Join Index Example Customer and Order Tables .................................................................30-12 Compressed Multi-Table Join Index........................................................................................30-14 Non-Compressed Multi-Table Join Index................................................................................30-16 Example 1 Does a Join Index Help? .....................................................................................30-18 Example 2 Does a Join Index Help? .....................................................................................30-20 Join Index Single Table.........................................................................................................30-22 Join Index Single Table (cont.) .............................................................................................30-24 Creating a Join Index Single Table .......................................................................................30-26 Example 3 Does the Join Index Help? ..................................................................................30-28 Why use Aggregate Join Indexes? ...........................................................................................30-30 Aggregate Join Index Properties ..............................................................................................30-32 Aggregation without an Aggregate Index ................................................................................30-34 Creating an Aggregate Join Index............................................................................................30-36 Aggregation with an Aggregate Index .....................................................................................30-38 Sparse Join Indexes..................................................................................................................30-40 Creating a Sparse Join Index....................................................................................................30-42 Creating a Sparse Join Index on Partitions ..............................................................................30-44 Global (Join) Indexes ...............................................................................................................30-46 Global Index Multiple Tables ...............................................................................................30-48 Global Index as a Hashed NUSI...........................................................................................30-50 Creating a Global Index (Hashed NUSI)..............................................................................30-52 Example: Using a Global Index as a Hashed NUSI.................................................................30-54 Repeating Row Ids in Global Index.........................................................................................30-56 Hash Indexes ............................................................................................................................30-58 Creating a Hash Index..............................................................................................................30-60 Hash Index Example 2 ..........................................................................................................30-62 Using a Hash Index for Joins Example 3 ..............................................................................30-64 Hash Index Example 3 (cont.)...............................................................................................30-66 Summary ..................................................................................................................................30-68 Review Questions ....................................................................................................................30-70 Lab Exercise 30-1 ....................................................................................................................30-72

    Book 2 - Table of Contents Page 0-3

  • Teradata Training

    Module 31 Miscellaneous SQL Features

    Teradata SQL............................................................................................................................. 31-4 SQL Version 2 Differences .................................................................................................... 31-6 SQL Session Modes................................................................................................................... 31-8 Transaction Modes Teradata................................................................................................. 31-10 Transaction Modes ANSI ..................................................................................................... 31-12 Transaction Mode Examples ................................................................................................... 31-14 Multi-Statement Requests........................................................................................................ 31-16 CASE Sensitivity Issues .......................................................................................................... 31-18 Setting the SQL Flagger .......................................................................................................... 31-20 SQLFLAG Example ................................................................................................................ 31-22 HELP SESSION Command .................................................................................................... 31-24 Why a System Calendar?......................................................................................................... 31-26 Calendar View Layout............................................................................................................. 31-28 One Row in the Calendar......................................................................................................... 31-30 Using the Calendar .................................................................................................................. 31-32 What is a Trigger? ................................................................................................................... 31-34 Trigger Example ...................................................................................................................... 31-36 Temporary Table Choices........................................................................................................ 31-40 Derived Tables Revisited......................................................................................................... 31-42 Volatile Tables......................................................................................................................... 31-44 Volatile Table Restrictions ...................................................................................................... 31-46 Global Temporary Tables ........................................................................................................ 31-48 Creating Global Temporary Tables ......................................................................................... 31-50 V2R5 New Features.............................................................................................................. 31-52 V2R6 New Features.............................................................................................................. 31-54 Teradata 12.0 New Features ................................................................................................. 31-56 Teradata Limits (Different Releases)....................................................................................... 31-58 Review Questions .................................................................................................................... 31-60

    Page 0-4 Book 2 - Table of Contents

  • Module 32 Introduction to Application Utilities

    Application Utilities ...................................................................................................................32-4 Application Utilities Environments ...........................................................................................32-6 Application Development ..........................................................................................................32-8 Transferring Large Amounts of Data.......................................................................................32-10 INSERT/SELECT: The Fast Path............................................................................................32-12 Multi-Statement Insert/Select Example ...................................................................................32-14 DELETE (ALL): The Fast Path ...............................................................................................32-16 Using an INMOD Routine .......................................................................................................32-18 Teradata Parallel Transporter...................................................................................................32-20 Teradata Parallel Transporter Operators ..................................................................................32-22 Referential Integrity and Load Utility Issues ...........................................................................32-24 Maximum Number of Load Jobs .............................................................................................32-26 Maximum Number of Load Jobs (cont.)..................................................................................32-28 Application Utility Checklist ...................................................................................................32-30 Application Utility Summary...................................................................................................32-32 Review Questions ....................................................................................................................32-34

    Book 2 - Table of Contents Page 0-5

  • Teradata Training

    Module 33 BTEQ

    BTEQ......................................................................................................................................... 33-4 Using BTEQ Conditional Logic ................................................................................................ 33-6 BTEQ Error Handling................................................................................................................ 33-8 BTEQ EXPORT Example 1 ................................................................................................. 33-10 4 Types of BTEQ .EXPORT ................................................................................................... 33-12 BTEQ Data Modes .................................................................................................................. 33-14 BTEQ EXPORT Example 2 ................................................................................................. 33-16 BTEQ EXPORT Example 3 ................................................................................................. 33-18 Indicator Variables................................................................................................................... 33-20 Determining the Logical Record Length with Fixed Length Columns ................................... 33-22 Determining the Logical Record Length with Variable Length Columns .............................. 33-24 Determining the Logical Record Length with .EXPORT INDICDATA ................................ 33-26 .IMPORT (for Network-Attached Systems)............................................................................ 33-28 .IMPORT (for Channel-Attached Systems) ............................................................................ 33-30 .PACK...................................................................................................................................... 33-32 .REPEAT ................................................................................................................................. 33-32 BTEQ IMPORT Example 1.................................................................................................. 33-34 BTEQ IMPORT Example 2.................................................................................................. 33-36 BTEQ IMPORT Example 3.................................................................................................. 33-38 Multiple Sessions..................................................................................................................... 33-40 .SET SESSIONS...................................................................................................................... 33-42 Parallel Processing Using Multiple Sessions to Access Individual Rows............................... 33-44 When Do Multiple Sessions Make Sense? .............................................................................. 33-46 Application Utility Checklist ................................................................................................... 33-48 Review Questions .................................................................................................................... 33-50 Lab Exercise 33-1 .................................................................................................................... 33-52 Lab Exercise 33-2 .................................................................................................................... 33-56

    Page 0-6 Book 2 - Table of Contents

  • Module 34 FastLoad

    FastLoad.....................................................................................................................................34-4 FastLoad Characteristics ............................................................................................................34-6 FastLoad Phase 1 .......................................................................................................................34-8 FastLoad Phase 2 .....................................................................................................................34-10 A Sample FastLoad Script .......................................................................................................34-12 Converting the Data .................................................................................................................34-14 Data Conversion Chart.............................................................................................................34-16 NULLIF ...................................................................................................................................34-18 FastLoading Zoned Decimals and Time Stamps .....................................................................34-20 FastLoad BEGIN LOADING Statement .................................................................................34-22 BEGIN LOADING Statement .................................................................................................34-22 FastLoad Error Tables..............................................................................................................34-24 Error Recovery .........................................................................................................................34-26 CHECKPOINT Option ............................................................................................................34-28 END LOADING Statement .....................................................................................................34-30 RECORD Statement ................................................................................................................34-32 INSERT Statement...................................................................................................................34-34 Staged Loading of Multiple Data Files ....................................................................................34-36 FastLoad Fails to Complete .....................................................................................................34-38 Restarting FastLoad (Output)...................................................................................................34-40 Restarting FastLoad Summary..............................................................................................34-42 Additional FastLoad Commands .............................................................................................34-44 FastLoad with Additional Options ...........................................................................................34-46 Invoking FastLoad ...................................................................................................................34-48 INMOD ....................................................................................................................................34-50 Application Utility Checklist ...................................................................................................34-52 Summary ..................................................................................................................................34-54 Review Questions ....................................................................................................................34-56 Lab Exercise 34-1 ....................................................................................................................34-58 Lab Exercise 34-2 ....................................................................................................................34-60

    Book 2 - Table of Contents Page 0-7

  • Teradata Training

    Module 35 The Support Environment

    Support Environment................................................................................................................. 35-4 Setting Up the Support Environment......................................................................................... 35-6 Invoking Utilities ....................................................................................................................... 35-8 Support Environment Commands............................................................................................ 35-10 Initializing the Log Table ........................................................................................................ 35-12 Initialization and Wrap Up Commands ................................................................................... 35-14 .ACCEPT Working with Variables ...................................................................................... 35-16 Support Environment System Variables.................................................................................. 35-18 .DISPLAY and .ROUTE Commands ...................................................................................... 35-20 Example: Using Variables in a Script...................................................................................... 35-22 Working with Control Logic ................................................................................................... 35-24 Support Environment Example Input ................................................................................... 35-26 Support Environment Example Output ................................................................................ 35-28 Teradata SQL Support ............................................................................................................. 35-30 Script Example Input ............................................................................................................ 35-32 Script Example Output ......................................................................................................... 35-34 Summary.................................................................................................................................. 35-36 Review Questions .................................................................................................................... 35-38 Lab Exercise 35-1 .................................................................................................................... 35-40

    Module 36 FastExport FastExport.................................................................................................................................. 36-4 .BEGIN and .END EXPORT..................................................................................................... 36-6 .EXPORT................................................................................................................................... 36-8 A FastExport Script ................................................................................................................. 36-10 The SELECT Request.............................................................................................................. 36-12 Impact of Requesting Sorted Output ....................................................................................... 36-14 The SORT Procedure............................................................................................................... 36-16 Multiple Exports in one FastExport Job .................................................................................. 36-18 Invoking FastExport ................................................................................................................ 36-20 FastExport and Variable Input................................................................................................. 36-22 A FastExport Script with ACCEPT......................................................................................... 36-24 A FastExport Script with LAYOUT........................................................................................ 36-26 .LAYOUT, .FIELD, and .FILLER .......................................................................................... 36-28 INMODs and OUTMODs ....................................................................................................... 36-30 OUTMOD Return Codes......................................................................................................... 36-32 Application Utility Checklist ................................................................................................... 36-34 Summary.................................................................................................................................. 36-36 Review Questions .................................................................................................................... 36-38 Lab Exercise 36-1 .................................................................................................................... 36-40 Lab Exercise 36-2 .................................................................................................................... 36-42

    Page 0-8 Book 2 - Table of Contents

  • Module 37 MultiLoad Part 1

    What is MultiLoad? ...................................................................................................................37-4 MultiLoad Limitations ...............................................................................................................37-6 How MultiLoad Works ..............................................................................................................37-8 Advantages of MultiLoad ........................................................................................................37-10 Basic MultiLoad Statements ....................................................................................................37-12 Sample MultiLoad IMPORT Task...........................................................................................37-14 IMPORT Task..........................................................................................................................37-16 5 Phases of IMPORT Task.......................................................................................................37-18 Phase 1: Preliminary ................................................................................................................37-20 Phase 2: DML Transaction ......................................................................................................37-22 Phase 3: Acquisition.................................................................................................................37-24 Phase 3: Acquisition a Closer Look......................................................................................37-26 Phase 4: Application ................................................................................................................37-28 Phase 4: Application a Closer Look......................................................................................37-30 Phase 5: Cleanup......................................................................................................................37-32 Sample MultiLoad DELETE Tasks .........................................................................................37-34 DELETE Task Differences from IMPORT Task.....................................................................37-36 A Closer Look at DELETE Task Application Phase ...............................................................37-38 MultiLoad Locks......................................................................................................................37-40 Restarting MultiLoad ...............................................................................................................37-42 RELEASE MLOAD Statement ...............................................................................................37-44 Invoking MultiLoad .................................................................................................................37-46 Application Utility Checklist ...................................................................................................37-48 Summary ..................................................................................................................................37-50 Review Questions ....................................................................................................................37-52 Lab Exercise 37-1 ....................................................................................................................37-54

    Book 2 - Table of Contents Page 0-9

  • Teradata Training

    Module 38 MultiLoad Part 2

    New Accounts Application Description ................................................................................. 38-4 .BEGIN IMPORT Task Commands ........................................................................................ 38-12 Work Tables............................................................................................................................. 38-14 Error Tables ............................................................................................................................. 38-16 ERRLIMIT .............................................................................................................................. 38-18 CHECKPOINT........................................................................................................................ 38-20 More .BEGIN Parameters........................................................................................................ 38-22 More .BEGIN Parameters: AMPCHECK .............................................................................. 38-24 DELETE Task Commands ...................................................................................................... 38-26 .LAYOUT and .TABLE .......................................................................................................... 38-28 .LAYOUT Parameters CONTINUEIF ............................................................................... 38-30 .LAYOUT Parameters INDICATORS............................................................................... 38-32 .FIELD and .FILLER............................................................................................................... 38-34 .LAYOUT Command Examples ........................................................................................ 38-36 Redefining the Input Example .............................................................................................. 38-38 The .DML Command Options................................................................................................. 38-40 MultiLoad Statistics................................................................................................................. 38-44 INMOD.................................................................................................................................... 38-46 Summary.................................................................................................................................. 38-48 Review Questions .................................................................................................................... 38-50 Lab Exercise 38-1 .................................................................................................................... 38-52 Lab Exercise 38-2 .................................................................................................................... 38-54

    Page 0-10 Book 2 - Table of Contents

  • Module 39 TPump

    TPump........................................................................................................................................39-4 TPump Limitations ....................................................................................................................39-6 .BEGIN LOAD Statement .........................................................................................................39-8 TPump Specific Parameters .....................................................................................................39-10 .BEGIN LOAD PACK and RATE .......................................................................................39-12 .BEGIN LOAD SERIALIZE OFF........................................................................................39-14 .BEGIN LOAD SERIALIZE ON .........................................................................................39-16 .BEGIN LOAD ROBUST ON..............................................................................................39-18 Sample TPump Script (1 of 2) .................................................................................................39-20 Sample TPump Script (2 of 2) .................................................................................................39-22 TPump Compared with MultiLoad ..........................................................................................39-24 Additional TPump Statements .................................................................................................39-26 Invoking TPump ......................................................................................................................39-28 TPump Statistics ......................................................................................................................39-30 TPump Monitor........................................................................................................................39-32 INMOD ....................................................................................................................................39-34 Application Utility Checklist ...................................................................................................39-36 Summary ..................................................................................................................................39-38 Review Questions ....................................................................................................................39-40 Lab Exercise 39-1 ....................................................................................................................39-42

    Module 40 Choosing a Utility

    Solution 1: Update or Delete vs. Insert/Select ...........................................................................40-4 Solution 2: SQL Update vs. MultiLoad or TPump ...................................................................40-6 Solution 3: SQL Update vs. FastLoad.......................................................................................40-8 Utility Considerations ..............................................................................................................40-10 Various Ways of Performing an Update ..................................................................................40-12 Choosing a Utility Exercise .....................................................................................................40-14

    Book 2 - Table of Contents Page 0-11

  • Teradata Training

    Module 41 Database Administration and Building the Database

    Environment Database Administration ........................................................................................................... 41-4 Initial Teradata Database ........................................................................................................... 41-6 Administrative User................................................................................................................... 41-8 Owners, Parents and Children ................................................................................................. 41-10 Creating New Users and Databases......................................................................................... 41-12 Transfer of Ownership............................................................................................................. 41-14 DELETE/DROP Statements.................................................................................................... 41-16 Teradata Administrator New System.................................................................................... 41-18 Teradata Administrator Hierarchy........................................................................................ 41-20 Summary.................................................................................................................................. 41-22 Review Questions .................................................................................................................... 41-24

    Page 0-12 Book 2 - Table of Contents

  • Module 42 The Data Dictionary

    Data Dictionary / Directory........................................................................................................42-4 Fallback Protected Data Dictionary Tables................................................................................42-6 Non-Hashed Data Dictionary Tables .........................................................................................42-8 Updating Data Dictionary Tables ............................................................................................42-10 Supplied Data Dictionary Views..............................................................................................42-12 Restricted Views ......................................................................................................................42-14 Suffix Options with Views.......................................................................................................42-16 Selecting Information about Created Objects ..........................................................................42-18 Children View ..........................................................................................................................42-20 Databases View........................................................................................................................42-22 Users View...............................................................................................................................42-24 Tables View .............................................................................................................................42-26 Columns View..........................................................................................................................42-28 Indices View.............................................................................................................................42-30 IndexConstraints View.............................................................................................................42-34 ShowTblChecks View..............................................................................................................42-36 ShowColChecks View .............................................................................................................42-38 Triggers View...........................................................................................................................42-40 AllTempTables View...............................................................................................................42-42 Referential Integrity Views ......................................................................................................42-44 Using the DBC.Tables View....................................................................................................42-46 Referential Integrity States.......................................................................................................42-48 DBC.All_RI_Children View....................................................................................................42-50 DBC.Databases2 View.............................................................................................................42-52 Time Stamps in Data Dictionary..............................................................................................42-54 Teradata Administrator List Columns of a View..................................................................42-56 Teradata Administrator Object Options ................................................................................42-58 Summary ..................................................................................................................................42-60 Review Questions ....................................................................................................................42-62 Lab Exercise 42-1 ....................................................................................................................42-64 Lab Exercise 42-2 ....................................................................................................................42-70

    Book 2 - Table of Contents Page 0-13

  • Teradata Training

    Module 43 Space Allocation and Usage

    Permanent Space Terminology.................................................................................................. 43-4 Spool Space Terminology.......................................................................................................... 43-6 Temporary Space Terminology ................................................................................................. 43-8 Resetting Peak Values ............................................................................................................. 43-10 Assigning Perm and Spool Limits ........................................................................................... 43-12 Giving One User to Another.................................................................................................... 43-14 Teradata Administrator Move Space .................................................................................... 43-16 Reserving Space for Spool....................................................................................................... 43-18 Views for Space Allocation Reporting .................................................................................... 43-20 DiskSpace View....................................................................................................................... 43-22 TableSize View........................................................................................................................ 43-24 AllSpace View......................................................................................................................... 43-26 DataBaseSpace Table .............................................................................................................. 43-28 Different Views Different Results ...................................................................................... 43-30 Additional Utilities to View Space Utilization........................................................................ 43-32 Teradata Administrator Database Menu Options ................................................................. 43-34 Teradata Administrator Object Menu Options ..................................................................... 43-36 Transient Journal Space........................................................................................................... 43-38 Ferret Utility ............................................................................................................................ 43-40 Ferret SHOWSPACE Command............................................................................................. 43-42 Ferret SHOWBLOCKS ........................................................................................................... 43-44 Review Questions .................................................................................................................... 43-48

    Page 0-14 Book 2 - Table of Contents

  • Module 44 Users, Accounts, and Accounting

    Creating New Users & Databases ..............................................................................................44-4 CREATE DATABASE Statement.............................................................................................44-6 CREATE USER Statement ........................................................................................................44-8 CREATE USER and the Data Dictionary................................................................................44-10 CREATE USER and the Data Dictionary (cont.) ....................................................................44-12 MODIFY USER Statement......................................................................................................44-14 Teradata Administrator Tools Menu > Create Options ........................................................44-16 Creating and Using Account IDs .............................................................................................44-18 Dynamically Changing an Account ID....................................................................................44-20 Account Priorities ....................................................................................................................44-22 Account String Expansion........................................................................................................44-24 ASE Accounting Example .......................................................................................................44-26 System Accounting Views .......................................................................................................44-28 AccountInfo View....................................................................................................................44-30 AMPUsage View .....................................................................................................................44-32 AMPUsage View Example ...................................................................................................44-34 Users, Accounts & Accounting Summary ...............................................................................44-36 Review Questions ....................................................................................................................44-38 Lab Exercise 44-1 ....................................................................................................................44-40

    Book 2 - Table of Contents Page 0-15

  • Teradata Training

    Module 45 Access Rights

    Privileges/Access Rights ........................................................................................................... 45-4 Access Rights Mechanisms ....................................................................................................... 45-6 CREATE TABLE Automatic Rights...................................................................................... 45-8 CREATE USER Automatic Rights ...................................................................................... 45-10 Implicit, Automatic, and Explicit Rights................................................................................. 45-12 GRANT Command.................................................................................................................. 45-14 Granting Rights at Database Level .......................................................................................... 45-16 GRANT Rights at the Table or Column Level........................................................................ 45-18 REVOKE Command ............................................................................................................... 45-20 Revoking Non-Existent Rights ................................................................................................ 45-22 Removing a Level in the Hierarchy......................................................................................... 45-24 Inheriting Access Rights.......................................................................................................... 45-26 The GIVE Statement and Access Rights ................................................................................. 45-28 Access Rights and Views......................................................................................................... 45-30 Access Rights and Nested Views ............................................................................................ 45-32 System Views for Access Rights............................................................................................. 45-34 AllRights and UserRights Views............................................................................................. 45-36 UserGrantedRights View......................................................................................................... 45-38 Teradata Administrator Grant/Revoke Rights ...................................................................... 45-40 Teradata Administrator Rights on DB/User ......................................................................... 45-42 Access Rights Summary .......................................................................................................... 45-44 Review Questions .................................................................................................................... 45-46

    Page 0-16 Book 2 - Table of Contents

  • Module 46 Roles and Profiles

    What are Roles and Profiles? .....................................................................................................46-4 Advantages of Roles ..................................................................................................................46-6 Access Rights without Roles......................................................................................................46-8 Access Rights Issues (prior to Roles).........................................................................................46-8 Access Rights Using a Role .....................................................................................................46-10 Implementing Roles .................................................................................................................46-12 Current or Active Roles ...........................................................................................................46-14 Nesting of Roles.......................................................................................................................46-16 Example of Using Nested Roles...........................................................................................46-18 Access Rights Validation and Roles ........................................................................................46-20 SQL Statements to Support Roles............................................................................................46-22 GRANT Command (SQL Form) .............................................................................................46-24 REVOKE Command (SQL Form) ...........................................................................................46-26 GRANT and REVOKE Commands (Role Form)....................................................................46-28 System Hierarchy (used in following examples) .....................................................................46-30 Example of Using Roles...........................................................................................................46-32 Example of Using Roles (cont.) ...............................................................................................46-34 Example of Using Roles (cont.) ...............................................................................................46-36 RoleInfo View..........................................................................................................................46-38 RoleMembers View .................................................................................................................46-40 DBC.AccessRights and Rights Views..................................................................................46-42 AllRoleRights and UserRoleRights Views ..............................................................................46-44 Steps to Implementing Roles ...................................................................................................46-46 Profiles .....................................................................................................................................46-48 Example of Simplifying User Management.............................................................................46-50 Implementing Profiles..............................................................................................................46-52 Impact of Profiles on Users......................................................................................................46-54 CREATE/MODIFY PROFILE Statement ...............................................................................46-56 Password Attributes (CREATE/MODIFY PROFILE) ............................................................46-58 Teradata Password Control ......................................................................................................46-60 Teradata Password Control (cont.)...........................................................................................46-62 Teradata Password Control Options ........................................................................................46-64 CREATE PROFILE Example..................................................................................................46-66 Teradata Administrator CREATE PROFILE Example ...........................................................46-68 CREATE PROFILE Example (cont.) ......................................................................................46-70 DROP PROFILE Statement.....................................................................................................46-72 ProfileInfo View ......................................................................................................................46-74 Miscellaneous SQL Functions .................................................................................................46-76 Summary ..................................................................................................................................46-78 Review Questions ....................................................................................................................46-80 Lab Exercise 46-1 ....................................................................................................................46-82 Lab Exercise 46-2 ....................................................................................................................46-86

    Book 2 - Table of Contents Page 0-17

  • Teradata Training

    Module 47 Priority Scheduler

    Levels of Workload Management ............................................................................................. 47-4 Priority Scheduler Facility......................................................................................................... 47-6 Priority Scheduler Architecture ................................................................................................. 47-8 Priority Scheduler Architecture with TDWM Workloads....................................................... 47-10 Priority Scheduler Concepts .................................................................................................... 47-12 Resource Partitions and Performance Groups ......................................................................... 47-14 Relative Weights...................................................................................................................... 47-16 Performance Periods and Milestones....................................................................................... 47-18 CPU Usage Limits with Priority Scheduler............................................................................. 47-20 Use of Performance Groups..................................................................................................... 47-22 Getting Started with Priority Scheduler................................................................................... 47-24 Schmon Utility......................................................................................................................... 47-26 Schmon Example ..................................................................................................................... 47-28 Priority Scheduler Administrator............................................................................................. 47-34 Summary.................................................................................................................................. 47-36 Review Questions .................................................................................................................... 47-38

    Page 0-18 Book 2 - Table of Contents

  • Module 48 Access Control

    System Access Control Levels...................................................................................................48-4 Teradata Password Encryption...................................................................................................48-6 Password Security Features .......................................................................................................48-8 Teradata Connectivity ..............................................................................................................48-10 Sessions and Session Pools ......................................................................................................48-12 Teradata Director Program (TDP) ...........................................................................................48-14 TDP Exits .................................................................................................................................48-16 Host Logon Processing ............................................................................................................48-18 Objects used in Host Logon Processing...................................................................................48-20 GRANT/REVOKE LOGON Statements .................................................................................48-22 GRANT/REVOKE LOGON Example ....................................................................................48-24 Session Related Views .............................................................................................................48-26 LogonRules View ....................................................................................................................48-28 LogOnOff View .......................................................................................................................48-30 SessionInfo View .....................................................................................................................48-32 Additional Utilities to View Sessions ......................................................................................48-34 Teradata Manager Sessions......................................................................................................48-36 Query Session Utility ...............................................................................................................48-38 Access Control Mechanisms ....................................................................................................48-40 Using Views to Limit Access...................................................................................................48-42 Using Macros to Reduce User SQL Complexity .....................................................................48-44 Structure the System ................................................................................................................48-46 A Recommended Access Rights Structure ..............................................................................48-48 A Recommended Structure Using Roles..................................................................................48-50 A Recommended System Hierarchy ........................................................................................48-52 System Access Controls Summary ..........................................................................................48-54 Review Questions ....................................................................................................................48-56

    Book 2 - Table of Contents Page 0-19

  • Teradata Training

    Module 49 Access and Query Logging

    Access and Query Logging........................................................................................................ 49-4 Access Logging ......................................................................................................................... 49-6 Objects used in Access Logging................................................................................................ 49-8 BEGIN LOGGING Statement ................................................................................................. 49-10 END LOGGING Statement..................................................................................................... 49-12 Setting up Access Logging ...................................................................................................... 49-14 Access Log Views ................................................................................................................... 49-16 AccLogRules View.................................................................................................................. 49-18 BEGIN LOGGING Example................................................................................................ 49-20 AccessLog View...................................................................................................................... 49-22 AccessLog View Example.................................................................................................... 49-24 END LOGGING Example.................................................................................................... 49-26 Teradata Administrator Tools Menu > Access Logging ...................................................... 49-28 Query Logging (DBQL) Concepts .......................................................................................... 49-30 Objects used in Defining Rules for DBQL.............................................................................. 49-32 Objects used in DBQL (cont.) ................................................................................................. 49-34 BEGIN QUERY LOGGING Statement .................................................................................. 49-36 BEGIN QUERY LOGGING WITH (cont.) ....................................................................... 49-38 BEGIN QUERY LOGGING LIMIT (cont.) ...................................................................... 49-40 BEGIN QUERY LOGGING Examples .................................................................................. 49-42 BEGIN QUERY LOGGING Examples (cont.)....................................................................... 49-44 BEGIN QUERY LOGGING Examples (cont.)....................................................................... 49-46 END QUERY LOGGING Statement ...................................................................................... 49-48 DBQLRules View.................................................................................................................... 49-50 QryLog View Example......................................................................................................... 49-52 QryLogSummary View Example ......................................................................................... 49-54 Teradata Administrator Tools Menu > Query Logging........................................................ 49-56 Access and Query Logging Summary ..................................................................................... 49-58 Review Questions .................................................................................................................... 49-60 Lab Exercise 49-1 .................................................................................................................... 49-62 Lab Exercise 49-2 .................................................................................................................... 49-66

    Page 0-20 Book 2 - Table of Contents

  • Module 50 Workload Management

    Levels of Workload Management..............................................................................................50-4 What is TASM? .........................................................................................................................50-6 Teradata Dynamic Workload Manager (TDWM)......................................................................50-8 TDWM Query Management Architecture ...............................................................................50-10 Query Management Architecture (cont.) .................................................................................50-12 TDWM Main Window Types of Rules.................................................................................50-14 Filters and Throttles for Query Management...........................................................................50-16 Object Access and Query Resource Filters..............................................................................50-18 Object and Load Utility Throttles ............................................................................................50-20 TDWM General Settings ......................................................................................................50-22 Object Access Filter Properties................................................................................................50-24 Query Resource Filter Properties .............................................................................................50-26 Object Throttling Properties.....................................................................................................50-28 Linking Objects to Rules..........................................................................................................50-30 Workload Definitions...............................................................................................................50-32 Creating Workloads .................................................................................................................50-34 Example of Using Workloads ..................................................................................................50-36 TDWM Create Workload Definitions...................................................................................50-38 WD Classification Criteria....................................................................................................50-40 WD Exception Criteria..........................................................................................................50-42 TDWM Specify Exception Criteria ......................................................................................50-44 Example Exception Handling ...............................................................................................50-46 TDWM Priority Scheduler....................................................................................................50-50 Teradata Workload Analyzer ...................................................................................................50-52 Teradata Query Scheduler........................................................................................................50-54 Summary ..................................................................................................................................50-56 Review Questions ....................................................................................................................50-58

    Book 2 - Table of Contents Page 0-21

  • Teradata Training

    Module 51 Teradata Manager and Performance Monitor

    Teradata Manager ...................................................................................................................... 51-4 Getting Started ........................................................................................................................... 51-6 Teradata Manager Main Window.............................................................................................. 51-8 Teradata Manager Applications............................................................................................... 51-10 Teradata Manager Dashboard.................................................................................................. 51-12 Teradata Performance Monitor................................................................................................ 51-14 Teradata Performance Monitor Chart Function....................................................................... 51-16 Teradata Performance Monitor Resource Usage.................................................................. 51-18 Teradata Performance Monitor Resource Usage Detail ....................................................... 51-20 Teradata Performance Monitor Session Information ........................................................... 51-22 Teradata Performance Monitor User Session Info ............................................................... 51-24 Teradata Performance Monitor SQL & Explain Steps ......................................................... 51-26 Teradata Manager Database Console ................................................................................... 51-28 Database Console Example ..................................................................................................... 51-30 Teradata Manager Locking Logger ...................................................................................... 51-32 Summary.................................................................................................................................. 51-34 Review Questions .................................................................................................................... 51-36

    Page 0-22 Book 2 - Table of Contents

  • Module 52 Performance Monitoring

    Performance Monitoring Tools ..................................................................................................52-4 Why Collect Resource Usage Data? ..........................................................................................52-6 Resource Usage Data .................................................................................................................52-8 Collection Costs .........................................................................................................................52-8 Filling the ResUsage Tables.....................................................................................................52-10 Specifying ResUsage Tables and Logging Rates.....................................................................52-12 Resource Usage Tables ............................................................................................................52-14 Resource Usage Views.............................................................................................................52-16 Resource Usage Macros...........................................................................................................52-18 Example Output from DBC.ResNode Macro ..........................................................................52-20 PM/API and Performance Monitor ..........................................................................................52-22 Teradata System Emulation Tool (Teradata SET) ...................................................................52-24 Performance Monitoring Summary .........................................................................................52-26 Review Questions ....................................................................................................................52-28

    Module 53 Utilities Overview and Teradata DB Window Locations from which Utilities can be Executed .......................................................................53-4 SMP and Database Window Utilities.........................................................................................53-6 Teradata Console Task...............................................................................................................53-8 Teradata Database Window .....................................................................................................53-10 DBW Supervisor Window .......................................................................................................53-12 Teradata MultiTool (Windows and Linux) ..............................................................................53-14 DB Window via MultiTool ......................................................................................................53-16 Accessing Console Utilities via the DB Window ....................................................................53-18 DBS Control Utility .................................................................................................................53-20 DBS Control Record General Fields (V2R5.1) ....................................................................53-22 DBS Control Record General Fields (TD 12.0)....................................................................53-24 DBS Control Record File System Fields ..............................................................................53-26 DBS Control Record Performance Fields .............................................................................53-28 DBS Control Record Checksum Fields.................................................................................53-30 Modifying DBS Control Parameters........................................................................................53-32 Summary ..................................................................................................................................53-34 Review Questions ....................................................................................................................53-36

    Book 2 - Table of Contents Page 0-23

  • Teradata Training

    Module 54 System Restarts

    Types of Restarts ....................................................................................................................... 54-4 Scheduled Restarts..................................................................................................................... 54-6 Restart Teradata from DB Window........................................................................................... 54-8 Restart using the tpareset Command.................................................................................... 54-10 Restart Teradata using MultiTool............................................................................................ 54-12 PDE States ............................................................................................................................... 54-14 Unscheduled Restarts............................................................................................................... 54-16 Unscheduled Restarts (cont.) ................................................................................................... 54-18 Unscheduled Restarts (cont.) ................................................................................................... 54-20 TPA Reset Crashdumps........................................................................................................ 54-22 Allocating Crashdumps Space................................................................................................. 54-24 TPA Dump Maintenance ......................................................................................................... 54-26 UNIX Panic Dumps................................................................................................................. 54-26 Review Questions .................................................................................................................... 54-28

    Module 55 Maintenance and Recovery Utilities

    Maintenance, Diagnostic, and Recovery Utilities ..................................................................... 55-4 Abort Host Utility ...................................................................................................................... 55-4 Ferret Defragment and Packdisk ............................................................................................ 55-6 Checking Data Integrity............................................................................................................. 55-8 Ferret Scandisk Utility.......................................................................................................... 55-10 Checktable Utility.................................................................................................................... 55-12 Checktable Levels of Checking ............................................................................................ 55-14 Checktable Example ............................................................................................................. 55-16 Table Rebuild Utility ............................................................................................................... 55-18 Recovery Manager Utility ....................................................................................................... 55-20 Recovery Manager Commands................................................................................................ 55-22 Rcvmanager List Status ........................................................................................................ 55-24 Rcvmanager List Locks ........................................................................................................ 55-26 Rcvmanager List Status (2nd Example)................................................................................. 55-28 Rcvmanager List Rollback Tables........................................................................................ 55-30 Rcvmanager Cancel Rollback on Table ............................................................................... 55-32 Vprocmanager.......................................................................................................................... 55-34 Showlocks Utility .................................................................................................................... 55-36 Orphan or Phantom Spool Issues............................................................................................. 55-38 Update Space Utility................................................................................................................ 55-40 Summary.................................................................................................................................. 55-42 Review Questions .................................................................................................................... 55-44

    Page 0-24 Book 2 - Table of Contents

  • Module 56 Permanent Journals

    Automatic Data Protection Mechanisms (Review)....................................................................56-4 Permanent Journals ....................................................................................................................56-6 Location of Change Images .......................................................................................................56-8 Assigning Tables to a Permanent Journal ................................................................................56-10 Creating a Permanent Journal ..................................................................................................56-12 Assigning a Permanent Journal................................................................................................56-14 Before-Image Journals .............................................................................................................56-16 After-Image Journals................................................................................................................56-18 Journal Subtables .....................................................................................................................56-20 Permanent Journal Statements .................................................................................................56-22 Recovery with Permanent Journals..........................................................................................56-24 Journals[x] View ......................................................................................................................56-26 Summary ..................................................................................................................................56-28 Review Questions ....................................................................................................................56-30

    Module 57 A Tale of Three Tables Permanent Journal Scenario.......................................................................................................57-4 Table X.......................................................................................................................................57-6 Table Y.......................................................................................................................................57-8 Table Z .....................................................................................................................................57-10 Permanent Journals ..................................................................................................................57-12 Archive Policy..........................................................................................................................57-14 Archive Scenario......................................................................................................................57-16 After Restart Processing Completes.........................................................................................57-18 After REBUILD and Restart of Teradata.................................................................................57-20 Table X Recovery ....................................................................................................................57-22 Table Y Recovery ....................................................................................................................57-24 Table Z Recovery.....................................................................................................................57-26 After Recovery .........................................................................................................................57-28 Summary ..................................................................................................................................57-30

    Book 2 - Table of Contents Page 0-25

  • Teradata Training

    Module 58 Archiving Data

    Archive and Recovery Utility (ARC) ........................................................................................ 58-4 Archive and Recovery Phases ................................................................................................... 58-6 Restore versus FastLoad ............................................................................................................ 58-8 ARC ......................................................................................................................................... 58-10 Restart Log............................................................................................................................... 58-12 Session Control........................................................................................................................ 58-14 Multiple Sessions..................................................................................................................... 58-16 ARC Statements....................................................................................................................... 58-18 ARCHIVE Statement............................................................................................................... 58-20 ARCHIVE Examples............................................................................................................... 58-22 Archiving Selected Partitions of PPI Table ............................................................................. 58-26 ARCHIVE Partition Example.................................................................................................. 58-28 ANALYZE Statement ............................................................................................................. 58-30 ANALYZE Output .................................................................................................................. 58-32 Archive Objects ....................................................................................................................... 58-34 Archive Objects (cont.)............................................................................................................ 58-36 Archive Levels......................................................................................................................... 58-38 Archive Levels (cont.) ............................................................................................................. 58-40 Archive Options....................................................................................................................... 58-42 Indexes Option......................................................................................................................... 58-44 Group Read Lock Option......................................................................................................... 58-46 Database DBC Archive............................................................................................................ 58-48 Summary.................................................................................................................................. 58-50 Review Questions .................................................................................................................... 58-52

    Page 0-26 Book 2 - Table of Contents

  • Module 59 Restoring Data

    Understanding Restore Operations ............................................................................................59-4 Restore-Related Statements .......................................................................................................59-6 The Restore Statement ...............................................................................................................59-8 Restoring Examples .................................................................................................................59-10 RESTORE Example and Output..............................................................................................59-12 Restoring Selected Partitions of PPI Table ..............................................................................59-14 RESTORE Partition Example ..................................................................................................59-16 COPY Statement ......................................................................................................................59-18 Copying Objects.......................................................................................................................59-20 Copying....................................................................................................................................59-22 BUILD Statement ....................................................................................................................59-24 RELEASE LOCK Statement ...................................................................................................59-26 Revalidate References..............................................................................................................59-28 Revalidate References Output..................................................................................................59-30 Recovery Control Data Dictionary Views ...............................................................................59-32 Association View .....................................................................................................................59-34 Events View .............................................................................................................................59-36 Restoring Data Summary .........................................................................................................59-38 Review Questions ....................................................................................................................59-40

    Module 60 Data Recovery Operations Data Recovery Using Roll Operations.......................................................................................60-4 The CHECKPOINT Statement ...........................................................................................