Basic Concepts On Teradata
Basic Concepts On Teradata
What is Teradata?
Teradata is a Relational Database Management System (RDBMS) for the worlds largest commercial databases.
Parallelism and scalability, are the main features of Teradata.
Teradata is comparable to a large database server, with multiple client application making inquiries against it concurrently.
Architectural representation
The Parsing Engine interprets the SQL command and converts the data record from the host into an AMP message. The Message Passing Layer distributes the row to the appropriate Access Module Processor (AMP). The AMP formats the row and writes it to its associated disks. The disk holds the row for subsequent access.
Teradata Objects
There are nine types of objects which may be found in a Teradata database/user. Tables are rows and columns of data Views predefined subsets of existing tables Macros predefined, stored SQL statements Triggers SQL statements associated with a table Stored Procedures program stored within Teradata User-Defined Function function (C program) to provide additional SQL functionality Join and Hash Indexes separate index structures stored as objects within a database Permanent Journals table used to store before and/or after images for recovery
These objects are created, maintained, and deleted using Structured Query Language (SQL).
Indexes in Teradata
Indexes are used to distribute and access rows from a table without having to search the entire table. Primary Index is the mechanism for retrieving and assigning a data row to an AMP and inturn to an AMPs disks. There are 2 types of primary index unique (UPI) and non-unique (NUPI). A secondary index is an alternate path to the data. There are 2 types of secondary index unique (USI) and non-unique (NUSI).
Bteq
Method to start the TD utilities are: Click on Start programs Teradata Client bteq Go to unix prompt and type bteq To run a file using bteq, the command is: .runfile = filenamepath The logon command is : .logon hostname/username, password;
OR
Error handling methods: -----------------------------.SET ERRORLEVEL 2168 SEVERITY 4, .IF ERRORLEVEL >= 14 THEN .QUIT 17 ;
.export data file = C:/output_data.txt, limit=100 select * from au2.trans ; .export reset;
Bteq import script: ----------------------
.IMPORT DATA file = e:\datain3 ; .QUIET ON .REPEAT * USING in_CustNo(INTEGER), in_SocSec(INTEGER), Filler(CHAR(30)), in_Lname(CHAR(20)), in_Fname(CHAR(10)) INSERT INTO Customer( Customer_Number, Last_Name, First_Name, Social_Security ) VALUES(:in_CustNo, :in_Lname, :in_Fname, :in_SocSec); .QUIT
SQL Assistant
Methods to start the sql assistant are: Go to the start program Teradata SQL Assistant OR Go to Run and type in queryman To login, on the left hand side corner there is a green button (marked in Red) which is for connecting to the database. Click on that. A window will open which will ask for username and password. Once logged in successfully one can start writing queries in the screen and press F5 to execute them.
For Mload
For Fastload
For Fastexport