Teradata Factory: Vantage Advanced SQL Engine 9038 - Factory.pdfTeradata Factory: Vantage Advanced...

34
Table of Contents Teradata Factory: Vantage Advanced SQL Engine Version 16.20.9 Module 0 Course Overview Course Materials .......................................................................................................................... 0-2 PDF Comment and Markup Tools ............................................................................................... 0-3 Example of Highlighter and Sticky Note Tools ........................................................................... 0-4 Example of Add Text Tool .......................................................................................................... 0-5 Open PDF file at Last Page Viewed ............................................................................................ 0-6 Course Description....................................................................................................................... 0-7 Who Should Attend and Prerequisites ......................................................................................... 0-8 Class Format and Rules ............................................................................................................... 0-9 Outline of the Two Weeks ......................................................................................................... 0-10 Teradata Certification Exams .................................................................................................... 0-11 Module 1 Teradata Overview Objectives .................................................................................................................................... 1-2 What is Teradata? ........................................................................................................................ 1-3 Teradata A Brief History .......................................................................................................... 1-4 Teradata The Beginning............................................................................................................ 1-5 What is a Data Warehouse? ......................................................................................................... 1-6 What is a Relational Database?.................................................................................................... 1-7 Answering Questions with a Relational Database ....................................................................... 1-8 Teradata's Competitive Advantages............................................................................................. 1-9 Teradata Vantage ....................................................................................................................... 1-10 What is the Vantage Advanced SQL Engine? ........................................................................... 1-11 Teradata Everywhere™ ............................................................................................................. 1-12 Module 1: Review Questions ..................................................................................................... 1-13

Transcript of Teradata Factory: Vantage Advanced SQL Engine 9038 - Factory.pdfTeradata Factory: Vantage Advanced...

Table of Contents

Teradata Factory: Vantage Advanced SQL Engine

Version 16.20.9

Module 0 – Course Overview

Course Materials .......................................................................................................................... 0-2

PDF Comment and Markup Tools ............................................................................................... 0-3

Example of Highlighter and Sticky Note Tools ........................................................................... 0-4

Example of Add Text Tool .......................................................................................................... 0-5

Open PDF file at Last Page Viewed ............................................................................................ 0-6

Course Description ....................................................................................................................... 0-7

Who Should Attend and Prerequisites ......................................................................................... 0-8

Class Format and Rules ............................................................................................................... 0-9

Outline of the Two Weeks ......................................................................................................... 0-10

Teradata Certification Exams .................................................................................................... 0-11

Module 1 – Teradata Overview

Objectives .................................................................................................................................... 1-2

What is Teradata? ........................................................................................................................ 1-3

Teradata – A Brief History .......................................................................................................... 1-4

Teradata – The Beginning ............................................................................................................ 1-5

What is a Data Warehouse? ......................................................................................................... 1-6

What is a Relational Database? .................................................................................................... 1-7

Answering Questions with a Relational Database ....................................................................... 1-8

Teradata's Competitive Advantages ............................................................................................. 1-9

Teradata Vantage ....................................................................................................................... 1-10

What is the Vantage Advanced SQL Engine? ........................................................................... 1-11

Teradata Everywhere™ ............................................................................................................. 1-12

Module 1: Review Questions ..................................................................................................... 1-13

Module 2 – Teradata Basics

Objectives .................................................................................................................................... 2-2

Major Components of Teradata ................................................................................................... 2-3

Teradata Storage Architecture ..................................................................................................... 2-4

Teradata Retrieval Architecture ................................................................................................... 2-5

Multiple Tables on Multiple AMPs ............................................................................................. 2-6

Teradata Objects .......................................................................................................................... 2-7

The Data Dictionary Directory (DD/D) ....................................................................................... 2-8

Structured Query Language (SQL) .............................................................................................. 2-9

CREATE TABLE – Example of DDL ...................................................................................... 2-10

Views ......................................................................................................................................... 2-11

Multi-Table Views ..................................................................................................................... 2-12

Macros........................................................................................................................................ 2-13

HELP Commands ...................................................................................................................... 2-14

SHOW Command ...................................................................................................................... 2-15

EXPLAIN Facility ..................................................................................................................... 2-16

Summary .................................................................................................................................... 2-17

Module 2: Review Questions ..................................................................................................... 2-18

Module 3 – Teradata Architecture

Objectives .................................................................................................................................... 3-2

Vantage Advanced SQL Engine and MPP Systems .................................................................... 3-3

Teradata Functional Overview ..................................................................................................... 3-4

Channel-Attached Client Software Overview ............................................................................. 3-5

Network-Attached Client Software Overview ............................................................................. 3-6

The Parsing Engine ...................................................................................................................... 3-7

Message Passing Layer ................................................................................................................ 3-8

The Access Module Processor (AMP) ......................................................................................... 3-9

Parallelism.................................................................................................................................. 3-10

Linear Growth and Expandability .............................................................................................. 3-11

Module 3: Review Questions ..................................................................................................... 3-12

Module 4 – Teradata Databases and Users

Objectives .................................................................................................................................... 4-2

Advanced SQL Engine System Hierarchy ................................................................................... 4-3

What is a Database? ..................................................................................................................... 4-4

What is a User? ............................................................................................................................ 4-5

Database – User Comparison ....................................................................................................... 4-6

Teradata's Hierarchy and Perm Space ......................................................................................... 4-7

Example of a System Hierarchy .................................................................................................. 4-8

Permanent Space .......................................................................................................................... 4-9

Spool Space ................................................................................................................................ 4-10

Temporary Space ....................................................................................................................... 4-11

Creating Tables .......................................................................................................................... 4-12

Data Types ................................................................................................................................. 4-13

Access Rights and Privileges ..................................................................................................... 4-14

Module 4: Review Questions ..................................................................................................... 4-15

Module 5 – PI Access and Mechanics

Objectives .................................................................................................................................... 5-2

Primary Keys and Primary Indexes ............................................................................................. 5-3

Distribution of Rows .................................................................................................................... 5-4

Specifying a Primary Index ......................................................................................................... 5-5

Primary Index Values .................................................................................................................. 5-6

Accessing Via a Unique Primary Index ....................................................................................... 5-7

Accessing Via a Non-Unique Primary Index ............................................................................... 5-8

Row Distribution Using a UPI – Case 1 ...................................................................................... 5-9

Row Distribution Using a NUPI – Case 2 ................................................................................. 5-10

Row Distribution Using a Highly Non-Unique Primary Index (NUPI) – Case 3 ..................... 5-11

Which AMP has the Row? ......................................................................................................... 5-12

Hashing Down to the AMPs ...................................................................................................... 5-13

A Hashing Example ................................................................................................................... 5-14

The Hash Map ............................................................................................................................ 5-15

Hash Maps for Different Systems .............................................................................................. 5-16

Identifying Rows ........................................................................................................................ 5-17

The Row ID................................................................................................................................ 5-18

Storing Rows .............................................................................................................................. 5-19

Locating a Row On An AMP Using a PI ................................................................................... 5-21

Module 5: Review Questions ..................................................................................................... 5-22

Module 6 – Secondary Indexes and Table Scans

Objectives .................................................................................................................................... 6-2

Secondary Indexes ....................................................................................................................... 6-3

Choosing a Secondary Index ....................................................................................................... 6-4

Unique Secondary Index (USI) Access ....................................................................................... 6-5

Non-Unique Secondary Index (NUSI) Access ............................................................................ 6-6

Comparison of Primary and Secondary Indexes .......................................................................... 6-7

Full Table Scans ........................................................................................................................... 6-8

Module 6: Review Questions ....................................................................................................... 6-9

Module 7 – Teradata Studio

Objectives .................................................................................................................................... 7-2

Teradata SQL Tools ..................................................................................................................... 7-3

Additional Teradata Studio Features ........................................................................................... 7-4

Defining a Connection ................................................................................................................. 7-5

Connecting to a Teradata System ................................................................................................ 7-7

Query Development: Main Window ............................................................................................ 7-8

Data Source Explorer Tree ........................................................................................................... 7-9

Creating and Executing a Query ................................................................................................ 7-11

Dragging Object Names to the Query Window ......................................................................... 7-12

Query Options ............................................................................................................................ 7-13

Viewing Query Results .............................................................................................................. 7-14

SQL Query Builder .................................................................................................................... 7-15

Teradata SQL History Window ................................................................................................. 7-16

General Options ......................................................................................................................... 7-17

Connecting to Multiple Data Sources ........................................................................................ 7-18

Importing a LOB into Teradata .................................................................................................. 7-19

Selecting from a Table with a LOB ........................................................................................... 7-20

Displaying a JPG Large Object .................................................................................................. 7-21

Teradata Studio Summary .......................................................................................................... 7-22

Module 7: Review Questions ..................................................................................................... 7-23

Lab Exercise 7-1 ........................................................................................................................ 7-24

Module 8 – Teradata System Architecture

Objectives .................................................................................................................................... 8-2

Teradata Releases......................................................................................................................... 8-3

Vantage Advanced SQL Engine Architecture ............................................................................. 8-4

Teradata – Multiple Nodes ........................................................................................................... 8-5

MPP Systems ............................................................................................................................... 8-6

Example of 2+1 Node System ..................................................................................................... 8-7

Teradata Cliques .......................................................................................................................... 8-8

BYNET ........................................................................................................................................ 8-9

Vproc Inter-Process Communication ......................................................................................... 8-10

Fabric Architecture Enables Flexibility ..................................................................................... 8-11

BYNET 1U Switches ................................................................................................................. 8-12

Larger BYNET Configurations .................................................................................................. 8-13

Examples of Teradata Platforms ................................................................................................ 8-14

IntelliFlexTM 2.1 Cabinet Example .......................................................................................... 8-15

Vantage Cabinet Example with Analytics Nodes ...................................................................... 8-16

What Makes Teradata’s MPP Platforms Special? ..................................................................... 8-17

Summary .................................................................................................................................... 8-18

Module 8: Review Questions ..................................................................................................... 8-19

Module 9 – Data Protection

Objectives .................................................................................................................................... 9-2

Data Protection Features .............................................................................................................. 9-3

Disk Arrays .................................................................................................................................. 9-4

RAID Technologies ..................................................................................................................... 9-5

RAID 1 – Mirroring ..................................................................................................................... 9-6

RAID 1 Summary ........................................................................................................................ 9-7

RAID 6 – Data Parity Protection with 2 Parity Drives ................................................................ 9-8

Cliques ......................................................................................................................................... 9-9

Teradata Vproc Migration .......................................................................................................... 9-10

Hot Standby Nodes (HSN)......................................................................................................... 9-11

Performance Degradation with Node Failure ............................................................................ 9-12

Fallback ...................................................................................................................................... 9-13

Fallback Clusters ........................................................................................................................ 9-14

RAID, GHS, and Fallback Protection ........................................................................................ 9-15

Fallback and RAID 1 Example .................................................................................................. 9-16

Fallback vs. non-Fallback Tables Summary .............................................................................. 9-21

Clusters and Cliques .................................................................................................................. 9-22

Locks .......................................................................................................................................... 9-23

Locking Modifier ....................................................................................................................... 9-24

Rules of Locking ........................................................................................................................ 9-25

Access Locks ............................................................................................................................. 9-26

WAL – Write-Ahead Logging ................................................................................................... 9-27

WAL Concepts ........................................................................................................................... 9-28

Transient Journal ........................................................................................................................ 9-29

Recovery Journal for Down AMPs ............................................................................................ 9-30

Permanent Journal ...................................................................................................................... 9-31

Archiving and Recovering Data................................................................................................. 9-32

Teradata Unity ........................................................................................................................... 9-33

Module 9: Review Questions ..................................................................................................... 9-34

Module 10 – Introduction to MPP Systems

Objectives .................................................................................................................................. 10-2

Teradata Systems ....................................................................................................................... 10-3

Cabinet or Rack Pictures ............................................................................................................ 10-4

Teradata IntelliFlex™ Features ................................................................................................. 10-5

Fabric Architecture Enables Flexibility ..................................................................................... 10-6

Teradata IntelliFlex™ ................................................................................................................ 10-7

Teradata IntelliFlexTM 2.1 Example ......................................................................................... 10-8

Teradata IntelliBaseTM ............................................................................................................. 10-9

Teradata 6800 ........................................................................................................................... 10-10

Teradata 6800H Example ........................................................................................................ 10-11

Teradata 28xx Data Warehouse Appliance .............................................................................. 10-12

Teradata 2800 Cabinet ............................................................................................................. 10-13

Teradata Extended Nodes ........................................................................................................ 10-14

Teradata Platforms over Time ................................................................................................. 10-15

What is the BYNET? ............................................................................................................... 10-16

BYNET 1U Switches ............................................................................................................... 10-17

Larger BYNET Configurations ................................................................................................ 10-18

Server Management (SM) ........................................................................................................ 10-19

Summary .................................................................................................................................. 10-20

Module 10: Review Questions ................................................................................................. 10-21

Module 11 – How Teradata uses MPP Systems

Objectives .................................................................................................................................. 11-2

Teradata and the Processing Node ............................................................................................. 11-3

Memory and the Vantage Advanced SQL Engine ..................................................................... 11-4

Node Memory – Summary......................................................................................................... 11-5

Linux Managed Memory and FSG Cache ................................................................................. 11-6

Linux Vproc Number Assignment ............................................................................................. 11-7

Disk Arrays from an Linux Perspective ..................................................................................... 11-8

Logical Units and Partitions ....................................................................................................... 11-9

Teradata and Disk Arrays ........................................................................................................ 11-10

Teradata 2850 Logical View .................................................................................................... 11-11

Teradata 6800H (3+1) Logical View ....................................................................................... 11-12

Example of 6800H Vdisk ......................................................................................................... 11-13

Cylinder – AMP Allocation Unit ............................................................................................. 11-14

Teradata File System Concepts ................................................................................................ 11-15

Cylinder Index Segregation ..................................................................................................... 11-16

Full Cylinder Read ................................................................................................................... 11-17

Summary .................................................................................................................................. 11-18

Module 11: Review Questions ................................................................................................. 11-19

Module 12 – Teradata Virtual Storage

Objectives .................................................................................................................................. 12-2

Teradata Virtual Storage Concepts ............................................................................................ 12-4

Teradata Virtual Storage Terminology ...................................................................................... 12-5

TVS Operational Modes ............................................................................................................ 12-6

Expanding Data Storage Concept .............................................................................................. 12-7

Multi-Temperature Concepts ..................................................................................................... 12-8

Storage Performance vs. Data Temperature .............................................................................. 12-9

Teradata with Hybrid Storage .................................................................................................. 12-10

What Goes Where? .................................................................................................................. 12-11

Multi-Temperature Data Example ........................................................................................... 12-12

Teradata Systems with WI-SSD and RI-SSD .......................................................................... 12-13

Expanding Temperature-Based Capabilities ............................................................................ 12-14

Teradata Intelligent Memory (TIM) ........................................................................................ 12-15

Summary .................................................................................................................................. 12-16

Module 12: Review Questions ................................................................................................. 12-17

Module 13 – Physical Database Design Overview

Objectives .................................................................................................................................. 13-2

The Stages of Database Development ....................................................................................... 13-3

Example of Data Model – ER Diagram ..................................................................................... 13-4

Customer Service Logical Model (ERA Methodology Diagram) ............................................. 13-5

Relational Terms Review ........................................................................................................... 13-6

Attributes.................................................................................................................................... 13-7

Entities and Relationships .......................................................................................................... 13-8

Domains ..................................................................................................................................... 13-9

Decomposable Data ................................................................................................................. 13-10

Data Conversions ..................................................................................................................... 13-11

Comparing Character to Numeric Data ................................................................................... 13-12

Data Conversion Example ....................................................................................................... 13-13

Normal Forms .......................................................................................................................... 13-14

Normalization .......................................................................................................................... 13-15

Normalization Example ........................................................................................................... 13-16

Denormalizations ..................................................................................................................... 13-21

Derived Data ............................................................................................................................ 13-22

Pre-Joins ................................................................................................................................... 13-23

Choose Indexes ........................................................................................................................ 13-24

Tables Index Selection ............................................................................................................. 13-25

Database Design Components ................................................................................................. 13-26

Extended Logical Data Model ................................................................................................. 13-27

Physical Data Model ................................................................................................................ 13-28

The Principles of Index Selection ............................................................................................ 13-29

Transactions and Parallel Processing ....................................................................................... 13-30

Module 13: Review Questions ................................................................................................. 13-31

Module 14 – Analyze Primary Index Criteria

Objectives .................................................................................................................................. 14-2

Primary Index Choice Criteria ................................................................................................... 14-3

Primary Index Defaults .............................................................................................................. 14-4

CREATE TABLE – Indexing Rules .......................................................................................... 14-5

Exercise 1: Order of Preference Exercise .................................................................................. 14-6

Primary Index Characteristics .................................................................................................... 14-7

Multi-Column Primary Indexes ................................................................................................. 14-8

Primary Index Considerations.................................................................................................... 14-9

PKs and Duplicate Rows ......................................................................................................... 14-10

NUPI Duplicate Row Check .................................................................................................... 14-11

Primary Index Demographics .................................................................................................. 14-12

Column Distribution Demographics for a PI Candidate .......................................................... 14-13

SQL to View Data Demographics ........................................................................................... 14-14

Example of Using Data Demographic SQL ............................................................................. 14-15

TableSize View ........................................................................................................................ 14-16

Using SQL to Predict Row Distribution .................................................................................. 14-17

E-R Diagram for Exercises ...................................................................................................... 14-18

Exercise 2 – Example ............................................................................................................... 14-19

Exercise 2: Choosing PI Candidates Exercise ......................................................................... 14-20

Identity Column – Overview ................................................................................................... 14-26

Identity Column – Implementation .......................................................................................... 14-27

Identity Column – Example 1 .................................................................................................. 14-28

Identity Column – Example 2 .................................................................................................. 14-29

Identity Column – Considerations ........................................................................................... 14-30

What is a NoPI Table? ............................................................................................................. 14-31

Reasons to Consider Using NoPI Tables ................................................................................. 14-32

Creating a Table without a PI .................................................................................................. 14-33

Distribution of Rows (or Blocks) for a NoPI Table ................................................................. 14-34

The Row ID for a NoPI Table .................................................................................................. 14-35

Multiple NoPI Tables at the AMP Level ................................................................................. 14-37

Loading Data into a NoPI Table (SQL) ................................................................................... 14-38

Loading Data into a NoPI Table (Utility) ................................................................................ 14-39

NoPI Table Options ................................................................................................................. 14-40

Summary .................................................................................................................................. 14-41

Module 14: Review Questions ................................................................................................. 14-42

Lab Exercise 14-1 .................................................................................................................... 14-44

Lab Exercise 14-2 .................................................................................................................... 14-46

Lab Exercise 14-3 (optional: 1 of 2) ........................................................................................ 14-47

Lab Exercise 14-3 (optional: 2 of 2) ........................................................................................ 14-48

Module 15 – Data Distribution and Hashing

Objectives .................................................................................................................................. 15-2

Data Distribution ........................................................................................................................ 15-3

Hashing ...................................................................................................................................... 15-4

Hash Related Expressions .......................................................................................................... 15-5

Hashing – Numeric Data Types ................................................................................................. 15-6

Multi-Column Hashing .............................................................................................................. 15-7

Additional Hash Examples ........................................................................................................ 15-8

Using Hash Functions to View Distribution .............................................................................. 15-9

Primary Index Hash Mapping .................................................................................................. 15-10

Hash Maps ............................................................................................................................... 15-11

Primary Hash Map ................................................................................................................... 15-12

Hash Maps for Different Systems ............................................................................................ 15-13

Fallback Hash Map .................................................................................................................. 15-14

Reconfiguration ........................................................................................................................ 15-15

MAPS Reconfiguration (16.10 feature) ................................................................................... 15-16

Sparse Maps ............................................................................................................................. 15-17

Row Retrieval via PI Value – Overview .................................................................................. 15-18

Names and Object IDs ............................................................................................................. 15-19

Table ID ................................................................................................................................... 15-20

Table ID Example .................................................................................................................... 15-21

Row ID ..................................................................................................................................... 15-22

AMP File System – Locating a Row via PI ............................................................................. 15-23

Teradata File System Overview ............................................................................................... 15-24

Data Block Layout ................................................................................................................... 15-25

Example of Locating a Row – Master Index ........................................................................... 15-26

Example of Locating a Row – Cylinder Index ........................................................................ 15-27

Example of Locating a Row – Data Block .............................................................................. 15-28

Accessing the Row within the Data Block .............................................................................. 15-29

AMP Read I/O Summary ......................................................................................................... 15-30

Module 15: Review Questions ................................................................................................. 15-31

Module 16 – File System Writes

Objectives .................................................................................................................................. 16-2

AMP Write I/O .......................................................................................................................... 16-3

New Row Insert – Master Index Access .................................................................................... 16-4

New Row Insert – Cylinder Index Access ................................................................................. 16-5

New Row Insert – use Free Space within Block ........................................................................ 16-6

New Row Insert – Expand the Block ......................................................................................... 16-7

Block and Row Terminology ..................................................................................................... 16-9

Block Splits (INSERT and UPDATE) ..................................................................................... 16-10

Cylinder Full ............................................................................................................................ 16-11

Mini-Cylpack ........................................................................................................................... 16-12

Space Utilization ...................................................................................................................... 16-13

Merge Datablocks .................................................................................................................... 16-14

File System Write Summary .................................................................................................... 16-16

Module 16: Review Questions ................................................................................................. 16-17

Module 17 – Row Partitioning

Objectives .................................................................................................................................. 17-2

What is Row Partitioning? ......................................................................................................... 17-3

How is Partitioning Implemented? ............................................................................................ 17-4

Logical Example of Row Partitioning ....................................................................................... 17-5

Primary Index Access (non-partitioned table) ........................................................................... 17-6

Primary Index Access (row partitioned table) ........................................................................... 17-7

Why Partition a Table? .............................................................................................................. 17-8

Advantages/Disadvantages of Partitioning ................................................................................ 17-9

Partitioning Considerations ...................................................................................................... 17-10

PARTITION BY Option .......................................................................................................... 17-11

Partitioning with CASE_N and RANGE_N ............................................................................ 17-12

Partitioning with RANGE_N – Example ................................................................................. 17-13

RANGE_N – Example with Varying Intervals ....................................................................... 17-18

Partitioning – Example using Column Expression .................................................................. 17-19

Special Partitions with CASE_N and RANGE_N ................................................................... 17-20

Special Partition Examples ...................................................................................................... 17-21

Partitioning with CASE_N – Example .................................................................................... 17-22

SQL Use of PARTITION Key Word ....................................................................................... 17-23

SQL Use of CASE_N .............................................................................................................. 17-24

ALTER TABLE – Row Partitioned Tables ............................................................................. 17-25

ALTER TABLE – NO RANGE is not Defined....................................................................... 17-26

ALTER TABLE – NO RANGE is Defined ............................................................................. 17-27

ALTER TABLE – Example..................................................................................................... 17-28

ALTER TABLE TO CURRENT ............................................................................................. 17-29

ALTER TABLE TO CURRENT – Example........................................................................... 17-30

Row Partitioning Enhancements .............................................................................................. 17-31

Multilevel Row Partitioned Concepts ...................................................................................... 17-32

Multilevel Partitioning – Example ........................................................................................... 17-34

How is a ML Partition # Calculated? ....................................................................................... 17-36

ADD Partitions Option – Example .......................................................................................... 17-37

Character Partitioning .............................................................................................................. 17-38

Character Partitioning – Example ............................................................................................ 17-39

Summary .................................................................................................................................. 17-40

Module 17: Review Questions ................................................................................................. 17-41

Lab Exercise 17-1 .................................................................................................................... 17-43

Module 18 – Teradata Columnar

Objectives .................................................................................................................................. 18-2

Teradata Columnar Benefits ...................................................................................................... 18-4

No Primary Index Table DDL ................................................................................................... 18-5

The No Primary Index Table ..................................................................................................... 18-6

Column Partition Table DDL (without Auto-Compression) ..................................................... 18-7

Column Partition Container (No Automatic Compression) ....................................................... 18-8

The Column Partition Table (without Auto-Compression) ....................................................... 18-9

CP Table Query #1 (without Auto-Compression) ................................................................... 18-10

Column Partitioning – 2nd Example........................................................................................ 18-12

Column Partition Table DDL (with Auto-Compression) ........................................................ 18-13

Auto-Compression for CP Tables ............................................................................................ 18-14

Auto-Compression Techniques for CP Tables ........................................................................ 18-15

User-Defined Compression Techniques .................................................................................. 18-16

Column Partition Container (Automatic Compression) .......................................................... 18-17

The Column Partition Table (with Auto-Compression) .......................................................... 18-18

CP Table Query #2 (with Auto-Compression) ........................................................................ 18-19

CP Table with Row Partitioning DDL ..................................................................................... 18-20

The Column Partition Table (with Row Partitioning) ............................................................. 18-21

CP Table with Multi-Column Container DDL ........................................................................ 18-22

The CP Table with Multi-Column Container .......................................................................... 18-23

CP Table Hybrid Row & Column Store DDL ......................................................................... 18-24

The CP Table (with Hybrid Row & Column Store) ................................................................ 18-25

Populating a CP Table ............................................................................................................. 18-26

DELETE Considerations ......................................................................................................... 18-27

UPDATE and USI/NUSI Considerations ................................................................................ 18-28

CP Table Restrictions .............................................................................................................. 18-29

TD 14.10 Columnar Enhancements ......................................................................................... 18-30

TD 15.10 Primary AMP ........................................................................................................... 18-31

TD 15.10 Primary Index .......................................................................................................... 18-32

Summary .................................................................................................................................. 18-33

Module 18: Review Questions ................................................................................................. 18-34

Lab Exercise 18-1 .................................................................................................................... 18-35

Module 19 – Secondary Index Usage

Objectives .................................................................................................................................. 19-2

Secondary Indexes ..................................................................................................................... 19-3

Defining Secondary Indexes ...................................................................................................... 19-4

Secondary Index Subtables ........................................................................................................ 19-5

USI Subtable General Row Layout ............................................................................................ 19-6

USI Hash Mapping .................................................................................................................... 19-7

NUSI Subtable General Row Layout ......................................................................................... 19-8

NUSI Hash Mapping.................................................................................................................. 19-9

Table Access – A Complete Example ..................................................................................... 19-10

Secondary Index Considerations.............................................................................................. 19-11

Single and Dual NUSI Access ................................................................................................. 19-12

NUSI Bit Mapping ................................................................................................................... 19-13

Value-Ordered NUSIs .............................................................................................................. 19-14

Range Accesses for a NUSI ..................................................................................................... 19-15

Hash-Ordered NUSIs ............................................................................................................... 19-16

Example of Hash-Ordered NUSI ............................................................................................. 19-17

Covering Indexes ..................................................................................................................... 19-18

NUSI vs. Full Table Scan (FTS) .............................................................................................. 19-20

Full Table Scans – Sync Scans ................................................................................................ 19-21

Module 19: Review Questions ................................................................................................. 19-22

Module 20 – Analyze Secondary Index Criteria

Objectives .................................................................................................................................. 20-2

Accessing Rows ......................................................................................................................... 20-3

Row Selection ............................................................................................................................ 20-4

Secondary Index Considerations................................................................................................ 20-5

Secondary Index Usage.............................................................................................................. 20-6

Secondary Index Candidate Guidelines ..................................................................................... 20-7

Value and Range Access ............................................................................................................ 20-8

Change Rating ............................................................................................................................ 20-9

Exercise 3 – Example ............................................................................................................... 20-10

Exercise 3: Choosing SI Candidates Exercise ......................................................................... 20-11

Optimizer Access Scenarios .................................................................................................... 20-17

Secondary Index Overhead ...................................................................................................... 20-18

Transient Journal I/O ............................................................................................................... 20-19

INSERT and DELETE Operations .......................................................................................... 20-20

UPDATE Operations ............................................................................................................... 20-21

Primary Index Value Update ................................................................................................... 20-22

Summary – Access Method Comparison ................................................................................. 20-23

Module 20: Review Questions ................................................................................................. 20-24

Module 21 – Temporal

Objectives .................................................................................................................................. 21-2

Teradata Temporal ..................................................................................................................... 21-3

Nontemporal Example ............................................................................................................... 21-4

Nontemporal Example (INSERT).............................................................................................. 21-5

Nontemporal Example (UPDATE) ............................................................................................ 21-6

Nontemporal Example – Query ................................................................................................. 21-7

Temporal Time ........................................................................................................................... 21-8

Temporal Rows .......................................................................................................................... 21-9

Bi-Temporal Table DDL (ANSI Temporal) ............................................................................ 21-10

INSERTs (ANSI Temporal) .................................................................................................... 21-11

UPDATE (ANSI Temporal) .................................................................................................... 21-12

UPDATE Option (ANSI Temporal) ........................................................................................ 21-13

DELETE (ANSI Temporal) ..................................................................................................... 21-14

UPDATE #2 (ANSI Temporal) ............................................................................................... 21-15

Employee Table (using ANSI Temporal Commands) ............................................................. 21-16

SELECT (ANSI Temporal) ..................................................................................................... 21-17

ANSI vs. Teradata Temporal Example .................................................................................... 21-18

Temporal Syntax Differences .................................................................................................. 21-19

Teradata Temporal Extensions ................................................................................................ 21-20

INSERTs into an ANSI Temporal Table ................................................................................. 21-22

UPDATE (Teradata Temporal) ................................................................................................ 21-23

DELETE (Teradata Temporal) ................................................................................................ 21-24

UPDATE #2 (Teradata Temporal) ........................................................................................... 21-25

Employee Table (using Teradata Temporal Commands) ........................................................ 21-26

SELECT – AS OF (Example 1) ............................................................................................... 21-27

SELECT – AS OF (Example 2) ............................................................................................... 21-28

VALIDTIME SELECT ............................................................................................................ 21-29

NONSEQUENCED SELECT ................................................................................................. 21-30

Teradata Temporal Functions .................................................................................................. 21-31

Teradata Temporal Operators .................................................................................................. 21-32

Temporal Considerations ......................................................................................................... 21-33

Summary .................................................................................................................................. 21-34

Module 21: Review Questions ................................................................................................. 21-35

Module 22 – Referential Integrity

Objectives .................................................................................................................................. 22-2

Three Types of Referential Constraints ..................................................................................... 22-4

Reference Index Subtables ......................................................................................................... 22-5

Reference Index Example – Add REFERENCES ..................................................................... 22-6

Reference Index Example – INSERTs ...................................................................................... 22-7

Reference Index Example – UPDATEs ..................................................................................... 22-8

Reference Index Example – DELETEs ..................................................................................... 22-9

Fixing Referential Integrity Problems ..................................................................................... 22-10

Batch Referential Integrity ....................................................................................................... 22-11

Soft Referential Integrity ......................................................................................................... 22-12

Referential Integrity Example .................................................................................................. 22-13

Join Optimization with RI ........................................................................................................ 22-15

Summary .................................................................................................................................. 22-17

Module 22: Review Questions ................................................................................................. 22-18

Module 23 – Sizing

Objectives .................................................................................................................................. 23-2

Row and Block Size Limits ....................................................................................................... 23-3

1 MB Row Data Classes ............................................................................................................ 23-4

General Row Format .................................................................................................................. 23-5

Presence Bits .............................................................................................................................. 23-6

NULL and COMPRESS ............................................................................................................ 23-7

Multi-value Compression........................................................................................................... 23-8

Presence Bits and Compression Example .................................................................................. 23-9

Implementing Multi-value Compression ................................................................................. 23-10

ALTER TABLE and Compression .......................................................................................... 23-11

Teradata Compression Capabilities ......................................................................................... 23-12

Algorithmic Compression Example ......................................................................................... 23-13

Miscellaneous Compression Considerations ........................................................................... 23-14

Teradata Compression Comparison ......................................................................................... 23-15

Sizing a Data Row Considerations .......................................................................................... 23-16

Teradata Data Types ................................................................................................................ 23-17

INTEGER Data Types ............................................................................................................. 23-18

DECIMAL and FLOAT Data Types ....................................................................................... 23-19

NUMBER Data Type ............................................................................................................... 23-20

DATE and TIME Data Types .................................................................................................. 23-21

CHARACTER Data Types ...................................................................................................... 23-22

Character Sets .......................................................................................................................... 23-23

BYTE Data Types .................................................................................................................... 23-24

Large Object Data Types ......................................................................................................... 23-25

Variable Column Offsets ......................................................................................................... 23-26

Table Headers .......................................................................................................................... 23-27

Sizing Tables and Indexes ....................................................................................................... 23-28

Sizing Techniques .................................................................................................................... 23-29

Empirical Sizing ....................................................................................................................... 23-30

COLLECT DEMOGRAPHICS Command ............................................................................. 23-31

COLLECT DEMOGRAPHICS Example ................................................................................ 23-32

Spool Space .............................................................................................................................. 23-33

Release of Spool ...................................................................................................................... 23-34

System Sizing Exercise ............................................................................................................ 23-35

Summary .................................................................................................................................. 23-36

Module 23: Review Questions ................................................................................................. 23-37

Lab Exercise 23-1 .................................................................................................................... 23-38

Lab Exercise 23-2 .................................................................................................................... 23-39

Lab Exercise 23-3 (optional) ................................................................................................... 23-41

Module 24 – SQL Parser

Objectives .................................................................................................................................. 24-2

LAN or Channel Parcels ............................................................................................................ 24-3

Request Parcel ............................................................................................................................ 24-4

The Data Parcel .......................................................................................................................... 24-5

SQL Parser Overview ................................................................................................................ 24-6

Software Cache .......................................................................................................................... 24-7

Request-to-Steps Cache ............................................................................................................. 24-8

Request-to-Steps Cache Check .................................................................................................. 24-9

Request-To-Steps Cache Logic ................................................................................................ 24-10

Dictionary Cache ..................................................................................................................... 24-11

Statistics Cache ........................................................................................................................ 24-12

Syntaxer ................................................................................................................................... 24-13

Resolver ................................................................................................................................... 24-14

Security .................................................................................................................................... 24-15

Optimizer ................................................................................................................................. 24-16

Generator .................................................................................................................................. 24-17

Apply and Dispatcher .............................................................................................................. 24-18

SQL Parser Review .................................................................................................................. 24-19

Incremental Planning and Execution (IPE) .............................................................................. 24-20

Parser Summary ....................................................................................................................... 24-21

Module 24: Review Questions ................................................................................................. 24-22

Module 25 – Optimizer and Collecting Statistics

Objectives .................................................................................................................................. 25-2

Teradata Optimizer .................................................................................................................... 25-3

Optimizer Statistics .................................................................................................................... 25-4

Optimizer’s Search for Statistics ............................................................................................... 25-5

Optimizer – Random AMP Samples.......................................................................................... 25-6

Random AMP Sampling – How it Works ................................................................................. 25-7

Example of an Optimizer Estimate without Collected Statistics ............................................... 25-8

Statistics ..................................................................................................................................... 25-9

Statistics Data – What is Collected? ........................................................................................ 25-10

Table Level Statistics Data ...................................................................................................... 25-12

Table Level Summary Statistics .............................................................................................. 25-13

Column Detail Statistics .......................................................................................................... 25-14

COLLECT STATISTICS Command ....................................................................................... 25-16

COLLECT STATISTICS Command (Index Format with 14.0 Options) ................................ 25-17

Collecting Statistics Example .................................................................................................. 25-18

Refresh or Re-Collect Statistics ............................................................................................... 25-19

Viewing Statistics .................................................................................................................... 25-20

Collect Statistics Using Sample ............................................................................................... 25-21

Collecting Statistics (Additional Options) ............................................................................... 25-22

Optimizer’s use of Statistics with Uneven NUSI .................................................................... 25-23

Collecting Statistics on PARTITION ...................................................................................... 25-24

Copying STATISTICS............................................................................................................. 25-25

Statistics Extrapolation ............................................................................................................ 25-26

Additional Features and Considerations .................................................................................. 25-27

Teradata Re-Collect Enhancements ......................................................................................... 25-28

Teradata AutoStats features ..................................................................................................... 25-29

Statistics Summary ................................................................................................................... 25-30

Module 25: Review Questions ................................................................................................. 25-31

Module 26 – The EXPLAIN Facility

Objectives .................................................................................................................................. 26-2

EXPLAIN Facility Output ......................................................................................................... 26-4

EXPLAIN – SELECT with PI value ......................................................................................... 26-5

EXPLAIN – SELECT (FTS) ..................................................................................................... 26-6

EXPLAIN Terminology ............................................................................................................. 26-7

14.10 EXPLAIN Terminology & Modifiers .............................................................................. 26-9

15.10 EXPLAIN Terminology................................................................................................. 26-10

16.00 EXPLAIN Terminology................................................................................................. 26-12

16.10 EXPLAIN Terminology................................................................................................. 26-13

16.20 EXPLAIN Terminology................................................................................................. 26-14

Pseudo Table Locks ................................................................................................................. 26-15

Understanding Row and Time Estimates (Part 1).................................................................... 26-16

Understanding Row and Time Estimates (Part 2).................................................................... 26-17

EXPLAIN – CREATE TABLE ............................................................................................... 26-18

EXPLAIN Macro ..................................................................................................................... 26-19

EXPLAIN Terminology for Partitioned Tables ....................................................................... 26-20

EXPLAIN – Partition Elimination ........................................................................................... 26-21

EXPLAIN – Primary Index Access of a Partitioned Table ..................................................... 26-22

EXPLAIN – Dynamic Partition Elimination ........................................................................... 26-23

EXPLAIN – Delete Rows in Partitioned Table ....................................................................... 26-24

Summary .................................................................................................................................. 26-25

Module 26: Review Questions ................................................................................................. 26-26

Lab Exercise 26-1 .................................................................................................................... 26-27

Lab Exercise 26-2 .................................................................................................................... 26-28

Module 27 – Join Processing Analysis

Objectives .................................................................................................................................. 27-2

Join Syntax ................................................................................................................................. 27-3

Inner Join Examples – ON and WHERE ................................................................................... 27-4

LEFT Outer Join Example ......................................................................................................... 27-5

RIGHT Outer Join Example ...................................................................................................... 27-6

FULL Outer Join Example ......................................................................................................... 27-7

Join Processing........................................................................................................................... 27-8

Optimizer Minimizes Spool Usage ............................................................................................ 27-9

Row Selection .......................................................................................................................... 27-10

Join Redistribution ................................................................................................................... 27-11

Duplicating a Table in Spool ................................................................................................... 27-13

General Join Distribution Strategies ........................................................................................ 27-14

Merge Join ............................................................................................................................... 27-15

Merge Join Strategy ................................................................................................................. 27-16

Merge Join – Matching Primary Indexes ................................................................................. 27-17

Merge Join – Row Redistribution ............................................................................................ 27-18

Merge Join – Duplicate the Smaller Table .............................................................................. 27-19

Nested Joins ............................................................................................................................. 27-20

Product Join ............................................................................................................................. 27-21

Cartesian Product ..................................................................................................................... 27-22

Product Join – Duplicate the Smaller Table ............................................................................ 27-23

Hash Join .................................................................................................................................. 27-24

Exclusion Joins ........................................................................................................................ 27-25

Exclusion Join Example ........................................................................................................... 27-26

Inclusion Joins ......................................................................................................................... 27-27

n-Table Joins ............................................................................................................................ 27-28

Join Considerations with Partitioned Tables............................................................................ 27-29

Non-partitioned to Partitioned Table Join (Few Partitions) ..................................................... 27-30

Non-partitioned to Partitioned Table Join (Many Partitions) .................................................. 27-31

Non-partitioned to Partitioned Table Join (Sliding Window).................................................. 27-32

Non-partitioned to Partitioned Table Join (Sliding Window – cont.) ...................................... 27-33

Non-partitioned to Partitioned Table Join (Hash Ordered Spool File Join) ............................ 27-34

Partitioned to Partitioned Table Join (Rowkey Match Scan) ................................................... 27-35

Partitioned to Partitioned Table Join (Unmatched Partitions) ................................................. 27-36

Additional Join Options with Partitioned Tables ..................................................................... 27-37

Join Processing Summary ........................................................................................................ 27-38

Module 27: Review Questions ................................................................................................. 27-39

Module 28 – Explains of Joins and Index Choices

Objectives .................................................................................................................................. 28-2

Join Diagramming ...................................................................................................................... 28-3

Nested Join ................................................................................................................................. 28-4

Merge Join (Matching Primary Indexes) ................................................................................... 28-5

Hash Join .................................................................................................................................... 28-6

Merge Join (Joining a Table to Itself) ........................................................................................ 28-7

Three-Table Join ........................................................................................................................ 28-8

Product Join ............................................................................................................................. 28-10

A “UNION” Solution ............................................................................................................... 28-12

Cartesian Product Join ............................................................................................................. 28-14

Exclusion Join .......................................................................................................................... 28-15

Example of Joining 2 Partitioned Tables ................................................................................. 28-16

PRPD Join Explain Text .......................................................................................................... 28-17

Teradata PRPD Join Example .................................................................................................. 28-18

PRPD One Relation Skewed on a Non-PI Column ................................................................. 28-19

Join Access............................................................................................................................... 28-21

Exercise 4 – Example ............................................................................................................... 28-22

Exercise 4: Making Final Index Choices Exercise .................................................................. 28-23

Summary – Index Choice Guidelines ...................................................................................... 28-29

Module 28: Review Questions ................................................................................................. 28-30

Module 29 – Additional Index Options

Objectives .................................................................................................................................. 29-2

Additional Index Choices .......................................................................................................... 29-3

Join Indexes ............................................................................................................................... 29-4

Options for Join Indexes ............................................................................................................ 29-5

Join Index Considerations .......................................................................................................... 29-6

Join Index Example Customer and Order Tables ...................................................................... 29-7

Non-Compressed Multi-Table Join Index ................................................................................. 29-8

Compressed Multi-Table Join Index .......................................................................................... 29-9

Compressed and Non-Compressed Join Indexes ..................................................................... 29-10

Example 1 – Does a Join Index Help? ..................................................................................... 29-11

Example 2 – Does a Join Index Help? ..................................................................................... 29-12

Example 3 – Partitioning a Join Index ..................................................................................... 29-13

Join Index – Single Table ........................................................................................................ 29-14

Creating a Join Index – Single Table ....................................................................................... 29-16

Example 4 – Does the Join Index Help? .................................................................................. 29-17

Why use Aggregate Join Indexes? ........................................................................................... 29-18

Aggregate Join Index Properties .............................................................................................. 29-19

Aggregation without an Aggregate Index ................................................................................ 29-20

Creating an Aggregate Join Index ............................................................................................ 29-21

Example 5: Aggregation with an AJI ....................................................................................... 29-22

Sparse Join Indexes .................................................................................................................. 29-23

Creating a Sparse Join Index.................................................................................................... 29-24

Creating a Sparse Join Index on a Partitioned Table ............................................................... 29-25

ALTERing a Join Index to CURRENT ................................................................................... 29-26

Partitioning a Sparse Join Index .............................................................................................. 29-27

Global (Join) Indexes ............................................................................................................... 29-28

Global Index – Multiple Tables ............................................................................................... 29-29

Global Index as a “Hashed NUSI” ........................................................................................... 29-30

Creating a Global Index (“Hashed NUSI”) ............................................................................. 29-31

Example 6: Using a Global Index as a Hashed NUSI ............................................................. 29-32

Repeating Row IDs in Global Index ........................................................................................ 29-33

Hash Indexes ............................................................................................................................ 29-34

Example 7: Hash Index ............................................................................................................ 29-35

Summary .................................................................................................................................. 29-37

Module 29: Review Questions ................................................................................................. 29-38

Lab Exercise 29-1 .................................................................................................................... 29-39

Lab Exercise 29-2 (optional: 1 of 3) ........................................................................................ 29-42

Lab Exercise 29-2 (optional: 2 of 3) ........................................................................................ 29-43

Lab Exercise 29-2 (optional: 3 of 3) ........................................................................................ 29-44

Module 30 – JSON & DATASET Data Type

Objectives .................................................................................................................................. 30-2

Internet of Things ....................................................................................................................... 30-3

JSON Data Sources .................................................................................................................... 30-4

Example of the Internet of Things ............................................................................................. 30-5

What is JSON (j-sahn) ? ............................................................................................................ 30-6

JSON Syntax Explained ............................................................................................................. 30-7

Building a Complex Object (1) .................................................................................................. 30-8

Building a Complex Object (2) .................................................................................................. 30-9

Building a Complex Object (3) ................................................................................................ 30-10

Creating and Using JSON Data Type ...................................................................................... 30-11

Adding new feature to Example of the Internet of Things ...................................................... 30-13

Adding to the JSON Data Values ............................................................................................ 30-14

Teradata 15.10 JSON enhancements ....................................................................................... 30-15

Teradata 16.00 JSON enhancements ....................................................................................... 30-16

Teradata DATASET Data Type ............................................................................................... 30-17

CSV DATASET Data Type ..................................................................................................... 30-18

CSV Schema ............................................................................................................................ 30-19

CSV Schema example .............................................................................................................. 30-20

CSV Basic DDL example ........................................................................................................ 30-21

CSV Basic DML example ....................................................................................................... 30-22

Summary .................................................................................................................................. 30-23

Module 30: Review Questions ................................................................................................. 30-24

Module 31 – Primary Time Index

Objectives .................................................................................................................................. 31-2

What is Primary Time Index (PTI)? .......................................................................................... 31-3

Time-series Definition ............................................................................................................... 31-4

Time-series Data Characteristics ............................................................................................... 31-5

Time-series Data – Categories ................................................................................................... 31-6

Sensor Data Collection Models ................................................................................................. 31-7

Sensor Data Collection Models (Cont.) ..................................................................................... 31-8

Time-series Data – Time Bucket ............................................................................................... 31-9

Key Aspects of PTI .................................................................................................................. 31-10

Distribution and ordering strategies ......................................................................................... 31-11

PTI DDL Syntax ...................................................................................................................... 31-12

PTI Configuration Options ...................................................................................................... 31-13

Auto-generated columns .......................................................................................................... 31-14

Sequenced & Non-Sequenced Tables ...................................................................................... 31-15

Storage Distribution Option A ................................................................................................. 31-16

Storage Distribution Option B ................................................................................................. 31-17

Storage Distribution Option C ................................................................................................. 31-18

Distribution Options Syntax rules ............................................................................................ 31-19

Non-Sequenced PTI Examples ................................................................................................ 31-20

Sequenced PTI Examples ........................................................................................................ 31-21

CREATE TABLE AS .............................................................................................................. 31-22

CREATE TABLE AS Examples ............................................................................................. 31-23

DDLs involving PTI Tables ..................................................................................................... 31-24

SHOW Table ............................................................................................................................ 31-25

HELP Commands .................................................................................................................... 31-26

Time Series Aggregates Introduction ...................................................................................... 31-27

Time Series Aggregates DML Concepts ................................................................................. 31-28

Time Series Aggregate Functions ............................................................................................ 31-29

System Virtual Columns .......................................................................................................... 31-30

MAD Example ......................................................................................................................... 31-31

Time series System Functions ................................................................................................. 31-32

Summary .................................................................................................................................. 31-33

Module 31: Review Questions ................................................................................................. 31-34

Lab Exercise 31-1 .................................................................................................................... 31-36

Module 32 – Miscellaneous SQL Features

Objectives .................................................................................................................................. 32-2

Teradata SQL ............................................................................................................................. 32-3

Teradata SQL and ANSI Differences ........................................................................................ 32-4

Transactions, Requests, and Statements .................................................................................... 32-5

Multi-Statement Requests .......................................................................................................... 32-6

SQL Session Modes ................................................................................................................... 32-7

Transaction Modes – Teradata ................................................................................................... 32-8

Transaction Modes – ANSI ....................................................................................................... 32-9

Transaction Mode Examples .................................................................................................... 32-10

Transaction Mode Errors ......................................................................................................... 32-11

Transaction Mode Failures ...................................................................................................... 32-12

Duplicate Rows ........................................................................................................................ 32-13

CASE Sensitivity Issues .......................................................................................................... 32-14

Why A System Calendar? ........................................................................................................ 32-15

Calendar Options ..................................................................................................................... 32-16

Choosing a Calendar ................................................................................................................ 32-17

Calendar View Layout ............................................................................................................. 32-18

One Row in the Calendar ......................................................................................................... 32-19

Using the Calendar ................................................................................................................... 32-20

Temporary Table Choices ........................................................................................................ 32-21

Derived Tables Revisited ......................................................................................................... 32-22

Volatile Tables ......................................................................................................................... 32-23

Volatile Table Restrictions ...................................................................................................... 32-24

Global Temporary Tables ........................................................................................................ 32-25

Creating Global Temporary Tables ......................................................................................... 32-26

Query Banding ......................................................................................................................... 32-27

Setting the QueryBand ............................................................................................................. 32-28

Teradata 15.0 – Major Features ............................................................................................... 32-29

Teradata 15.10 – Major Features ............................................................................................. 32-30

Teradata 16.00 – Major Features ............................................................................................. 32-31

Teradata 16.10 – Major Features ............................................................................................. 32-32

Teradata 16.20 – Major Features ............................................................................................. 32-33

Teradata Limits (Different Releases) ....................................................................................... 32-34

Module 32: Review Questions ................................................................................................. 32-35

Module 33 – Introduction to Application Utilities

Objectives .................................................................................................................................. 33-2

Application Utilities ................................................................................................................... 33-3

Application Utility Environments .............................................................................................. 33-4

Transferring Large Amounts of Data ......................................................................................... 33-5

INSERT/SELECT: The Fast Path .............................................................................................. 33-6

Multi-Statement INSERT/SELECT Example ........................................................................... 33-7

DELETE (ALL): The Fast Path ................................................................................................. 33-8

Teradata Parallel Transporter ..................................................................................................... 33-9

Teradata Parallel Transporter Operators .................................................................................. 33-10

Application Development ........................................................................................................ 33-11

AXSMOD, INMOD, or OUTMOD Routines.......................................................................... 33-12

Summary .................................................................................................................................. 33-13

Module 33: Review Questions ................................................................................................. 33-14

Module 34 – BTEQ

Objectives .................................................................................................................................. 34-2

BTEQ .EXPORT........................................................................................................................ 34-4

BTEQ Data Modes ..................................................................................................................... 34-5

BTEQ EXPORT – Example 1 ................................................................................................... 34-6

BTEQ EXPORT – Example 2 ................................................................................................... 34-7

BTEQ EXPORT – Example 3 ................................................................................................... 34-8

Indicator Variables ..................................................................................................................... 34-9

Exported Data with Fixed Length Columns ............................................................................ 34-10

Exported Data with Variable Length Columns ........................................................................ 34-11

Exported Data with Indicator Bytes ......................................................................................... 34-12

.IMPORT (for Network-Attached Systems) ............................................................................ 34-13

.PACK and .REPEAT .............................................................................................................. 34-14

BTEQ IMPORT – Example 1 (loading data from a Linux Server) ......................................... 34-15

BTEQ IMPORT – Example 2 (using imported data as update data) ....................................... 34-16

BTEQ IMPORT – Example 3 (importing data from a CSV file) ............................................ 34-17

Multiple Sessions ..................................................................................................................... 34-18

Parallel Processing Using Multiple Sessions to Access Individual Rows ............................... 34-19

Module 34: When Do Multiple Sessions Make Sense Exercise .............................................. 34-20

Using BTEQ Conditional Logic .............................................................................................. 34-21

Enhancements for 1MB Perm rows ......................................................................................... 34-22

Summary .................................................................................................................................. 34-23

Module 34: Review Questions ................................................................................................. 34-24

Lab Exercise 34-1 .................................................................................................................... 34-25

Lab Exercise 34-2 (optional: 1 of 2) ........................................................................................ 34-28

Lab Exercise 34-2 (optional: 2 of 2) ........................................................................................ 34-29

Module 35 – Introduction to TPT

Objectives .................................................................................................................................. 35-2

TPT Description ......................................................................................................................... 35-3

Major Features of TPT ............................................................................................................... 35-4

Architecture ................................................................................................................................ 35-6

Data Parallelism ......................................................................................................................... 35-7

Comparing TPT With Load Utilities ......................................................................................... 35-8

Operator Types........................................................................................................................... 35-9

Producer and Consumer Operators .......................................................................................... 35-10

Standalone Operators ............................................................................................................... 35-11

Filter Operators ........................................................................................................................ 35-12

Data Connector Operators ........................................................................................................ 35-13

Access Modules ....................................................................................................................... 35-14

Building TPT Scripts (without Simplicity) .............................................................................. 35-15

Example of TPT Script (without Simplicity) ........................................................................... 35-16

Building TPT Scripts with Simplicity...................................................................................... 35-17

Example of TPT Export Script (with Simplicity) .................................................................... 35-18

Specifying Variables at Execution Time ................................................................................. 35-19

Job Variables ............................................................................................................................ 35-20

Example of Job Variable File .................................................................................................. 35-21

Script Language Substitution ................................................................................................... 35-22

Templates ................................................................................................................................. 35-23

Example – $LOAD Operator Template ................................................................................... 35-24

Inferred Schema ....................................................................................................................... 35-25

Schema Auto-Generation ......................................................................................................... 35-26

tbuild Command....................................................................................................................... 35-27

Example of tbuild Console Output .......................................................................................... 35-28

Private and Public Logs ........................................................................................................... 35-29

tlogview Command .................................................................................................................. 35-30

Example of Log Output using tlogview ................................................................................... 35-31

Summary .................................................................................................................................. 35-32

Module 35: Review Questions ................................................................................................. 35-33

Module 36 – TPT EXPORT Operator

Objectives .................................................................................................................................. 36-2

Export Job Example ................................................................................................................... 36-4

Attributes.................................................................................................................................... 36-6

Export Example with Simplicity ................................................................................................ 36-8

The SelectStmt Attribute ............................................................................................................ 36-9

Impact of Requesting Sorted Output ........................................................................................ 36-10

The SORT Procedure ............................................................................................................... 36-11

Instances and Sessions ............................................................................................................. 36-12

Example of Data Connector Operator ...................................................................................... 36-13

Format Attribute ....................................................................................................................... 36-14

Delimiter Attributes ................................................................................................................. 36-15

TPT SQL SELECTOR Operator ............................................................................................. 36-16

Selector Example with Simplicity ........................................................................................... 36-17

Working with CSV Files .......................................................................................................... 36-18

Exporting a CSV Data File ...................................................................................................... 36-19

Checkpoints and Performance ................................................................................................. 36-20

Summary .................................................................................................................................. 36-21

Module 36: Review Questions ................................................................................................. 36-22

Lab Exercise 36-1 .................................................................................................................... 36-23

Lab Exercise 36-2 .................................................................................................................... 36-25

Lab Exercise 36-1 (2 of 2) ....................................................................................................... 36-26

Lab Exercise 36-3 .................................................................................................................... 36-27

Module 37 – TPT LOAD Operator

LOAD Phase 1: Acquisition ...................................................................................................... 37-4

LOAD Phase 2: Application ...................................................................................................... 37-5

LOAD and NoPI Tables ............................................................................................................. 37-6

LOAD – NoPI Table .................................................................................................................. 37-7

LOAD Job Example ................................................................................................................... 37-8

Load Example with Simplicity ................................................................................................ 37-10

Load Restrictions ..................................................................................................................... 37-11

Load Attributes (Partial List) ................................................................................................... 37-12

Other Attributes (Partial List) .................................................................................................. 37-13

Data Conversions ..................................................................................................................... 37-14

LOAD Error Tables ................................................................................................................. 37-15

Checkpoint Option ................................................................................................................... 37-16

Techniques to Load Multiple Data Files .................................................................................. 37-17

UNION ALL Operation ........................................................................................................... 37-18

UNION ALL Apply Examples ................................................................................................ 37-19

File List .................................................................................................................................... 37-20

Directory Scan ......................................................................................................................... 37-21

Staged Loading of Multiple Data Files .................................................................................... 37-22

SQL Inserter Operator .............................................................................................................. 37-23

SQL Inserter Example .............................................................................................................. 37-24

The DDL Operator ................................................................................................................... 37-25

DDL Operator Job Example .................................................................................................... 37-26

Multiple Apply Steps Example ................................................................................................ 37-27

Summary .................................................................................................................................. 37-28

Module 37: Review Questions ................................................................................................. 37-29

Lab Exercise 37-1 .................................................................................................................... 37-30

Lab Exercise 37-1 (2 of 2) ....................................................................................................... 37-31

Lab Exercise 37-2 .................................................................................................................... 37-32

Module 38 – TPT UPDATE Operator

Objectives .................................................................................................................................. 38-2

How UPDATE Works ............................................................................................................... 38-4

IMPORT Task ............................................................................................................................ 38-5

Update IMPORT Job Example .................................................................................................. 38-6

Phases of Update IMPORT Task ............................................................................................... 38-9

Acquisition Phase..................................................................................................................... 38-10

Acquisition Phase – a Closer Look .......................................................................................... 38-11

Application Phase .................................................................................................................... 38-12

Application Phase – a Closer Look .......................................................................................... 38-13

UPDATE Attributes (Partial List) ........................................................................................... 38-14

Error and Work Table Attributes ............................................................................................. 38-15

UPDATE Considerations ......................................................................................................... 38-16

DELETE Task Differences from IMPORT Task .................................................................... 38-17

Update DELETE Task Example .............................................................................................. 38-18

DELETE Task – A Closer Look .............................................................................................. 38-19

UPDATE Locks ....................................................................................................................... 38-20

Checkpoints.............................................................................................................................. 38-21

Error Capture ........................................................................................................................... 38-22

Error Limits and Messages ...................................................................................................... 38-23

RELEASE MLOAD Statement ............................................................................................... 38-24

Techniques to Load Multiple Data Files .................................................................................. 38-25

Summary .................................................................................................................................. 38-26

Module 38: Review Questions ................................................................................................. 38-27

Lab Exercise 38-1 .................................................................................................................... 38-28

Lab Exercise 38-2 .................................................................................................................... 38-31

Module 39 – TPT STREAM Operator

Objectives .................................................................................................................................. 39-2

Stream Advantages and Limitations .......................................................................................... 39-4

Stream Operator Syntax ............................................................................................................. 39-5

Attributes similar to Update (Partial List) ................................................................................. 39-6

Stream-specific Attributes (Partial List) .................................................................................... 39-7

Attributes: Pack, Rate, and Periodicity ...................................................................................... 39-8

Attribute: Robust ........................................................................................................................ 39-9

Serialize Off ............................................................................................................................. 39-10

Serialize On .............................................................................................................................. 39-11

STREAM Example .................................................................................................................. 39-12

Stream Compared with Update ................................................................................................ 39-13

Monitoring ............................................................................................................................... 39-14

Summary .................................................................................................................................. 39-15

Module 39: Review Questions ................................................................................................. 39-16

Lab Exercise 39-1 .................................................................................................................... 39-17

Module 40 – Additional TPT Operators

Objectives .................................................................................................................................. 40-2

ODBC Operator ......................................................................................................................... 40-3

$ODBC Template Example ....................................................................................................... 40-4

Multiple ODBC Operators ......................................................................................................... 40-5

OS Command Operator.............................................................................................................. 40-6

Using INCLUDE ....................................................................................................................... 40-7

Easy Loader ............................................................................................................................... 40-8

TPT Utility Commands .............................................................................................................. 40-9

Deleting Checkpoint files ........................................................................................................ 40-10

Monitoring ............................................................................................................................... 40-11

Summary .................................................................................................................................. 40-12

Module 40: Review Questions ................................................................................................. 40-13

Lab Exercise 40-1 .................................................................................................................... 40-14

Module 41 – Additional Utility Considerations

Objectives .................................................................................................................................. 41-2

Utility Considerations ................................................................................................................ 41-3

Load Isolation ............................................................................................................................ 41-4

LDI TPT Stream example .......................................................................................................... 41-5

Referential Integrity and Load Utility Issues ............................................................................. 41-7

Honoring Table Free Space Percent .......................................................................................... 41-8

Table Level SQL Updates or Deletes ........................................................................................ 41-9

SQL Update vs. TPT Export/Update ....................................................................................... 41-10

Module 41: Review Questions ................................................................................................. 41-11

Module 42 – Database Administration and Building the Database Environment

Objectives .................................................................................................................................. 42-2

Database Administration ............................................................................................................ 42-3

Initial Teradata Database ........................................................................................................... 42-4

Administrative User ................................................................................................................... 42-5

Owners, Parents, and Children ................................................................................................... 42-6

Creating New Users and Databases ........................................................................................... 42-7

Transfer of Ownership ............................................................................................................... 42-8

DELETE / DROP Statements .................................................................................................... 42-9

Teradata Studio – New System ................................................................................................ 42-10

Teradata Studio – Hierarchy .................................................................................................... 42-11

Summary .................................................................................................................................. 42-12

Module 42: Review Questions ................................................................................................. 42-13

Module 43 – The Data Dictionary

Objectives .................................................................................................................................. 43-2

Data Dictionary / Directory ....................................................................................................... 43-3

Fallback Protected Data Dictionary Tables ............................................................................... 43-4

Non-Hashed Data Dictionary Tables ......................................................................................... 43-5

Updating Data Dictionary Tables .............................................................................................. 43-6

Supplied Data Dictionary Views ............................................................................................... 43-7

Restricted Views ........................................................................................................................ 43-8

Suffix Options with Views......................................................................................................... 43-9

Selecting Information about Created Objects .......................................................................... 43-10

Children View .......................................................................................................................... 43-11

Databases View ........................................................................................................................ 43-12

Users View ............................................................................................................................... 43-13

Tables View ............................................................................................................................. 43-14

Columns View ......................................................................................................................... 43-15

Indices View ............................................................................................................................ 43-16

Indices View (Second Example) .............................................................................................. 43-17

Partitioning Constraints View .................................................................................................. 43-18

Show Table Checks View ........................................................................................................ 43-19

Show Column Checks View .................................................................................................... 43-20

Triggers View .......................................................................................................................... 43-21

All Temporary Tables View .................................................................................................... 43-22

Referential Integrity Views ...................................................................................................... 43-23

Using the DBC.Tables View.................................................................................................... 43-24

Referential Integrity States ...................................................................................................... 43-25

DBC.All_RI_Children View.................................................................................................... 43-26

DBC.Databases2 View ............................................................................................................ 43-27

Time Stamps in Data Dictionary .............................................................................................. 43-28

Summary .................................................................................................................................. 43-29

Module 43: Review Questions ................................................................................................. 43-30

Lab Exercise 43-1 .................................................................................................................... 43-31

Lab Exercise 43-2 (optional: 1 of 2) ........................................................................................ 43-34

Lab Exercise 43-2 (optional: 2 of 2) ........................................................................................ 43-35

Module 44 – Space Allocation and Usage

Objectives .................................................................................................................................. 44-2

Permanent Space Terminology .................................................................................................. 44-3

Spool Space Terminology .......................................................................................................... 44-4

Temporary Space Terminology ................................................................................................. 44-5

Resetting Peak Values ................................................................................................................ 44-6

Assigning Perm and Spool Limits ............................................................................................. 44-7

Giving One User to Another ...................................................................................................... 44-9

Teradata Studio – Move Space ................................................................................................ 44-10

Reserving Space for Spool ....................................................................................................... 44-11

Views for Space Allocation Reporting .................................................................................... 44-12

DiskSpace View ....................................................................................................................... 44-13

TableSize View ........................................................................................................................ 44-14

AllSpace View ......................................................................................................................... 44-15

DataBaseSpace Table............................................................................................................... 44-16

Different Views — Different Results ...................................................................................... 44-17

Global Space Accounting ........................................................................................................ 44-18

Global Space Accounting Example ......................................................................................... 44-19

Additional Utilities to View Space Utilization ........................................................................ 44-20

Teradata Studio – Object Viewer Options ............................................................................... 44-21

Teradata Viewpoint – Space Usage ......................................................................................... 44-22

Ferret Utility............................................................................................................................. 44-23

Ferret SHOWSPACE Command ............................................................................................. 44-24

Ferret SHOWBLOCKS Command .......................................................................................... 44-25

Module 44: Review Questions ................................................................................................. 44-26

Module 45 – Users, Accounts, and Accounting

Objectives .................................................................................................................................. 45-2

Creating New Users and Databases ........................................................................................... 45-3

CREATE DATABASE Statement ............................................................................................. 45-4

CREATE USER Statement ........................................................................................................ 45-5

CREATE USER and the Data Dictionary ................................................................................. 45-6

MODIFY USER Statement ........................................................................................................ 45-8

Teradata Studio – Create User ................................................................................................... 45-9

Creating and Using Account IDs ............................................................................................. 45-10

Dynamically Changing an Account ID .................................................................................... 45-11

Account String Expansion ....................................................................................................... 45-12

ASE Accounting Example ....................................................................................................... 45-13

System Accounting Views ....................................................................................................... 45-14

AccountInfo View .................................................................................................................... 45-15

AMPUsage View ..................................................................................................................... 45-16

AMPUsage View – Example ................................................................................................... 45-17

Summary .................................................................................................................................. 45-18

Module 45: Review Questions ................................................................................................. 45-19

Lab Exercise 45-1 .................................................................................................................... 45-20

Module 46 – Profiles

Objectives .................................................................................................................................. 46-2

Example of Simplifying User Management .............................................................................. 46-4

Implementing Profiles ................................................................................................................ 46-5

Impact of Profiles on Users........................................................................................................ 46-6

CREATE/MODIFY PROFILE Statement ................................................................................. 46-7

Password Attributes – (CREATE/MODIFY PROFILE) ........................................................... 46-8

Teradata Password Control ........................................................................................................ 46-9

Teradata Password Control Options ........................................................................................ 46-11

CREATE PROFILE Example.................................................................................................. 46-12

Teradata Studio – Create Profile Example ............................................................................... 46-13

DROP PROFILE Statement ..................................................................................................... 46-18

ProfileInfo View ...................................................................................................................... 46-19

Miscellaneous SQL Functions ................................................................................................. 46-20

Summary .................................................................................................................................. 46-21

Module 46: Review Questions ................................................................................................. 46-22

Lab Exercise 46-1 .................................................................................................................... 46-23

Module 47 – Access Rights

Objectives .................................................................................................................................. 47-2

Privileges/Access Rights ............................................................................................................ 47-3

Access Rights Mechanisms ........................................................................................................ 47-4

CREATE TABLE – Automatic Rights ...................................................................................... 47-5

CREATE USER – Automatic Rights ........................................................................................ 47-6

Implicit, Automatic, and Explicit Rights ................................................................................... 47-7

GRANT Command (SQL Form) ............................................................................................... 47-8

Granting Rights at Database Level ............................................................................................ 47-9

GRANT Rights at the Table or Column Level ........................................................................ 47-10

REVOKE Command (SQL Form) ........................................................................................... 47-11

Revoking Non-Existent Rights ................................................................................................ 47-12

Removing a Level in the Hierarchy ......................................................................................... 47-13

Inheriting Access Rights .......................................................................................................... 47-14

The GIVE Statement and Access Rights ................................................................................. 47-15

Access Rights and Views ......................................................................................................... 47-16

Access Rights and Nested Views ............................................................................................. 47-17

System Views for Access Rights ............................................................................................. 47-18

AllRights and UserRights Views ............................................................................................. 47-19

UserGrantedRights View ......................................................................................................... 47-20

Teradata Studio – GRANT/REVOKE Privileges .................................................................... 47-21

Summary .................................................................................................................................. 47-22

Module 47: Review Questions ................................................................................................. 47-23

Module 48 – Roles

Objectives .................................................................................................................................. 48-2

What is a Role? .......................................................................................................................... 48-3

Access Rights Without Roles ..................................................................................................... 48-4

Access Rights Using a Role ....................................................................................................... 48-5

Implementing Roles ................................................................................................................... 48-6

Current or Active Roles ............................................................................................................. 48-7

Nesting of Roles ......................................................................................................................... 48-8

Example of Using "Nested Roles" ............................................................................................. 48-9

Access Rights Validation and Roles ........................................................................................ 48-10

SQL Statements to Support Roles............................................................................................ 48-11

GRANT Command (SQL Form) ............................................................................................. 48-12

REVOKE Command (SQL Form) ........................................................................................... 48-13

GRANT and REVOKE Commands (Role Form) .................................................................... 48-14

System Hierarchy (used in following examples) ..................................................................... 48-15

Example of Using Roles .......................................................................................................... 48-16

Roles for Directory-Based Users ............................................................................................. 48-19

Roles for Proxy Users .............................................................................................................. 48-20

RoleInfo View .......................................................................................................................... 48-21

RoleMembers View ................................................................................................................. 48-22

DBC.AccessRights and “Rights” Views.................................................................................. 48-23

AllRoleRights and UserRoleRights Views .............................................................................. 48-24

Steps to Implementing Roles ................................................................................................... 48-25

Summary .................................................................................................................................. 48-26

Module 48: Review Questions ................................................................................................. 48-27

Lab Exercise 48-1 .................................................................................................................... 48-28

Lab Exercise 48-2 .................................................................................................................... 48-30

Module 49 – System Access Controls

Objectives .................................................................................................................................. 49-2

System Access Control Levels................................................................................................... 49-3

Teradata Access Control Mechanisms ....................................................................................... 49-4

Teradata Password Encryption .................................................................................................. 49-5

Password Security Features ....................................................................................................... 49-6

Teradata Connectivity ................................................................................................................ 49-7

Host Logon Processing .............................................................................................................. 49-8

Objects used in Host Logon Processing .................................................................................... 49-9

GRANT/REVOKE LOGON Statements ................................................................................. 49-10

GRANT/REVOKE LOGON Examples ................................................................................... 49-11

Session Related Views ............................................................................................................. 49-12

LogonRules View .................................................................................................................... 49-13

LogOnOff View ....................................................................................................................... 49-14

SessionInfo View ..................................................................................................................... 49-15

Additional Utilities to View Sessions ...................................................................................... 49-16

Viewpoint – Query Monitor..................................................................................................... 49-17

Viewpoint – Remote Console – Query Session ....................................................................... 49-18

A Recommended Structure Using Roles ................................................................................. 49-19

A Recommended System Hierarchy ........................................................................................ 49-20

Teradata Secure Zones ............................................................................................................. 49-21

Multi-tenancy Secure Zones example ...................................................................................... 49-22

Summary .................................................................................................................................. 49-23

Module 49: Review Questions ................................................................................................. 49-24

Module 50 – Access and Query Logging

Objectives .................................................................................................................................. 50-2

Access Logging .......................................................................................................................... 50-4

Objects used in Access Logging ................................................................................................ 50-5

BEGIN LOGGING Statement ................................................................................................... 50-6

END LOGGING Statement ....................................................................................................... 50-7

Setting Up Access Logging ....................................................................................................... 50-8

Access Log Views...................................................................................................................... 50-9

AccLogRules View .................................................................................................................. 50-10

BEGIN LOGGING – Example ................................................................................................ 50-11

AccessLog View ...................................................................................................................... 50-12

AccessLog View – Example .................................................................................................... 50-13

END LOGGING – Example .................................................................................................... 50-14

Query Logging (DBQL) Concepts ........................................................................................... 50-15

Objects used in Defining Rules for DBQL .............................................................................. 50-16

BEGIN QUERY LOGGING ................................................................................................... 50-18

BEGIN QUERY LOGGING WITH ... (Cont.) ....................................................................... 50-19

BEGIN QUERY LOGGING Examples ................................................................................... 50-22

END QUERY LOGGING Statement ...................................................................................... 50-25

REPLACE QUERY LOGGING .............................................................................................. 50-26

FLUSH QUERY LOGGING ................................................................................................... 50-27

PARAMINFO, UTILITYINFO Options ................................................................................. 50-28

DBQL Lock Logging Enhancement / PLL .............................................................................. 50-29

DBQLRules View .................................................................................................................... 50-30

DBC.QryLog View – Example ................................................................................................ 50-31

QryLogSummary View – Example ......................................................................................... 50-32

Summary .................................................................................................................................. 50-33

Module 50: Review Questions ................................................................................................. 50-34

Lab Exercise 50-1 .................................................................................................................... 50-35

Lab Exercise 50-2 .................................................................................................................... 50-37

Module 51 – Workload Management

Objectives .................................................................................................................................. 51-2

Integrated Workload Management (IWM) ................................................................................ 51-4

Teradata Active System Management (TASM) ........................................................................ 51-5

Workload Management Capabilities .......................................................................................... 51-6

Query Management Architecture ............................................................................................... 51-7

Workload Management Architecture ......................................................................................... 51-8

Filters ......................................................................................................................................... 51-9

Throttles ................................................................................................................................... 51-10

Workload Designer Example ................................................................................................... 51-11

Workload Definitions ............................................................................................................... 51-12

Workload Designer – Workloads ............................................................................................. 51-13

Workloads and Exceptions ...................................................................................................... 51-14

Teradata Workload Analyzer ................................................................................................... 51-15

Viewpoint – Monitoring and Reporting ................................................................................... 51-16

Teradata and SLES 11 Priority Scheduler ............................................................................... 51-17

SLES 11 PSF Virtual Partitions ............................................................................................... 51-18

SLES 11 Control Groups and Workloads ................................................................................ 51-19

SLES 11 Appliance Example ................................................................................................... 51-20

Summary .................................................................................................................................. 51-21

Module 51: Review Questions ................................................................................................. 51-22

Module 52 – Teradata Viewpoint

Objectives .................................................................................................................................. 52-2

Viewpoint Architecture .............................................................................................................. 52-4

Data Collection Service ............................................................................................................. 52-5

Viewpoint Portal and Portlets .................................................................................................... 52-6

Logging onto Viewpoint ............................................................................................................ 52-7

Updated User Interface .............................................................................................................. 52-8

Adding Portlets .......................................................................................................................... 52-9

Example of Initial Session and Portlets ................................................................................... 52-10

Viewpoint Portlet Controls ...................................................................................................... 52-11

Viewpoint Rewind ................................................................................................................... 52-12

Query Monitor ......................................................................................................................... 52-13

Viewpoint Query Monitor Detail View ................................................................................... 52-14

My Queries............................................................................................................................... 52-15

PJI and UII Metrics .................................................................................................................. 52-16

Remote Console ....................................................................................................................... 52-17

Viewpoint Alert Viewer ........................................................................................................... 52-18

Viewpoint SQL Scratchpad ..................................................................................................... 52-19

Viewpoint Administration ....................................................................................................... 52-20

Viewpoint Dashboard feature .................................................................................................. 52-21

Viewpoint Mobile feature ........................................................................................................ 52-22

Summary .................................................................................................................................. 52-23

Module 52: Review Questions ................................................................................................. 52-24

Lab Exercise 52-1 .................................................................................................................... 52-25

Lab Exercise 52-2 .................................................................................................................... 52-27

Lab Exercise 52-3 (Optional)................................................................................................... 52-28

Module 53 – ResUsage – Performance Monitoring

Objectives .................................................................................................................................. 53-2

Performance Monitoring Tools .................................................................................................. 53-3

Why Collect Performance Data? ............................................................................................... 53-4

Resource Usage Data ................................................................................................................. 53-5

Logging ResUsage Data ............................................................................................................ 53-6

Specifying ResUsage Tables and Logging Rates ...................................................................... 53-7

Resource Usage Tables .............................................................................................................. 53-8

Resource Usage Views .............................................................................................................. 53-9

Resource Usage Macros ........................................................................................................... 53-10

Example Output from DBC.ResNode ...................................................................................... 53-11

PM/API and Viewpoint............................................................................................................ 53-12

Teradata System Emulation Tool ............................................................................................. 53-13

Summary .................................................................................................................................. 53-14

Module 53: Review Questions ................................................................................................. 53-15

Module 54 – System Restarts

Objectives .................................................................................................................................. 54-2

Types of Restarts........................................................................................................................ 54-3

Scheduled Restarts ..................................................................................................................... 54-4

Restart using the “tpareset” Command ...................................................................................... 54-5

PDE States ................................................................................................................................. 54-6

Unscheduled Restarts ................................................................................................................. 54-7

TPA Reset – Crashdumps ........................................................................................................ 54-10

Allocating Crashdumps Space ................................................................................................. 54-11

TPA Dump Maintenance ......................................................................................................... 54-12

Module 54: Review Questions ................................................................................................. 54-13

Module 55 – System and Maintenance Utilities

Objectives .................................................................................................................................. 55-2

Starting Teradata System Utilities ............................................................................................. 55-3

Using the Interfaces to Access Utilities ..................................................................................... 55-4

DBS Control Utility ................................................................................................................... 55-5

DBS Control Record – General Fields....................................................................................... 55-6

DBS Control Record – File System Fields ................................................................................ 55-8

DBS Control Record – Performance Fields ............................................................................... 55-9

Modifying DBS Control Fields ................................................................................................ 55-10

Checking Data Integrity ........................................................................................................... 55-11

Ferret – Scandisk Utility .......................................................................................................... 55-12

Checktable Utility .................................................................................................................... 55-13

Checktable – Levels of Checking ............................................................................................ 55-14

Checktable – Example ............................................................................................................. 55-15

Table Rebuild Utility ............................................................................................................... 55-16

Recovery Manager Utility ........................................................................................................ 55-17

Recovery Manager Commands ................................................................................................ 55-18

Rcvmanager – List Status ........................................................................................................ 55-19

Rcvmanager – List Locks ........................................................................................................ 55-20

Rcvmanager – List Status (2nd Example) ............................................................................... 55-21

Rcvmanager – List Rollback Tables ........................................................................................ 55-22

Rcvmanager – Cancel Rollback on Table ................................................................................ 55-23

Showlocks Utility..................................................................................................................... 55-24

Orphan or Phantom Spool Issues ............................................................................................. 55-25

Update Space Utility ................................................................................................................ 55-26

Vprocmanager .......................................................................................................................... 55-27

Summary .................................................................................................................................. 55-28

Module 55: Review Questions ................................................................................................. 55-29

Module 56 – MAPS

Objectives .................................................................................................................................. 56-2

MAPS High Level Description .................................................................................................. 56-3

MAPS System Expansion concept............................................................................................. 56-4

MAPS Multiple Reconfigurations ............................................................................................. 56-5

Special Maps .............................................................................................................................. 56-6

Moving a Table to a New Map .................................................................................................. 56-7

System Expansion & Table Migration ....................................................................................... 56-8

What is TDMaps? ...................................................................................................................... 56-9

Steps to Move Tables ............................................................................................................... 56-10

ALTER TABLE possible issues .............................................................................................. 56-11

GRANT MAP .......................................................................................................................... 56-12

Sparse Maps ............................................................................................................................. 56-13

Colocation Name ..................................................................................................................... 56-14

Miscellaneous SQL and Hash Functions ................................................................................. 56-15

Summary .................................................................................................................................. 56-16

Module 56: Review Questions ................................................................................................. 56-17

Module 57 – Recap

Objectives .................................................................................................................................. 57-2

Teradata Factory Review – Week 1 ........................................................................................... 57-3

Teradata Factory Review – Week 2 ........................................................................................... 57-4

Dictionary Tables to Maintain ................................................................................................... 57-5

Plan and Follow-up .................................................................................................................... 57-6

Things You Never Have to do with Teradata ............................................................................ 57-7

Teradata Differentiators ............................................................................................................. 57-9

Teradata Certification Exams .................................................................................................. 57-10

Appendix A: Review Question Solutions Appendix B: Lab Exercise Solutions Appendix C: Acronyms Appendix D: Lab Environment Appendix E: SQL Assistant Appendix F: Data Dictionary Views Appendix G: Permanent Journals Appendix H: Visual Explain