Teradata Overview v1

46
Teradata Overview

description

NA

Transcript of Teradata Overview v1

Page 1: Teradata Overview v1

Teradata Overview

Page 2: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 2 > 9/24/12

What is Teradata?

ANSI standard parallel RDBMS

Purpose-built Intel based SMP & MPP platforms

SUSE Linux

Parallel everywhere

Shared-Nothing architecture with unlimited and unconditional parallelism

Linear Scalability from small to very large

Page 3: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 3 > 9/24/12

Where Does Teradata Fit?

Transactional Repositories

OLTPi OLTPn OLTP1 • • • • • •

Workload Continuum

Transactional Systems

• User Profiles

• Customers

• Clerks

• Services:

• Transactions

• Bookkeeping

• Access Profile:

• Speed and Accuracy

• Frequent updates

• Occasional lookup

• Data:

• Current “state” data

• Limited history

• Narrow Scope

ODS1

Tactical Decision Repositories

ODS2 • • •

Tactical Systems

• User Profiles

• Front Line Services

• Customers - Indirectly

• Services:

• Lookups

• Tactical decisions

• Analytics (e.g. scoring)

• Access Profile:

• Continuous updates

• Frequent lookups

• Data Model:

• Current “state” data

• Recent history

• Integrated business areas

Strategic Systems

• User Profiles

• Back Office Services

• Management

• Trading Partners

• Services:

• Strategic decisions

• Analytics (e.g. scoring)

• Access Profile:

• Bulk Inserts – Some Updates

• Frequent complex analytics

• Data Model:

• Periodic “state” data

• Deep history

• Enterprise integrated view

Data Marti Data Martn Data Mart1 • • • • • •

Strategic Decision Repositories

EDW

(Hub & Spoke)

Data Marti Data Martn Data Mart1 • • • • • •

Teradata

EDW Teradata ADW

Strategic Decision Repositories

Page 4: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 4 > 9/24/12

ODS

ODS

data mart

EDW mart

Marketing Finance Product/ Services Executive

mart

mart

mart mart

Legacy CRM ERP SCM PLM

Teradata Helps Companies Move From This……

Disparate Analytical Systems

Proliferate ODS and data marts

More servers, licenses

More ETL jobs

More labor

Complexity

High Complexity and Cost

2X-5X more databases, processing, files, labor?

Data Security?

Application development?

Page 5: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 5 > 9/24/12

Active Data Warehouse

Legacy CRM ERP SCM PLM

Marketing Finance Product/ Services Executive

Customers Call

Center Logistics Suppliers

To This……. Integrated, Cross-Functional Data

Complexity and proliferation will always exist and Teradata’s traditional focus has been to clean that up

“Active” Enterprise Data Warehouse Consolidate complexity

Lower TCO

Less strain on DBAs and CIO

Single set of facts, metrics, vocabulary

Now it’s time to move to the next level Active Enterprise

Intelligence™!

Page 6: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 6 > 9/24/12

Parallel Software on a SMP Node

Parsing Engine (Query Interpretation & Control)

Syntax, Parser, Optimizer, Dispatcher

Disk Storage

Access Module Processors (Parallel Database Processes)

Bynet (Messaging & Control)

Server (Virtual Server) Node

(Physical Server)

Inter-Node Command And Control

Units of Parallelism • Multi-Threaded • Logging • Locking • I/O Management • Cache Management • Own Portion of Data

Dynamic Space Allocation, Random Data Distribution, Variable Block Sizes

PE

V-BYNET

PE

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Page 7: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 7 > 9/24/12

Teradata Shared Nothing Software (Divide and conquer the problem in parallel)

PE

V-BYNET

PE

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Logs

Locks

I/O Mgmt

AMP

Buffe

rs

RDBMS Engine

Teradata hides the complexity

DML without regard to multiple engines

No “coordinator node”

Reduces large problems to manageable size

• But….. How do I expand and scale the system ????

Page 8: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 8 > 9/24/12

Growing Parallelism via System Expansion Begin with a 4 Node Teradata System

AMPs Each AMP owns an equal

amount of data

Growing the system adds more AMPs

Data per AMP is proportionately reduced

Performance is proportionately increased

Re-Config Utility Runs in parallel on each AMP

Re-distributes appropriate data to new AMPs

PE

SMP Node1

AMP PE

AMP AMP AMP

PE

SMP Node2

AMP PE

AMP AMP AMP

PE

SMP Node3

AMP PE

AMP AMP AMP

PE

SMP Node4

AMP PE

AMP AMP AMP

BYNET Interconnects

Table A - 32M Rows

2M Rows/Amp

Page 9: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 9 > 9/24/12

Growing Parallelism via System Expansion Grow to an 8 Node Teradata System

PE

SMP Node1

AMP PE

AMP AMP AMP

PE

SMP Node2

AMP PE

AMP AMP AMP

PE

SMP Node3

AMP PE

AMP AMP AMP

PE

SMP Node4

AMP PE

AMP AMP AMP

BYNET Interconnects

PE

SMP Node1

AMP PE

AMP AMP AMP

PE

SMP Node2

AMP PE

AMP AMP AMP

PE

SMP Node3

AMP PE

AMP AMP AMP

PE

SMP Node4

AMP PE

AMP AMP AMP

Table A - 32M Rows - 1M Rows/Amp

Table B - 32M Rows - 1M Rows/Amp

Page 10: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 10 > 9/24/12

Teradata Purpose-Built Platform Family

Data Mart Appliance

Extreme Data

Appliance

Data Warehouse Appliance

Extreme Performance

Appliance

Active Enterprise Data

Warehouse

Purpose

Test/ Development

or Smaller Data Marts

Analytics on Extreme

Data Volumes from New Data

Types

Data Warehouse or Departmental

Data Marts

Extreme Performance for

Operational Analytics

Enterprise Scale for Strategic

and Operational Intelligence EDW/ADW

Scalability Up to 12TB Up to 186PB Up to 343TB Up to 17TB Up to 92PB

Sub Segment

Departmental Analytics, Entry-level

EDW

Analytical Archive, Deep Dive Analytics

Strategic Intelligence,

Decision Support System, Fast

Scan

Operational Intelligence,

Lower Volume, High Performance

Active Workloads, Real-Time Update,

Tactical and Strategic response

times

Storage SAS 10K RPM SAS 7.2K RPM SAS 10K RPM SAS SSD SAS 10K RPM

SAS SSD

Powered by the Teradata Database

10 >

Page 11: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 11 > 9/24/12

Rows are distributed evenly by hash partitioning Done in real-time as data are loaded, appended, or changed.

No reorgs, repartitioning, space management

Shared nothing software: Each VAMP owns an equal slice of the data.

Each VAMP works exclusively & independently on its rows

Nothing centralized: No single point of control for any operation (I/O, Buffers, Locking, Logging, Dictionary)

Teradata Data Distribution Dividing the Work

VAMP1 VAMP2 VAMP3 VAMP4 ………………………………………………………VAMPn

Table A Table B Table C

Prime Index

Teradata Parallel Hash Function

P

DM

P

DM

P

DM

P

DM

P

DM

P

DM

P

DM

P

DM

P

DM

RowHash (Hash Bucket) Data Fields

Page 12: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 12 > 9/24/12

Primary Index Definition

CREATE TABLE Lineitem

(l_orderkey INTEGER NOT NULL,

l_partkey INTEGER NOT NULL,

l_suppkey INTEGER,

l_linenumber INTEGER,

l_quantity INTEGER NOT NULL,

l_extendedprice DECIMAL(13,2) NOT NULL,

l_discount DECIMAL(13,2),

l_tax DECIMAL(13,2),

l_returnflag CHAR(1),

l_linestatus CHAR(1),

l_shipdate DATE FORMAT 'yyyy-mm-dd',

l_commitdate DATE FORMAT 'yyyy-mm-dd',

l_receiptdate DATE FORMAT 'yyyy-mm-dd',

l_shipinstruct VARCHAR(25),

l_shipmode VARCHAR(10),

l_comment VARCHAR(44))

PRIMARY INDEX (l_orderkey);

Page 13: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 13 > 9/24/12

Spool “Data”

Corp

Finance Marketing

“Views”

“Users”

Teradata’s Unique File System

Logical or “Virtual” Disk Space Management

No Files, Extents or Tablespaces

No need to reserve or allocate space

Size limits are set for databases

Physical space is not allocated until rows are inserted

Space not used by Table rows is available for query processing (Spool)

No re-organizations required

Page 14: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 14 > 9/24/12

Optimizer – Parallelization & Query Processing

Cost based optimizer

Parallel aware

Rewrites built-in and cost based

Parallelism is automatic

Parallelism is unconditional

Intelligent cache management

High performance views

No penalty for using views

Enables wide use for ease of use, security, privacy

Wide choice of indexes

Unique and non-unique secondary

Dynamic bit-mapping

Covered and value ordered

Join and Aggregate Join indexes

Sparse and Global Indexes Everything is parallel: No single threaded operations

No single threaded operations (scalability killers)

Scans, Joins, Index access, Aggregation, Sort, Insert, Update, Delete

All schema operations: Create Table, Create Index, Collect Statistics, ...

Page 15: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 15 > 9/24/12

Performance Options

Not required, but always available:

Secondary indexes

Single/Multi-level/Columnar partitioning

Dynamic Bit Map Indexes

Aggregate Join Indexes

Physical index characteristics:

Self maintaining

No rebuilds or re-orgs

No space reclamation

Automatically used by the optimizer

Page 16: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 16 > 9/24/12

Index Options

Teradata Supports a Variety of Index Options

Primary

Unique & Non Unique

Primary Partitioned

No Primary Index

Secondary

Unique & Non Unique

Sparse

Global

Global-Sparse

Dynamic Bit-Mapped

“Materialized”

Join

Aggregate

Aggregate-Join (AJI)

Page 17: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 17 > 9/24/12

Multi-level Partitioned Primary Index Reducing the work required

Data Scanned: Last Month vs. Same Month Last Year for one region out of four

No Partitioning

Single Level Partitioning

Multi-Level Partitioning

Full Table Scan

24 months of history

Selective Scanning

Scan 2 of 24 months

Very Selective Scanning

Scan 1 of 4 regions for 2 of 24 months

Page 18: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 18 > 9/24/12

Heterogeneous Open Connectivity

Connect to a wide variety of host platforms

Mainframes, UNIX platforms, desktops

Internet interfaces

All simultaneously; accessing the same tables

Heterogeneous data access

Inbound data in client format

Including EBCDIC, comp formats, big and little endian, various floating points

Outbound data back to host formats

Standard open interfaces

ODBC, OLE-DB, JDBC, .NET

ANSI SQL

Page 19: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 19 > 9/24/12

Teradata Load/Unload Protocols & Products

Load/Unload Protocols

FastLoad Protocol – Bulk loading of empty tables

MultiLoad Protocol – Bulk Insert, Update, Upsert, & Delete

FastExport Protocol – Export data out of Teradata DB

TPump – SQL application for continuous loading

Load/Unload Products which use the load protocols

JDBC FastLoad protocol for pure Java applications (Teradata 12.0)

Teradata Parallel Transporter Execute all load/unload protocols in one product

Plug-in Operators: Load, Update, Stream, Export

Provides C++ API to protocols for ISV partners

Page 20: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 20 > 9/24/12

Teradata Viewpoint Platform for Teradata System Management

Web portal application framework for Teradata Systems Management

Portlet Bundles

Page 21: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 21 > 9/24/12

Teradata Viewpoint – Query Monitor

Page 22: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 22 > 9/24/12

Viewpoint: Workload Monitor Portlet Teradata Ease of Use

Number of

Incoming Queries

Outside of SLG

Number of

Queries After

Filters and Throttles

Exception Reclass

Filter Reject

Throttle Delay

Throttle Reject

Exception Reject

Page 23: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 23 > 9/24/12

Data Volume (Raw, User Data)

Competition Scales One Dimension at the

Expense of Others

Limited by Technology!

Schema Sophistication

Query Freedom

Query Complexity

Data Freshness

Query Data Volume

The Teradata Difference Scalability Across Multiple Dimensions

Query Concurrency

Workload Management

Teradata can Scale Simultaneously Across Multiple Dimensions Driven by Business!

Page 24: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 24 > 9/24/12

Teradata 12 New Releases Every 12-18 Months

~30% improvement in query performance

~20% improvement in archive

~20-60% load improvement with SQL Bulk Load

~30% query performance with Multi Level PPI

~50% improvement in checktable performance

~30% query performance with parameterized statement caches

High Performance Innovation

Page 25: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 25 > 9/24/12

90+ Release Features

And the list goes on…..

Teradata 13 Continued Innovation

Teradata Virtual Storage (TVS)

Native Geospatial Types and Functions

Large Memory Support

AJI Enhancements

TASM Ruleset enhancements

Statistics Enhancements

Lock Manager Fault Isolation

128 Way Joins

Java User Defined Functions

Page 26: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 26 > 9/24/12

Teradata Database 13.10 - Major Features

Character PPI

New Geospatial performance and capability

Enhanced Workload Management Capabilities (TASM) Support for 250 Workload Definitions (was previously 40) Utility workload management Workload Health, Workload Monitor, Workload Designer via Viewpoint

Large cylinder support

Enables dense packing of more data rows; more data per amp.

Built-in Temporal support Temporal semantics for DML and DDL Temporal constraints

Additional Options for Compression

Block level compression VLC support for VARCHAR (was previously CHAR only) Algorithmic compression (gives a choice of algorithm)

Page 27: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 27 > 9/24/12

Teradata Database 14.00 December, 2011 DRA3 Q

uality

/

Su

pp

ort-

ab

ility

• RSS redesign for High Performance Application

Mode

• User Mode TPA

• Client and OS Version Identification

Perfo

rm

an

ce

• Column Partitioned Tables

• Allow Hash Join for outer and semi-joins

• Increased partition limits

• TVS Initial data temperature enhancements

• Enhance & Automate Stats Collection

• Reduce overhead for collecting statistics, assist on when/what

to collect and additional statistic types

Activ

e E

nab

le

• Single System Availability Improvements

• Re-drive queries without user intervention (Gemini)

• Write from Fallback

•Partial On-line Reconfigurator & Estimator

• Dual System Availability Improvements –

Gemini support

•TASM: Support for new priority scheduler

• Deterministic Priority Scheduler

• WD Quota Priority Management (SLG Responsiveness)

• Virtual TDWM

Ease o

f U

se

• Industry Compatibility

• Additional Domain Specific Functions

• New Data Types (NUMBER, ARRAY)

• Expand by Business Days

• Performance Data Collection & Reporting

En

terp

ris

e F

it

• Temperature Based Block Level Compression

• Mandatory Access Controls

• Performance for Distinct UDTs

• Primary and Secondary Indexes on UDTs

• Very Large System Support

• New BAR Architecture

• Support of SLES 11

UDF for Reserved Query Band Names

• Separate Logon Source String Into Multiple Columns

Green lettering = NEW REQUIREMENT

Resource ADD

Page 28: Teradata Overview v1
Page 29: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 29 > 9/24/12

Appendix

Geospatial

Temporal

Teradata/Oracle Code Differences

Page 30: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 30 > 9/24/12

Teradata

33° 01’20.90”

-117° 05’33.75”

Introduction to Geospatial

It’s Location Data and Analysis

Latitude (horizontal)

Longitude (vertical)

Find Teradata R&D Facility

17095 Via Del Campo

San Diego, CA 92127

Use Geospatial coordinates

33° 01’20.90” N

-117° 05’33.75” W

Page 31: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 31 > 9/24/12

Store

Modern Geospatial Analysis Can Be Computationally Intensive

Find the three closest stores within 50 miles of each customer location

More than 30 million customers

More than 2,200 stores

Target customers changing frequently

Manual Geospatial Analytics

•Calculate distance between each store and customer

> Calculations based on complex trigonometric functions

> More than 65 billion calculations

> Filter results <= 50 miles

> Retained 1 billion results

In-Database Geospatial Analytics

•Teradata Geospatial functions

>Set a 50-mile buffer (filter) for stores

>Identify customers within the buffer

>Calculate spherical distance for those customers

25 times faster

Store

Page 32: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 32 > 9/24/12

Teradata Data Warehouse with

Geospatial Analysis

Geospatial reference data

Business Data

Geospatial Data

Geospatial Functions

Geocoded data

Data Integration

Tools

EDW Load tools • Teradata Parallel

Transporter • Teradata Load Utilities

• Partner ETL Tools

Geospatial Tools • Teradata GeoImport /

GeoExport

Geocoding Tools

Teradata SQL

Geospatial middleware that manages and links Teradata to Geographic Information Systems (GIS), geospatial data sources, and geospatial

analytic tools

Export Data Files

Query, Reports, and Analysis

Geospatial Visualization Tools

GIS Integration

Teradata’s Geospatial Ecosystem

Customer, Transaction, and

Product data

Page 33: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 33 > 9/24/12

What is a Temporal Database?

A Temporal database includes

special support for the time

dimension. It’s a system that

provides special facilities

for storing, querying, and updating

historical and/or future data.

Conventional database systems –

including all of the existing

mainstream products – are not

temporal in this sense: They

provide essentially no special

support for temporal data.

– Source: Temporal Data and the Relational Model by C.J. Date, H. Darwen, N. Lorentzos

Page 34: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 34 > 9/24/12

The Current Situation

Non-temporal databases contain current data only

Data are changed or deleted as soon as the propositions represented by that data cease to be true

Conventional DBS technology can handle time instants reasonably well, but no time intervals

Today’s conventional databases provide neither a temporal query language, a temporal DDL or DML, or temporal constraints

Current techniques for supporting temporal are elaborate, laborious, and complex query code; or have to be handled externally via dedicated ‘time-processing’ applications

Page 35: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 35 > 9/24/12

The Benefits of Temporal DBS Support

Technical

Reduction in coding complexity

Reduce the cost of developing queries and maintaining temporal data

Improve development and maintenance productivity

Diminish the cost and effort of monitoring and maintaining temporal data chains

Business

Increased depth of Business Intelligence activities

Exploit an enhanced time dimension, enabling ‘chain of events’ and ‘point in time’ analytics

Uncover previously undetected business value from historical data

Easily reconstruct historical transaction details

Discover new ways to perform and compete

Page 36: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 36 > 9/24/12

With Temporal Support

VALIDTIME

SELECT b.item_id,b.item_serial_num

FROM objectlocation a,

objectlocation b

WHERE

a.item_id = 150

AND a.item_serial_num = 101

AND a.location = ‘Route to Store R’

AND b.location = a.location

Without Temp Support w/State Table SELECT b.item_id, b.item_serial_num, BEGIN(b.validtime), END(a.validtime)

FROM state_objectlocation a, state_objectlocation b

WHERE a.item_id = 150 and a.item_serial_num = 101 and a.location = ‘Route to Store R’

AND b.location = a.location

AND BEGIN(a.validtime) <= BEGIN(b.validtime)

AND END(a.validtime) > BEGIN(b.validtime)

AND END(a.validtime) <= END(b.validtime)

UNION ALL

SELECT b.item_id, b.item_serial_num, BEGIN(b.validtime), END(b.validtime)

FROM state_objectlocation a, state_objectlocation b

WHERE a.item_id = 150 and a.item_serial_num = 101 and a.location = ‘Route to Store R’

AND b.location = a.location

AND BEGIN(a.validtime) <= BEGIN(b.validtime)

AND END(a.validtime) >= END(b.validtime)

UNION ALL

SELECT b.item_id, b.item_serial_num, BEGIN(a.validtime), END(a.validtime)

FROM state_objectlocation a, state_objectlocation b

WHERE a.item_id = 150 and a.item_serial_num = 101 and a.location = ‘Route to Store R’

AND b.location = a.location

AND BEGIN(a.validtime) >= BEGIN(b.validtime)

AND END(a.validtime) <= END(b.validtime)

UNION ALL

SELECT b.item_id, b.item_serial_num, BEGIN(a.validtime), END(b.validtime)

FROM state_objectlocation a, state_objectlocation b

WHERE a.item_id = 150 and a.item_serial_num = 101 and a.location = ‘Route to Store R’

AND b.location = a.location

AND BEGIN(a.validtime) >= BEGIN(b.validtime)

AND BEGIN(a.validtime) < END(b.validtime)

AND END(a.validtime) >= END(b.validtime)

RFID Use Case Temporal Joins

Sequenced Query – Temporal Join A laptop (150,101) was found to be broken due to shock. Find out other items

that were on the same route (same truck) at the same time

a

b

a

b

b

a

a

b

Page 37: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 37 > 9/24/12

Oracle/Teradata Code Differences

Case Sensitivity

Data Types

Odds ‘n Ends

Null Handling

Functions

UDF’s

Page 38: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 38 > 9/24/12

Case sensitivity

Oracle is case-sensitive

Beware case-matching, to get identical results

Oracle migration

Match data to a reference table to determine the location of an ATM

Some entries in the reference table said ‘LOBBY’, some said ‘Lobby’

Final summation only looked as LOBBY, ignoring the Lobby entries

Teradata case-insensitivity meant we got a different (but correct) answer

Page 39: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 39 > 9/24/12

Data Types – be aware differences

Oracle tend to use VARCHAR2 for all character columns Choose a maximum for CHAR on Teradata, say 10

Oracle DATE format MAY incorporate a timestamp element Review each example case-by-case

ORA2TD can help here

Lazy Oracle implementation of NUMBER columns Review each example case-by-case

Note: Teradata V14 supports NUMBER

SEQUENCE columns For allocation of surrogate keys

Reserved words as column names Agree approach

Page 40: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 40 > 9/24/12

Odds ‘n Ends

Referential Integrity

Oracle DBAs use this a lot

Oracle users love it

Don’t be tempted!!

Do it in batch

Rarely seen RI implemented on a Teradata database

Triggers

Sometimes functionality can be hidden in triggers

Null string on Oracle – is a Character string of length zero

Beware concatenations

Oracle: ‘Hello’||null => ‘Hello’

Teradata: ‘Hello’||null => null

Use COALESCE to get around this

select nullif(coalesce(ColA, '') || coalesce(ColB, ''), '')

Page 41: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 41 > 9/24/12

Null Handling

In Oracle, the amount of space allocated to store a null in a column depends upon the position of the null with respect to the data values of the columns surrounding it. If, in a row, there are values stored in columns surrounding a null

column, then one byte is used to store the column containing the null. This one byte expresses as “0”.

trailing columns in a row contain nulls, no space is used to store the null column lengths

In Teradata A column value can default to null unless the data type declaration for the column is defined as NOT NULL. Without compression, a nullable column will be stored either as a

fixed length column or a variable length column depending upon its data type declaration.

If a row contains a column that has a value of null and compression is not defined for the column, the space will be reserved to store the column following the rules specified by its data type and length definition

If the Oracle database has a lot of Null columns that are migrated, it can lead to more space being taken up in TD than

Oracle!! -

Page 42: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 42 > 9/24/12

Null Handling-

Not knowing the demographics of the data to be migrated is the major contributor to space calculation errors. If many columns can and do contain nulls in Oracle, straight migration of the table DDL to Teradata can result in over allocation of space in rows.

Determine the number of nulls in the Oracle tables

Problem can be easily solved by using Teradata’s multi value compression on null columns

A Teradata Orange Book is available on this topic highlighting the specific method to determine the null

columns and compress them

Page 43: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 43 > 9/24/12

Functions – what’s different

Oracle Teradata

decode(A,B,C,D) case A when B then C else D end

greatest(a,b) case when a >= b then a else b end

least(a,b) case when a <= b then a else b end

instr(a,b) index(a,b)

length(a) char_length(a)

lpad(a,n) cast(a as char(n))

ltrim(a,c) trim(leading c from a)

months_between(d,e) ABS(cast((d - e month) as integer))

nvl(a,b) coalesce(a,b)

rtrim(a,c) trim(trailing c from a)

sign(a) case a when > 0 then 1

when < 0 then -1

else 0 end

to_char(x[,f]) cast(x as char [format f])

to_date(x[,f]) cast(x as date [format f])

to_number(x[,f]) cast(x as numeric [format f])

Page 44: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 44 > 9/24/12

UDF’s

Oracle Function Library

Collection of Teradata UDF’s created to work like Oracle native functions.

Over 30 functions in the library, such as add_months, ascii, ceil, chr, decode, floor, greatest, grepc, initcap, instr etc.

New Teradata V14 library of embedded functions: POWER, SIGN, TRUNC(Numeric), ROUND(Numeric), GREATEST, LEAST.

LAST_DAY, NEXT_DAY, MONTHS_BETWEEN, OADD_MONTHS,TRUNC(Date), ROUND(Date).

ASCII, CHR, LENGTH, INITCAP, LPAD, RPAD, LTRIM, RTRIM, OREPLACE, INSTR, OTRANSLATE, NGRAM, EDITDISTANCE, STRTOK_SPLIT_TO_TABLE, STRTOK.

TO_NUMBER, TO_CHAR(DateTime), TO_CHAR(Numeric), TO_TIMESTAMP, TO_DATE, TO_TIMESTAMP_TZ, TO_YMINTERVAL, TO_DSINTERVAL, NUMTODSINTERVAL,

NUMTOYMINTERVAL, TO_BYTES, FROM_BYTES.

REGEXP_SUBSTR, REGEXP_REPLACE, REGEXP_INSTR, REGEXP_SIMILAR, REGEXP_SPLIT_TO_TABLE.

EMPTY_BLOB, EMPTY_CLOB.

NVL, NVL2.

DECODE.

Also adds support for DECIMAL/NUMERIC and NUMBER parameters to the CEIL and FLOOR functions

Page 45: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 45 > 9/24/12

UDF’s

New Teradata V14 library of embedded functions: Numeric functions:

POWER, SIGN, TRUNC(Numeric), ROUND(Numeric), GREATEST, LEAST.

Date functions:

LAST_DAY, NEXT_DAY, MONTHS_BETWEEN, OADD_MONTHS,TRUNC(Date), ROUND(Date).

String functions:

ASCII, CHR, LENGTH, INITCAP, LPAD, RPAD, LTRIM, RTRIM, OREPLACE, INSTR, OTRANSLATE, NGRAM, EDITDISTANCE, STRTOK_SPLIT_TO_TABLE, STRTOK.

Conversion functions that convert data from one type to another:

TO_NUMBER, TO_CHAR(DateTime), TO_CHAR(Numeric), TO_TIMESTAMP, TO_DATE, TO_TIMESTAMP_TZ, TO_YMINTERVAL, TO_DSINTERVAL, NUMTODSINTERVAL, NUMTOYMINTERVAL, TO_BYTES, FROM_BYTES.

Regular expression-based string functions:

REGEXP_SUBSTR, REGEXP_REPLACE, REGEXP_INSTR, REGEXP_SIMILAR, REGEXP_SPLIT_TO_TABLE.

LOB-based functions: EMPTY_BLOB, EMPTY_CLOB.

Null handling functions: NVL, NVL2.

Miscellaneous functions: DECODE.

This feature also adds support for DECIMAL/NUMERIC and NUMBER parameters to the CEIL and FLOOR functions

Page 46: Teradata Overview v1

Teradata Confidential. Copyright Teradata Corporation. Use of these materials is subject to the terms and conditions of the partner agreement(s) between the member's company and Teradata. 46 > 9/24/12

•Teradata Magazine Article

Oracle to Teradata Migration Program