Sei sulla pagina 1di 27

What is BTEQ?

O BTEQ is a variant oI the core set oI ANSI SQL with proprietary extensions` that are
speciIic to Teradata databases only.
O Similar to PL/SQL Ior Oracle or T-SQL Ior MicrosoIt SQL Server BTEQ includes the
ability to perIorm database-vendor-speciIic instructions that are particular to Teradata.
What is AMP?
O AMP, acronym Ior 'Access Module Processor, is the type oI vproc used to manage the
database, handle Iile tasks and and manipulate the disk subsystem in the multi-tasking
and possibly parallel-processing environment oI the Teradata Database.
What is FSLDM?
O Financial Services Logical Data Model (Teradata FS-LDM 7.0) its developed by
Teradata Ior the Iinancial sectors (SpeciaIially Ior Bank).
What are SET tables and MULTISET tables in Teradata?
O Set table Duplicates are not allowed while insertion.
O Multiset table Duplicates are allowed.
How Teradata makes sure that there are no duplicate rows being inserted when its a SET table?
O Teradata will redirect the new inserted row as per its PI to the target AMP (on the basis oI
its row hash value), and iI it Iind same row hash value in that AMP (hash synonyms) then
it start comparing the whole row, and Iind out iI duplicate.
O II its a duplicate it skips it without throwing any error.
What is the diIIerence between Global temporary tables and Volatile temporary tables?
Global Temporary tables (GTT):
O When they are created, its deIinition goes into Data Dictionary.
O When materialized data goes in temp space.
O Data is active upto the session ends, and deIinition will remain there upto its not dropped
using Drop table statement.II dropped Irom some other session then its should be Drop
table all;
O an collect stats on GTT.
Volatile Temporary tables (VTT):
O Table DeIinition is stored in System cache.
O Data is stored in spool space.
O Data and table deIinition both are active only upto session ends.
O Stats can not be collected or VTT.
O an not have deIault values on column level while creating table.
What is Fastload in Teradata?
As the name suggests Fasload is used to load an empty table in Teradata. Its a two phase
approach to load the data. No intermediate tables are required.
1. It moves all the records to all the AMPs without any hashing .
2. AIter giving endloading command Amp will hashes the record and send it to the
appropriate AMPS .
However it has Iew prerequisites:
To perIorm Fload:
O Target table must be empty.
O PerIorms only Inserts (No updates).
O Only one target table at a time.
O an not have secondary indexes.
What is Multiload in Teradata?
Teradata MultiLoad is a command-driven parallel load utility Ior high-volume batch
maintenance on multiple tables and views oI the Teradata Database. It is specially designed Ior
high-speed batch creation and maintenance oI large databases.
O Multiload allows nonunique secondary indexes automatically rebuilds aIter loading.
Loading happens in 5 phases in mulitload:
1. Gets the import Iile and checks the script.
2. Reads the record Irom the base table and store in the work table.
3. Locks the table header.
4. DML opreations will be done in the tables
5. Table locks will be released and work tables will be dropped.
How Indexing works in Teradata?
In general indexing is a way to physically reorganise the records to enable some Irequently used
queries to run Iaster.
Indexes in Teradata are bit diIIerent than other databases.
Primary Index(PI) in Teradata is solely related to the data distribution i.e. decide how evenly the
data can be distributed across all AMPs.
Primary Index with Unique attribute or Primary Key (PK) becomes Unique Primary Index(UPI).
Uniqueness oI the Primary index is ensured by additional index on the same column which is a
Unique Secondary Index(USI). ThereIore UPI automatically creates USI on the same column.
The Secondary Indexes are the traditional indexes which are basically pointers to the original
row.
Pow do you seL Lhe sesslon mode parameLers ln 81LC?
Answer
seL sesslon LransacLlon AnSl /* Lhls ls Lo seL AnSl mode */
seL sesslon LransacLlon 81L1 /* Lhls ls Lo seL 1eradaLa LransacLlon mode */

1hese commands have Lo be enLered before logglng Lo Lhe sesslon


WhaL ls Lhe command ln 81LC Lo check for sesslon seLLlngs ?
Answer
1he 81LC SPCW CCn18CL command dlsplays 81LC seLLlngs


Pow do you submlL bLeq scrlpL (baLch mode)?
Answer
1 SLarL Lhe 81LC by Lyplng 81LC
2 LnLer Lhe followlng command
run flle 81LCScrlpLbLq
C8
1 8Leq 81LCScrlpLbLq


81LCScrlpLbLq conLalns followlng

logon 127001/dbc dbc
sel Lop 10 * from dbcLables
qulL


ls Llke comparlslon casesenslLlve ln 1eradaLa?
Answer

LlkL operaLor ls noL case senslLlve ln 1eradaLa
Conslder Lhe followlng example
SelecL l_name from employee where l_name llke !C
1he followlg query wlll plck values maLchlnf wlLh !C and [o as well slnce LeradaLa ls noL casesenslLlve

1o overcome Lhls problem a new funcLlon called CASLSLClllC ls used ln 1L8AuA1A as follows
SelecL l_name from employee where l_name (CASLSLClllC) llke !C

WhaL does u8C Lable command do?

lL deleLes all daLa ln emp_uA1A
8emoves Lhe emp_uA1A deflnlaLlon from Lhe daLa dlcLlonary
8emoves all expllclL access rlghLs on Lhe Lable

Pow do you seL defaulL daLe seLLlng ln 81LC?
Answer

1here are Lwo defaulL daLe seLLlng ln 81LC 1hey have Lo be seL afLer logglng on Lo Lhe sesslon
1hey are

SeL sesslon daLeform AnSluA1L /*formaL ls yyyymmdd */
SeL sesslon daLeform lnLegerdaLe /* formaL ls yy/mm/dd LeradaLa daLe formaL */

ulfference beLween lnner [oln and ouLer [oln?

An lnner [oln geLs daLa from boLh Lables where Lhe speclfled daLa exlsLs ln boLh
Lables
An ouLer [oln geLs daLa from Lhe source Lable aL all Llmes and reLurns daLa from
Lhe ouLer [olned Lable CnL? lf lL maLches Lhe crlLerla

WhaL ls mulLl lnserL?

lnserLlng daLa records lnLo Lhe Lable uslng mulLlple lnserL sLaLemenLs
uLLlng a Seml colon ln fronL of Lhe key word lnSL81 ln Lhe nexL sLaLemenL raLher Lhan
1ermlnaLlng Lhe flrsL sLaLemenL wlLh a seml colon achleves lL

lnserL lnLo Sales selecL * from cusLomer"
lnserL lnLo Loan selecL * from cusLomer"


Pow Lo flnd dupllcaLes ln a Lable?
Croup by Lhose flelds and selecL ld counL(*) from Lable group by ld havlng counL
(*) 1


Pow do you see a uuL for an exlsLlng Lable?
8y uslng show Lable command


Whlch ls more efflclenL C8Cu 8? or ulS1lnC1 Lo flnd dupllcaLes?
WlLh more dupllcaLes C8Cu 8? ls more efflclenL lf only a few dupllcaLes exlsL
ulS1lnC1 ls more efflclenL


SynLax for CASL WPLn sLaLemenL?
CASL value_expresslon_1 WPLn value_expresslon_n 1PLn scalar_expresslon_n
Lnu
How to select first N Records in Teradata?

nswers:
To select N records in Teradata you can use RNK function. Query syntax would be as follows
SELECT BOOK_NE, BOOK_COUNT, RNK(BOOK_COUNT) FRO LBRRY QULFY <= 10;


Lxplaln 1uM (1eradaLa arallel uaLa ump) uLlllLy ln 1eradaLa?

Answers

* 1uM allows near real Llme updaLes from 1ransacLlonal SysLems lnLo Lhe uaLa Warehouse
* lL can perform lnserL updaLe and ueleLe operaLlons or a comblnaLlon from Lhe same source
* lL can be used as an alLernaLlve Lo MLCAu for low volume baLch malnLenance of large daLabases
* 1uM allows LargeL Lables Lo have Secondary lndexes !oln lndexes Pash lndexes 8eferenLlal
lnLegrlLy opulaLed or LmpLy 1able MulLlseL or SeL 1able or 1rlggers deflned on Lhe 1ables
* 1uM can have many sesslons as lL doesn'L have sesslon llmlL
* 1uM uses row hash locks Lhus allowlng concurrenL updaLes on Lhe same Lable



Pow can you deLermlne l/C and Cu usage aL a user level ln 1eradaLa?

Answers

?ou can flnd ouL l/C and Cu usage from Lhls uaLa ulcLlonary 1able u8CAMuSACL

SLLLC1 ACCCun1nAML uSL8nAML SuM(Cu1lML) AS Cu SuM(ulSklC) AS ulSklC l8CM
u8CAMuSACL C8Cu 8? 12 C8uL8 8? 3 uLSC



Pow can you flnd Lhe 1able Space Slze of your Lable across all AMs?

Answers

?ou can flnd Lhe 1able Space Slze of your Lable from Lhls uaLa ulcLlonary 1able u8C1A8LLSlZL

SLLLC1 uA1A8ASLnAML 1A8LLnAML SuM(Cu88Ln1L8M) l8CM u8C1A8LLSlZL WPL8L
uA1A8ASLnAML '' Anu 1A8LLnAML '' C8Cu 8? uA1A8ASLnAML 1A8LLnAML


Pow can you flnd Lhe 1eradaLa 8elease and verslon lnformaLlon from uaLa ulcLlonary 1able?
Answers

1o flnd 8elease and verslon lnformaLlon you can query Lhls uaLa ulcLlonary Lable u8Cu8ClnlC

SLLLC1 * l8CM u8Cu8ClnlC


Pow can you Lrack Logln arameLers of users ln 1eradaLa?
Answers

?ou can vlew all Lhese parameLers ln Lhls uaLa ulcLlonary 1able u8CLCCCnCll
SLLLC1 LCCuA1L LCC1lML uSL8nAML LvLn1 l8CM u8CLCCCnCll


Pow can you use PASP lunC1lCnS Lo vlew uaLa ulsLrlbuLlon across all AMs ln 1eradaLa?
Answers

Pash luncLlons can be used Lo vlew Lhe daLa dlsLrlbuLlon of rows for a chosen prlmary lndex

SLLLC1 PASPAM(PASP8uCkL1(PASP8CW())) AS AM#" CCun1(*) l8CM C8Cu 8? 1 C8uL8 8? 2
uLSC

PASP8CW reLurns Lhe row hash value for a glven value
PASP8uCkL1 Lhe grouplng of a speclflc hash value
PASPAM Lhe AM LhaL ls assoclaLed wlLh Lhe hash buckeL

1hls ls really good by looklng lnLo Lhe resulL seL of above wrlLLen query you can easlly flnd ouL Lhe uaLa
ulsLrlbuLlon across all AMs ln your sysLem and furLher you can easlly ldenLlfy uneven daLa dlsLrlbuLlon


Pow do you Lransfer large amounL of daLa ln 1eradaLa?
Answers

1ransferrlng of large amounL of daLa can be done uslng varlous AppllcaLlon 1eradaLa uLlllLles whlch
resldes on Lhe hosL compuLer ( Malnframe or WorksLaLlon) le 81LC lasLLaod MulLlLoad 1pump and
lasLLxporL

* 81LC (8aslc 1eradaLa Cuery) supporLs all 4 uMLs SLLLC1 lnSL81 uuA1L and uLLL1L 81LC also
supporL lMC81/LxC81 proLocols
* lasLload MulLlLoad and 1pump Lransfer Lhe daLa from PosL Lo 1eradaLa
* lasLLxporL ls used Lo exporL daLa from 1eradaLa Lo Lhe PosL


Pow does Pashlng happens ln 1eradaLa?

Answers

* Pashlng ls Lhe mechanlsm Lhrough whlch daLa ls dlsLrlbuLed and reLrleved Lo/from AMs
* rlmary lndex (l) value of a row ls Lhe lnpuL Lo Lhe Pashlng AlgorlLhm
* 8ow Pash (32blL number) value ls Lhe ouLpuL from Lhls AlgorlLhm
* 1able ld + 8ow Pash ls used Lo locaLe Cyllnder and uaLa block
* Same rlmary lndex value and daLa Lype wlll always produce same hash value
* 8ows wlLh Lhe same hash value wlll go Lo Lhe same AM

So daLa dlsLrlbuLlon depends dlrecLly on Lhe 8ow Pash unlqueness be careful whlle Chooslng lndexes ln
1eradaLa


Pow Lo ellmlnaLe roducL !olns ln a 1eradaLa SCL query?
Answers

1 Lnsure sLaLlsLlcs are collecLed on [oln columns and Lhls ls especlally lmporLanL lf Lhe columns you are
[olnlng on are noL unlque
2 Make sure you are referenclng Lhe correcL allas
3 Also lf you have an allas you musL always reference lL lnsLead of a fully quallfled Lablename
4 SomeLlmes producL [olns happen for a good reason !olnlng a small Lable (100 rows) Lo a large Lable (1
mllllon rows) a producL [oln does make sense



Pow Lo selecL flrsL n 8ecords ln 1eradaLa?
Answers

1o selecL n records ln 1eradaLa you can use 8Ank funcLlon Cuery synLax would be as follows
SLLLC1 8CCk_nAML 8CCk_CCun1 8Ank(8CCk_CCun1) A l8CM Ll88A8? CuALll? A 10


Pow Lo vlew every column and Lhe columns conLalned ln lndexes ln 1eradaLa?
Answers

lollowlng query descrlbes each column ln Lhe 1eradaLa 8u8MS
SLLLC1 * l8CM u8C1vllelds

lollowlng query descrlbes columns conLalned ln lndexes ln Lhe 1eradaLa 8u8MS
SLLLC1 * l8CM u8Clndexes


WhaL are Lhe 3 phases ln a MulLlLoad uLlllLy?
Answers

* rellmlnary hase 8aslc SeLup
* uML hase CeL uML sLeps down on AMs
* AcqulslLlon hase Send Lhe lnpuL daLa Lo Lhe AMs and sorL lL
* AppllcaLlon hase Apply Lhe lnpuL daLa Lo Lhe approprlaLe 1argeL 1ables
* Lnd hase 8aslc Cleanup


WhaL are Lhe funcLlons of a 1eradaLa u8A?
Answers

lollowlng are Lhe dlfferenL funcLlons whlch a u8A can perform
1 user ManagemenL CreaLlon and managlng users uaLabases 8oles roflles and AccounLs
2 Space AllocaLlon Asslgnlng ermanenL Space Spool Space and 1emporary Space
3 Access of uaLabase Cb[ecLs CranLlng and 8evoklng Access 8lghLs on dlfferenL daLabase ob[ecLs
4 SecurlLy ConLrol Pandllng logon and logoff rules for users
3 SysLem MalnLenance SpeclflcaLlon of sysLem defaulLs resLarL eLc
6 SysLem erformance use of erformance MonlLor(MCn) rlorlLy Scheduler and !ob Schedullng
7 8esource MonlLorlng uaLabase Cuery Log(u8CL) and Access Logglng
8 uaLa Archlves 8esLores and 8ecovery A8C uLlllLy and ermanenL !ournals


WhaL are Lhe MulLlLoad uLlllLy llmlLaLlons?
Answers

MulLlLoad ls a very powerful uLlllLy lL has followlng llmlLaLlons

* MulLlLoad uLlllLy doesn'L supporL SLLLC1 sLaLemenL
* ConcaLenaLlon of mulLlple lnpuL daLa flles ls noL allowed
* MulLlLoad doesn'L supporL ArlLhmaLlc luncLlons le A8S LCC eLc ln Mload ScrlpL
* MulLlLoad doesn'L supporL LxponenLlaLlon and AggregaLor CperaLors le AvC SuM eLc ln Mload
ScrlpL
* MulLlLoad doesn'L supporL uSls (unlque Secondary lndexes) 8efrenLlal lnLegrlLy !oln lndexes Pash
lndexes and 1rlggers
* lmporL Lask requlre use of l (rlmary lndex)


WhaL are 1uM uLlllLy LlmlLaLlons?
Answers

lollowlng are Lhe llmlLaLlons of 1eradaLa 1uM uLlllLy
* use of SLLLC1 sLaLemenL ls noL allowed
* ConcaLenaLlon of uaLa llles ls noL supporLed
* LxponenLlal AggregaLe CperaLors are noL allowed
* ArlLhmaLlc funcLlons are noL supporLed


WhaL ls llLLL8 command ln 1eradaLa?
Answers

Whlle runnlng lasLload or MulLlload lf you don'L wanL Lo load a parLlcular fleld from Lhe daLaflle Lo Lhe
LargeL Lable Lhen use Lhe llLLL8 command Lo achleve Lhls SynLax for llLLL8 command would be as
followlng

LA?Cu1 llLL_8CuuC1 /* lL ls lnpuL flle layouL name */
llLLu rod_no * char(11) /* 1o load daLa lnLo rod_no */
llLLu rod_name * char(11) /* 1o load daLa lnLo rod_name */
llLLu LocaLlon * char(11) /* 1o load daLa lnLo LocaLlon */
llLLL8 rod_Chars * char(20) /* 1o sklp Lhe value for Lhe nexL 3 locaLlons */


WhaL ls Lhe dlfference beLween Access Logglng and Cuery Logglng ln 1eradaLa?
Answers

1 Access Logglng ls concerned wlLh securlLy (le who's ls dolng whaL) ln access logglng you ask Lhe
daLabase Lo log who's dolng whaL on a glven ob[ecL 1he lnformaLlon sLored ls based on Lhe ob[ecL noL
Lhe SCL flred or Lhe user who flred lL
2 Cuery Logglng (u8CL) ls used for debugglng (le whaL's happenlng around ?) lncase of u8CL
daLabase keep on Lracklng varlous parameLers le Lhe SCLs 8esource Spool usage SLeps and oLher
Lhlngs whlch help you undersLand whaL's golng on Lhe lnformaLlon ls frulLful Lo debug a problem
lurLher u8CL ls enabled on a user ld raLher Lhan an ob[ecL llke say 1able or so


WhaL ls Lhe dlfference beLween SubCuery Co8elaLed SubCuery?
Answers

When querles are wrlLLen ln a nesLed manner Lhen lL ls Lermed as a subquery A SubCuery geL
execuLed once for Lhe parenL sLaLemenL whereas Co8elaLed SubCuery geL execuLed once for each row
of Lhe parenL query

SelecL Lmpname uepLno Salary from Lmployee Lmp where Salary (SelecL Max(Salary) from Lmployee
where uepLno LmpuepLno) order by uepLno


WhaL ls 8econflguraLlon uLlllLy ln 1eradaLa and WhaL lL ls used for?
Answers

* When we feed rlmary lndex value Lo Pashlng AlgorlLhm Lhen lL glves us 8ow Pash(32 blL number)
value whlch ls used Lo make enLrles lnLo Pash Maps
* Pash Maps are Lhe mechanslm for deLermlnlng whlch AM wlll be geLLlng LhaL row
* Lach Pash Map ls an array of 63336 enLrles and lLs slze ls close Lo 128k8

When 1eradaLa ls lnsLalled on a sysLem Lhen Lhere are some scrplLs whlch we need Lo execuLe le ul
ScrlpLs So lL creaLes a Pash Maps of 63336 enLrles for Lhe currenL conflguraLlon 8uL whaL lf you wanL
Lo add some more AMs lnLo your sysLem?

8econflguraLlon (8econflg) ls a Lechnlque for changlng Lhe conflguraLlon (le changlng Lhe number of
AMs ln a sysLem) and ls conLrolled by Lhe 8econflguraLlon Pash Maps SysLem bullds 8econflguraLlon
Pash Maps by reasslgnlng hash map enLrles Lo reflecL new conflguraLlon of sysLem

LeLs undersLand Lhls concepL wlLh Lhe help of an example suppose you have a 4 AMs sysLem whlch
holds 63336 enLrles Lach AM ls responslble for holdlng (63336/416384) 16384 enLrles

now you have added 2 more AMs ln your currenL conflguraLlon so you need Lo reconflgure your
sysLem now each AM would be responslble for holdlng (63336/610922) 1

Teradata Architecture

Teradata Architecture
Symmetric multiprocessing (SMP) - A single node that contains multiple PUs sharing a memory pool.
Massively parallel processing (MPP) - Multiple SMP nodes working together comprise a larger conIiguration. The
nodes are connected using the BYNET, which allows multiple virtual processors on multiple system nodes to
communicate with each other.
Shared Nothing Architecture(MPP) - means that each vproc(Access Module Processors and Parsing Engines are
Virtual processors) is responsible Ior its own portion oI the database and do not share common components.each
AMP manages its own dedicated memory space and the data on its own vdisk -- these are not shared with other
AMPs. Each AMP uses system resources independently oI the other AMPs so they can all work in parallel Ior high
system perIormance overall
A node is made up oI various hardware and soItwares
A clique is a set oI Teradata nodes that share a common set oI disk arrays. abling a subset oI nodes to the same
disk arrays creates a clique.
A disk array is a conIiguration oI disk drives that utilizes specialized controllers to manage and distribute data and
parity acroos the disks while providing Iast access and data integrity
RAID 5 Data and parity protection striped across multiple disks
RAID 1 Each disk has a physical mirror replicating the data
Open Source Web ontent Management
-----------------------------------
Teradata Storage Process
The Parsing Engine interprets the SQL command and converts the data record Irom the host into an AMP message
The BYNET distributes the row to the appropriate AMP
The AMP Iormats the row and writes it to its associated disks
The disk holds the row Ior subsequent access
Sample covering letters Ior Permanent Jobs
-----------------------------------
Teradata Retrieval Process
The Parsing Engine dispatches a request to retrieve one or more rows
The BYNET ensures that appropriate AMP(s) are activated
The AMPs locate and retrieve desired rows in parallel access and will sort, aggregate or Iormat iI needed
The BYNET returns retrieved rows to parsing engine
The Parsing Engine returns row(s) to requesting client application
Free Online ollege Degree
-----------------------------------
The BYNET is responsible for
Point-to-point communications between nodes and virtual processors
Merging answer sets back to the PE
making Teradata parallelism possible
Free Employment Aptitude Test
-----------------------------------
The Parsing Engine is responsible for
Managing Individual sessions (up to 120)
Parsing and optimizing SQL requests
Dispatching the optimized plan to the AMPs
Sending the answer set response back to the requesting client
SoItware Testing jobs? Jobs For Freshers
-----------------------------------
The AMPs is responsible for
Storing and retrieving rows to and Irom the disks
Lock Management
Sorting rows and aggregating columns
Join Processing
Output conversions and Iormatting
reating answer sets Ior clients
Disk space management and accounting
Comparison of the Teradata loading utilities
The article contains comparison and main Ieatures oI the data loading tools provided by
Teradata. The tutorial illustrates main Ieatures oI Teradata Multiload , FastLoad and TPump
(Parallel Data Pump) and provides sample real-liIe uses oI those tools.

Scroll down Ior the sample scripts which illustrate diIIerent ways to load a sample Iixed-length
extract into a Teradata database using FastLoad, MultiLoad and Parallel Data Pump (TPump).
Teradata Fast Load
O Main use: to load empty tables at high speed.
O The target tables must be empty in order to use FastLoad
O Supports inserts only - it is not possible to perIorm updates or deletes in FastLoad
O Although Fastload uses multiple sessions to load the data, only one target table can be
processed at a time
O Teradata Fastload does not support join indexes, Ioreign key reIerences in target tables and
tables with secondary index deIined. It is necessary to drop any oI the constraints listed beIore
loading and recreate them aIterwards.
O The maximum number oI concurrent Teradata Fastload tasks can be adjusted by a system
administrator.
O Fastload runs in two operating modes: Interactive and Batch
O Duplicate rows will not be loaded
Teradata Multi Load
O Main use: Load, update and delete large tables in Teradata in a bulk mode
O EIIicient in loading very large tables
O Multiple tables can be loaded at a time.
O Updates data in a database in a block mode (one physical write can update multiple rows)
O Uses table-level locks
O Resource consumption: loading at the highest possible throughput
O Duplicate rows allowed
Teradata Parallel Data Pump (TPump)
O Main use: to load or update a small amount of target table rows
O Sends data to a database as a statement which is much slower than using bulk mode
O TPump uses row-level hash locks
O Resource consumption: loading speed can be adjusted using a built-in resource consumption
management utility. The throughput can be turned down in peak periods.
O TPump does not support MULTI-SET tables.
Teradata FastLoad example
The Iollowing script attached below will load a sample Iixed-length columns extract into a
Teradata database using FastLoad.

Use the Iollowing command to run load the ggclients.Iastload Iile using Teradata FastLoad
script:
fastload < ggclients.fastload


ontents oI a ggclients.Iastload script:
SESSIJNS 4;
ERRLIMIT 25;
logon tdpid/username,password;

create table gg_cli (
wh_cust_no integer not null,
cust_name varchar(200),
bal_amt decimal(15,3) format ,.
)
unique primary index( wh_cust_no ) ;

SET RECJRD UNFJRMATTED;

define
wh_cust_no(char(10)), delim1(char(1)),
cust_name(char(200)), delim2(char(1)),
bal_amt(char(18)), delim3(char(1))
newlinechar(char(1))
file=insert.input;

SHJW;

BEGIN LJADING gg_cli errorfiles error_1, error_2;

insert into gg_cli (
:wh_cust_no,
:cust_name,
:bal_amt
);

END LJADING;

logoff;

Teradata MultiLoad example
The Iollowing script attached below will load a sample Iixed-length columns extract into a
Teradata database using MultiLoad.

Use the Iollowing command to run load the ggclients.mload Iile using Teradata FastLoad script:
mload < ggclients.mload


ontents oI a ggclients.mload mload script:
.logtable inslogtable;
.logon tdpid/username,password;

create table gg_cli (
wh_cust_no integer not null,
cust_name varchar(200),
bal_amt decimal(15,3) format ,.
)
unique primary index( wh_cust_no ) ;

.BEGIN IMPJRT MLJAD tables gg_cli;

.layout ggclilayout;
.field wh_cust_no 1 char(10);
.field cust_name 12 char(200);
.field bal_amt 213 char(18);
.dml label insertclidml;

insert into gg_cli.;

.import infile insert.input
format text
layout ggclilayout
apply insertclidml;
.END MLJAD;

.logoff;


Teradata TPump example
The sample script attached below loads a sample Iixed-length columns extract into a Teradata
database using Parallel Data Pump - Teradata TPump.

ontents oI a ggclients.tpump script:
.logtable tpumplogtable;
.logon tdpid/username,password;

.BEGIN LJAD SESSIJN 4;

.layout ggclilayout;
.field wh_cust_no 1 char(10);
.field cust_name 12 char(200);
.field bal_amt 213 char(18);
.dml label insertclidml;

insert into gg_cli.;

.IMPJRT INFILE insert.input
layout ggclilayout
apply insertclidml;
.END LJAD;

.logoff;



What Is Teradata?

Teradata is a relational database management system (RDBMS) that is:
An open system, running on a UNIX MP-RAS or Windows 2000 server platIorm.
apable oI supporting many concurrent users Irom various client platIorms
(over a TP/IP or IBM channel connection).
ompatible with industry standards (ANSI compliant).
Built on a parallel architecture

Teradata ompetitive Advantages
Unlimited, Proven Scalability
Most oncurrent Users
Unlimited Paralellism - Parallel sorts/aggregations, temporary tables -
'shared-nothing architecture
Mature Optimizer - omplex queries, joins per query, ad-hoc
processing
Model the Business - 3NF, robust view processing, star schema
Lowest TO - Ease oI setup & maintenance, robust parallel utilities, no
re-orgs, lowest disk to data ratio, robust expansion utility
High Availability - no single point oI Iailure, scalable data loading,
parallel load utilitie


Teradata A BrieI History
1979Teradata orporation is Iounded in Los Angeles, A to develop a massively
parallel database.


1982
YNET technology is patented.
1984
Teradata sells Iirst DB/1012 to Wells Fargo Bank oI aliIornia.
1987
Teradata orporation becomes a public company.
1989
Teradata orp. and NR partner on next generation oI DB.
1990
First Terabyte-sized system installed and in production.
1991
NR is acquired by AT&T.
1992
Teradata is merged into NR.
1995
Teradata Version 2 Ior the UNIX operating system released.
1996
NR is only vendor to run multi-user TP-D benchmarks. AT&T spins oII
NR orporation with Teradata product.
1997
Teradata database becomes industry leader in scalable data warehousing.
100 Gigabyte TP-D Benchmark leader.
1998
24 Terabyte system in production. Teradata ported to Windows NT.
1999
1 TB TP-D winner
2000
50 TB system in production! Teradata Ior Windows 2000 becomes
available. Teradata Division created.




How Large Is a Trillion?
1 million seconds 11.57 days
1 billion seconds 31.6 years
1 trillion seconds 31,688 years
1 million inches 15.7 miles
1 trillion inches 15,700,000 miles (30 round trips to the moon)
$1 million
$ .01 Ior every person in U.S.
$1 billion
$ 3.64 Ior every person is U.S.
$1 trillion
$ 3,636 Ior every person in U.S.
1 Kilobyte
103 1000 bytes
1 Megabyte 106 1,000,000 bytes
1 Gigabyte 109 1,000,000,000 bytes
1 Terabyte 1012 1,000,000,000,000 bytes
1 Petabyte 1015 1,000,000,000,000,000 bytes
1 Exabyte
1018 1,000,000,000,000,000,000 bytes
1 Zetabyte
1021 1,000,000,000,000,000,000,000 bytes
1 Yottabyte 1024 1,000,000,000,000,000,000,000,000 bytes



What Is a Teradata Database?
DatabaseA collection oI permanently stored data that is:
Logically relateddata relates to other data.
Sharedmany users may access data.
Protectedaccess to data is controlled.
Manageddata has integrity and value.


What Is a Node?
Applications, the LAN gateway, and channel-driver soItware run as processes.
AMPs and PEs are virtual processors (vprocs) which run under Parallel Database
Extensions (PDE).
AMPs are associated with virtual disks (vdisks).
A single node is a Symmetric Multi-Processor (SMP)
Vdisk
Vdisk
Vdisk
Vdisk
hannel-
Attached
Systems
HANNEL
LAN
P
W/S
TERADATA
GATEWAY
PDE
HANNEL DRIVER
UNIX
OR
WIN
2K
BYNET DRIVER
AMP
VPRO
AMP
VPRO
AMP
VPRO
AMP
VPRO
PE
VPRO
PE
VPRO
APPLIATION
APPLIATION
OR UTILITY
Incorporates
Teradata`s
'Shared-Nothing
Architecture

8?nL1 Cabllng
(flber channel)
provldes
lnLerconnecL for
M SysLem
MPP System
Multiple nodes are conIigured into a Massively Parallel Processing (MPP)
system.
A physical message-passing layer called the BYNET is used to interconnect
multiple nodes.
Teradata is linearly expandableas your database grows, additional nodes
may be added.
The BYNET can support 512 nodes.
Teradata runs on all NR Server platIorms


liques

A clique is a deIined set oI nodes
with Iailover capability.
All nodes in a clique are able to
access the vdisks oI all AMPs in
the clique.
II a node Iails, its vprocs will
migrate to the remaining nodes
in the clique.
Each node can support 128
vprocs.
lique 1
lique 2
lique 3
Disk cabling groups
nodes into cliques.
Major omponents oI a Teradata System


BYNET

The Parsing Engine is responsible
Ior:
Managing individual sessions
(up to 120 sessions per PE)
Parsing and optimizing your
SQL requests
Dispatching the optimized plan
to the AMPs
EBDI/ASII input conversion
(iI necessary)
Sending the answer set
response back to the requesting
client
Session
ontrol
Parser
Dispatcher
Optimizer
SQL Request
Answer Set Response
BYNET
AMP
AMP
AMP
Parsing
Engine
AMP

Teradata Optimizer
Available Units
oI Parallelism
Data
Demographics
Teradata`s Optimizer is:
Parallel-aw are
Intelligent
ost-based
System
onIiguration


The Access Module Processor (AMP)
SQL Request
Answer Set Response
Storing and retrieving rows to and
Irom disks
Lock management
Sorting rows and Aggregating
columns
Join processing
Output conversion and Iormatting
reating answer sets Ior clients
Disk space management and
Accounting
Special utility protocols
Recovery processing
AMPs are responsible Ior:
AMPs perIorm
all tasks in parallel
Teradata`s
'Shared-Nothing
Architecture
BYNET
AMP
AMP
AMP
AMP
Parsing
Engine

Potrebbero piacerti anche