Vous êtes sur la page 1sur 19

1

TERADATA INTERVIEW QUESTIONS


BTEQ in Teradata Database
'BTEQ' stands for Basic Teradata Query program. BTEQ is a front end tool for submitting SQL
queries.
BTEQ is client software that resides on your network or channel-attached host. After starting
BTEQ, you will log on to Teradata using a TDP-id (Teradata Director Program id), your user
id and password. The TDP-id identifies the instance of Teradata you are going to access.
TDP's come in two varieties
1. The standard TDP for channel-attached clients,
2. The Micro-TDP (or MTDP) for network-attached clients.
TDP's are involved in getting your SQL requests routed to a Parsing Engine (PE) which
validates your request and passes it to the Access Module Processors (AMPs). AMPs retrieve
the answer sets from the disks and send the response set back to the PE which in turn
forwards it to the TDP and ultimately back to you at your session.
BTEQ is Teradata client software which is installed on mainframe hosts or network attached
clients. It operates under all host systems and local area networks (LANs).
Facts about BTEQ commands:

BTEQ commands must be preceded by a period (.) or terminated by a semi-colon or


both.

Provide an output listing (an audit trail) of what occurred.


Additional commands for report formatting are available.
BTEQ commands are not case-sensitive.
Invoking BTEQ varies depending on the platform. In the UNIX environment, simply
typing in the command 'bteq' is required.
Using BTEQ Interactively
There are two ways to submit SQL statements to BTEQ in interactive mode:

Type in SQL statements directly to the BTEQ prompt.


Open another window with a text editor. Compose SQL statements using the text
editor, then cut and paste the SQL to the BTEQ prompt.
Note:When a users log on to BTEQ by default a single session assigned to them.

How to select top 10 records from Teradata table?


Below is the Sql which can be used to get top 10 records from Teradata table Select Top 10 * From Employee;
The above sql will return 10 records from the Employee table.
Note: - It will return any 10 records from table and not the first 10 or last 10 which is
inserted into it.

TERADATA INTERVIEW QUESTIONS

What is Fast load utility in Teradata? How to use it?


FastLoad is one of the application utilities in Teradata which is used to load data into
empty table.
FastLoad loads data into an empty table in parallel, using multiple sessions to transfer
blocks of data. FastLoad achieves high performance by fully exploiting the resources of the
system.
Uses : -A typical use is to load the data to an empty "staging" table, and then using the
SQL INSERT/SELECT command we can move this data to an existing table.
Note :-FastLoad loads to a single empty table at a time.
Below are the steps and sample script is given to use the Fload utility in Teradata
Step 1:Create table at Teradata (make sure that you have not loaded data into this table)
CREATE SET TABLE DB.FLOAD_TEST ,FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
Trans_Number INTEGER NOT NULL,
Trans_Date DATE FORMAT 'YYYY-MM-DD',
Account_Number INTEGER NOT NULL,
Trans_ID CHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC,
Trans_Amount DECIMAL(12,2))
PRIMARY INDEX ( Account_Number );
Note :-FLOAD_TEST is the table created in database -DB.
Step 2: Write a Fload script and save it in your C drive (you can provide the different
location as well) with .fld extension , you can copy and paste below script and save in C:
drive with the name -Test_fload.fld
LOGON 127.0.0.1/username,password;
BEGIN LOADING DB.FLOAD_TEST ERRORFILES db1.fload_test _err1, db1.fload_test _err2;
DEFINE
in_transno

(INTEGER),

in_transdate

(CHAR (10), NULLIF='0000-00-00'),

in_accno

(INTEGER),

in_trans_id

(CHAR(10)),

in_trans_amt

(DECIMAL(12,2))

FILE = TestFloadData;

TERADATA INTERVIEW QUESTIONS


INSERT INTO DB.FLOAD_TEST
VALUES (:in_transno, :in_transdate (FORMAT 'YYYY-MM-DD'), :in_accno, :in_trans_id,
:in_trans_amt );
END LOADING;
LOGOFF;
Note: - 127.0.0.1- is the local hostname that you can take from
hostfile(C:\WINNT\system32\drivers\etc\hosts) ,username and password that you have
provided while creating the System DSN using ODBC to connect to teradata database.
In Fast load we need to provide 2 error tables to capture the error records.
Step 3:Put the data file at your C drive which contains the data that you want to load using
Fload into fload_test table (FILE) .
In above example datafile (FILE) is given as TestFloadData
Step 4: Go to command prompt to execute the Fload script (start -> run -> CMD to go to
command prompt)
Cmd prompt ->C:\>fastload < Test_fload.fld;

Types of Locks in Teradata Database?


There are 4 types of Locks in TeradataDatabase mentioned below
Access Lock:The use of an access lock allows for reading data while modifications are in process.
Access locks are designed for decision support on tables that are updated only by small,
single-row changes. Access locks is not concerned about data consistency. Access locks
prevent other users from obtaining the Exclusive locks on the locked data.
Read Lock:Read locks are used to ensure consistency during read operations. Several users may
hold concurrent read locks on the same data, during this time no data modification is
permitted. Read locks prevent other users from obtaining the Exclusive
locks and Write locks on the locked data.
Write Lock:Write locks enable users to modify data while maintaining data consistency. While the data
has a write lock on it, other users can only obtain an access lock. During this time, all
other locks are held in a queue until the write lock is released.
Exclusive Lock:Exclusive locks are applied to databases or tables and not to rows. When an exclusive lock
is applied, no other user can access the database or table. Exclusive locks are used when a

TERADATA INTERVIEW QUESTIONS


DDL command is executed .An exclusive lock on a database or table prevents other users
from obtaining any lock on the locked object.

Volatile Temporary Table in Teradata


There are three (Global,Volatile,Derived) types of Temporary Tables implemented in
Teradata and Volatile Temporary Tableis among one of them.
Below are the characteristics of Volatile table:1.
2.
3.
4.

Local to a session - it exists throughout the entire session, not just a single query.
It must be explicitly created using the CREATE VOLATILE TABLE syntax.
It is discarded automatically at the end of the session.
There is no data dictionary involvement.

DDL statement of Volatile Table :Create volatile table volatile_table1


(emp_number integer,
emp_name varchar(15),
phone_number integer);
Below is the sql to view the table in the database :help database db_teradata;

What is the index? How many types of indexes are available in Teradata
database?
A database index is a data structure that is used to access rows from a table without
having to search the whole table and hence improves the speed of data retrieval operations
from database table.
In the Teradata Database, an index is made up of one or more columns in a table. Once
Teradata Database indexes are selected, they are maintained by the system.
In the Teradata Database, there are two types of indexes -:

1-Primary Indexes
2-Secondary Indexes
The Index can be created at the time of table creation or can be created after creation of
table by using the Create Index statement.

TERADATA INTERVIEW QUESTIONS


The difference is that Create Index statement cannot create a Primary Index, only
Secondary Indexes on an existing table can be created. In the below example, a UPI is
created on the emp_number column and a NUSI on the dept_number column of the emp
table.
Create set table td_db.emp, No fallback,
No Before Journal,
No After Journal,
Checksum =default
(
emp_number integer,
manager_emp_number integer,
dept_number integer,
job_code integer,
emp_last_name char(50) Not casespecific,
emp_first_name varchar(50) Not casespecific,
marital_status char(1) Uppercase Not casespecific,
hire_date date format 'YY/MM/DD',
birthdate date format 'YY/MM/DD',
salary decimal(10,2))
Unique Primary Index(emp_number)---UPI
Index(dept_number)---NUSI;
Teradata Virtual Storage
Teradata Virtual Storage pools all of the cylinders within a clique's disk space and
allocates cylinders from the storage pool to individual AMPs. It will allow us to store data
that is accessed more frequently which is called -"hot data" on faster devices and data that
is accessed less frequently which is called "cold data" on slower devices and it can
automatically migrate the data based on access frequency.
Teradata Virtual Storage is designed to allow the Teradata Database to make use of new
storage technologies such as adding fast Solid State Disks to an existing system with a
different disk technology/speed/capacity.Teradata Virtual Storage enables the mixing of
drive sizes, speeds, and technologies which makes it more flexible at hardware points of
view.
Note : As storage is pooled and shared by the AMPs, adding drives does not require adding
AMPs for the additional drives.

Fallback in Teradata
Fallback is a Teradata database feature that protects data in the case of an AMPvproc
failure. Fallback guarantees the maximum availability of data. We can specify Fallback
protection at the table or database level. It ensures high availability of the applications.
Fallback protects our data by storing a second copy of each row of a table on a different
AMP in the same cluster(cluster has more than one AMPs).Fallback provides AMP fault

TERADATA INTERVIEW QUESTIONS


tolerance at the table level. With Fallback tables, if one AMP fails, all data is still available
and we can continue to use Fallback tables without any loss of access to data.
During table creation or after a table is created, we may specify whether or not the system
should keep a Fallback copy of the table.
Below are the examples of create table syntax with Fallback and without
Fallback :1.Create multiset table employee, fallback,
datablocksize=32 kbytes,freespace= 10 percent,checksum=none
(empno integer,
salary integer);
2.Create set table deptartment,No fallback,
No Before Journal,
No After Journal,
Checksum =default
(
employee_number integer,
deptno integer
);
Benefitsof Fallback:-

1.
2.

A level of protection beyond RAID disk array protection.


Can be specified on a table-by-table basis to protect data requiring the highest
availability.
3.
Permits access to data while an AMP is off-line.
4.
Automatically restores data that was changed during the AMP off-line period.
5.
When an AMP is down with a table that is defined as Fallback, Teradata will access
the Fallback copies of the rows which is available in same cluster.
Drawback of Fallback:
Fallback-protected tables requires 100% additional storage
The highest level of data protection is Fallback and RAID1 (Redundant Array of
Inexpensive Disks which provides data protection at the disk drive level).

Data Layers in Teradata Database


There are 3 types of Data Layers in Enterprise Data Warehouse environment of Teradata
mentioned below :-

TERADATA INTERVIEW QUESTIONS


1. Staging The purpose of the staging layer is to perform data transformation for
example: - ETL or ELT process.
2. Semantic The semantic layer is the access layer which can be provided by views and
/or business intelligence tools.
3. Physical The purpose of physical layer is to provide efficient, friendly access to end
users.
The physical layer is where denormalizations that will make access more efficient occur likepre-aggregations, join and indexes .

Node in Teradata
A Node is a term used in Teradata for a processing unit under the control of a single
operating system.
The Node is where the processing occurs for the Teradata Database.
In other words we can say that a Node is the basic building block of a Teradata Database
system which contains a large number of hardware and software components.
Hardware components of Node are
CPU
System disk
Memory
System bus
Ethernet
LAN Cables
Software components of Node are
AMP
PE
Application
Gateway
Channel Driver
PDE
OS
There are two types of Teradata Database systems mentioned below:
SMP(symmetric multiprocessing) - An SMP Teradata Database has a single node that
contains multiple CPUs sharing a memory pool.
MPP(massively parallel processing) - Multiple SMP nodes working together comprise a
larger, MPP implementation of a Teradata Database.In MPP nodes are connected with BYNET,
which allows multiple virtual processors on multiple nodes to communicate with each other.

TERADATA INTERVIEW QUESTIONS

Create and execute the BTEQ Script in Teradata


To create and execute the BTEQ script in Teradata we have to follow the below mentioned
steps Step 1:
Create the BTEQ Script
To create and edit a BTEQ script we can use an editor on or client workstation. For example,
on a UNIX workstation we can se text editor.
.SET SESSION TRANSACTION ANSI
.LOGON TDUSER/tdpassword
SELECT
FROM

emp_name --Name of employee of Dept table


,department_name --Name of Department of Dept table
dept;

.QUIT
and save it with name test.scr
Step 2:
To Execute The Script:
Start BTEQ, then enter the following BTEQ command to submit a BTEQ script:
Format
.run file = <bteqscriptname>
Example :.run file= test.scr

Note: We can include comments in a BTEQ


For example /* commented */
We can also use ANSI style (--) in any SQL command script.
In above example we have used ANSI style (--) to provide the comment in BTEQ command.

TERADATA INTERVIEW QUESTIONS


The SHOW CONTROL Command in Teradata
To displays BTEQ settings .SHOW CONTROL is used.
Below are the outputs of .SHOW CONTROL command.
.SHOW CONTROL
Default Maximum Byte Count
= 4096
Default Multiple Maximum Byte Count = 2048
Current Response Byte Count
= 4096
Maximum number of sessions
= 20
Maximum number of the request size = 32000
EXPORT RESET
IMPORT FIELD
LOGON L9999/****
RUN
[SET] ECHOREQ
= ON
[SET] ERRORLEVEL
= ON
[SET] FOLDLINE
= OFF ALL
[SET] FOOTING
= NULL
[SET] FORMAT
= OFF
[SET] FORMCHAR
= OFF
[SET] FULLYEAR
= OFF
[SET] HEADING
= NULL
[SET] INDICDATA
= OFF
[SET] NOTIFY
= OFF
[SET] NULL
=*
[SET] OMIT
= OFF ALL
[SET] PAGEBREAK
= OFF ALL
[SET] PAGELENGTH
= 60
[SET] QUIET
= OFF
[SET] RECORDMODE
= OFF
[SET] REPEATSTOP
= OFF
[SET] RETCANCEL
= OFF
[SET] RETLIMIT
= No Limit
[SET] REPEATSTOP
= OFF
[SET] RETCANCEL
= OFF
[SET] RETLIMIT
= No Limit
[SET] RETRY
= ON
[SET] RTITLE
= NULL
[SET] SECURITY
= NONE
[SET] SEPARATOR
= two blanks
[SET] SESSION CHARSET = ASCII
[SET] SESSION SQLFLAG = NONE
[SET] SESSION TRANSACTION = BTET
[SET] SESSIONS
=1
[SET] SIDETITLES
= OFF for the normal report.

10

TERADATA INTERVIEW QUESTIONS


[SET]
[SET]
[SET]
[SET]
[SET]
[SET]
[SET]

SKIPDOUBLE
= OFF ALL
SKIPLINE
= OFF ALL
SUPPRESS
= OFF ALL
TDP
= L7544
TIMEMSG
= DEFAULT
TITLEDASHES
= ON for the normal report.
UNDERLINE
= OFF ALL

[SET] WIDTH

= 80

Coding Conventions of Teradata SQL


SQL can cover multiple lines of code and there is no restriction on how much 'white space'
(i.e., blanks, tabs, carriage returns) may be embedded in the query. Having said that, SQL
is syntactically a very precise language. Misplaced commas, periods and parenthesis will
always generate a syntax error.
Note: The following coding conventions are recommended because it is easier to read,
create, and change SQL statements.
Recommended Practice
SELECT

last_name
,first_name
,hire_date
,salary_amount

FROM
WHERE
ORDER BY

employee
department_number = 200
first_name;

Not Recommended Practice


select last_name, first_name, hire_date, salary_amount
from employee where department_number = 200 order by first_name;
The first example is easy to read and troubleshoot (if necessary). The second example
appears to be a jumble of words. Both, however, are valid SQL statements.

11

TERADATA INTERVIEW QUESTIONS

Naming Conventions of Teradata Database Objects


All Teradata objects, such as tables, must be assigned a name by the user when they are
created.
These rules for naming objects are summarized as follows:
a-z
A-Z
0-9
_ (underscore)
$
#

Names are composed of:

Names are limited to 30 characters.


Names cannot begin with a number.
Teradata names are not case-sensitive.
Examples of valid names:
department
Department _sales
Department_sales_$total
department#
Note : Department and department represent the same table. Case is not considered.
Naming Syntax

Database names and User names must be unique within the Teradata Database.
Table, view, macro, trigger, index and stored procedure names must be unique within
a Database or User.
Column names must be unique within a Table.
The syntax for fully qualifying a column name is:
Databasename.Tablename.Columnname

NAME
DEPARTMENT.NAME
FINANCE.DEPARTMENT.NAME

(unqualified)
(partially qualified)
(fully qualified)

HELP Commands in Teradata Database objects


The HELP Command is used to display information about Teradata database objects such as
Databases and Users ,Tables ,Views and Macros.

12

TERADATA INTERVIEW QUESTIONS


HELP fetches information about above mentioned objects from the Teradata Data Dictionary.
There are various HELP command available in Teradata.
HELP Command
HELP DATABASE databasename;
HELP USER username;
HELP TABLE tablename;
HELP VIEW viewname;
HELP MACRO macroname;
HELP COLUMN table or viewname.*; (to show all columns)
HELP COLUMN table or viewname.colname . . ., colname;
HELP INDEX tablename;
HELP STATISTICS

tablename;

HELP CONSTRAINT constraintname;


HELP JOIN INDEX join_indexname;
HELP TRIGGER triggername;

Introduction to Teradata Sql


Structured Query Language (SQL)is the industry standard language for communicating
with Relational Database Management Systems. SQL is used to create tables, insert data
into tables, look up data in relational tables, grant permissions etc.
Structured Query Language is used to define the answer set that is returned from the
Database.
SQL is a non-procedural language means it does not contain procedural-type statements like

GO TO
DO LOOP
OPEN FILE
CLOSE FILE
END OF FILE
SQL statements are not case sensitive, unless indicated.
SQL statements can be entered into multiple lines

13

TERADATA INTERVIEW QUESTIONS

SQL statements commonly are divided into three categories:


1.

Data Definition Language (DDL) DDL is used to define and create database
objects such as tables, views, macros, databases, and users.
2.
Data Manipulation Language (DML) DML is used to work with the data,
including - inserting data rows into a table, updating an existing row, deleting the existing
rows or performing queries on the data.
3.
Data Control Language (DCL) - Used for administrative tasks such as granting and
revoking privileges to database objects or controlling ownership of those objects.
Data Definition Language (DDL) Examples

CREATE

Define a table, view, macro, index, trigger or stored procedure

DROP

Remove a table, view, macro, index, trigger or stored procedure.

ALTER

Modify table structure or protection definition.

Data Manipulation Language (DML)


SELECT

Select data from one or more tables.

INSERT

Insert a new row into a table.

UPDATE

Change data values in one or more existing rows.

DELETE

Remove one or more rows from a table.

Data Control Language (DCL)


GRANT

Give user privileges.

REVOKE

Remove user privileges.

GIVE

Transfer database ownership.

1. Example of DDL statement:

CREATE TABLE

employee

(employee_number

INTEGER

,department_number SMALLINT
,salary_amount

DECIMAL (10,2)

14

TERADATA INTERVIEW QUESTIONS


);
This query will create the table into database.
2. Example of DML statement:
SELECT * FROM

department;

This query would return all columns and all rows from the department table.
1.

Example of DCL statement:


To grant create user privilege to user01:
grant create user on DBC_DATABASE to user01;
Here grant create user clause will allocate the create privilege to user01 so that user01 will
be able to create a user on the database DBC_DATABASE .

What are the features of Teradata database ?


Teradata database provides a single data source for multiple clients. Teradata database
provides a mature, parallel aware Optmizer. Teradata database provides automatic, even
data distribution. Teradata database allows multiple concurrent users to ask complex
questions of the data.
What is the difference between Response Time and Throughput
Below are the differences between Response Time and Throughput :Response Time
Response
Response
Response
Response

Time
Time
Time
Time

measures the average duration of queries


is a measure of process completion
measures- how long the particular processing takes
is the elapsed time per query

Throughput
Throughput
Throughput
Throughput
Throughput

measures quantity of queries completed during a time interval


is a measure of the amount of work processed
measures - how many queries were processed
measures - the number of queries executed in an hour

What is the difference between a Database and a User in Teradata?


Although Database and User may own objects such as tables, views, macros, procedures,
and functions still there is difference between them in terms of log on process.

15

TERADATA INTERVIEW QUESTIONS


A user is same as the database except that a user can log on to the database with User
Id and Password.
We cannot log on to a database because it has no password.

What is TPT in Teradata ?


TPT is abbreviation of Teradata Parallel Transporter, it is client software that performs
data extractions, data transformations, and data loading (ETL) processing.
TPT brings together the traditional Teradata Load Utilities
- FastLoad, MultiLoad, FastExport and TPump into a single product using a single script
language. TPT can be invoked using a script or it can be invoke by an API.
The target for the load operators must always be the Teradata database. Source data may
come from a variety of possible environments, for example -ODBC database, data files,
devices etc.
Below are the features of TPTSingle Script Language Unlike the traditional Teradata load utilities (like -FastLoad, MultiLoad), each using its own
script language, a single script language is used consistently across all job operations.
Multi-Step Load Scenarios A single TPT script can be used to execute multiple job steps and each job can perform a
separate load or unload function.
Use of API The Application Program Interface (API) is a feature of TPT using which the developers can
create programs with a direct interface to the load/ unload protocols used by the utilities.
Increased Throughput Teradata Parallel Transport allows us to run multiple instances of each operator, thereby it
increases the throughput.
File Storage is no longer required
Teradata Parallel Transporter does not require the temporary file storage. Data is stored in
data buffers so it is not necessary to write temporary data to permanent flat files.

What are the differences between Keys and Indexes in Teradata ?


The Teradata database does not require Primary Key in the Database table.
The Teradata Database's parallel architecture uses Primary Indexes to distribute and access
the data rows so a Primary Index is always required while creating a Teradata Database
table.

16

TERADATA INTERVIEW QUESTIONS


Below are the differences between Keys and Indexes in Teradata

Keys

Indexes

Key is a concept of relational


modeling which is used in
a logical data model.

Indexes are the Teradata Database


mechanism used in a physical database
design.

Primary Key is unique


identifier of a row.

Primary Index is used for row


distribution in Teradata

Foreign Key is used to


establish the relationships
between the tables.

Primary Index and Secondary


Indexes is used for rows access.
What is TASM in

Teradata?
TASM stands for Teradata Active System Management .
TASM is made of several tools which are useful for DBA and developer to define the rules
(filters, throttles etc.) that control the allocation of resources to workloads running on a
system.
Tools are also provided to monitor workloads in real time and to produce historical reports of
resource utilization by workloads.
Below are the three products of TASM that are used to create and manage workload
definitions:

Teradata Dynamic Workload Manager (TDWM)


Teradata Manager - It reviews historical workloads
Teradata Workload Analyzer (TWA) It recommends candidate workloads for analysis

Teradata Active Systems Management (TASM), allows DBAs/Developers to perform


following operations:

Limit user concurrency


Determine the workload on a system
Prioritize workloads
Provide more consistent response times and influence response times
Monitor Service Level Goals on a system
Optimize mixed workloads
Reject queries based on table access
React to hardware failures
Block access on a table to a user

What is Hot Standby Node (HSN) in Teradata?

17

TERADATA INTERVIEW QUESTIONS


A Hot Standby Node(HSN) is a node that is a member of a clique(A clique is a group of
nodes that share access to the same disk arrays) that is not configured to execute any
Teradata vprocs.
If a node in the clique fails, the AMPs from the failed node move to the hot standby node.
The performance degradation is 0%. When the failed node is repaired and restarted, it
becomes the new hot standby node, so that a second restart of Teradata is not required.

Below are the characteristics of a hot standby node :Each multi-node system has at least one clique.
A node that is a member of a clique.
Does not normally participate in the trusted parallel application
Can be brought into the configuration when a node fails in the clique.
Eliminates the need for a restart to bring a failed node back into service.

What is BYNET in Teradata ?What are the features of BYNET ?


The BYNET is a high-speed interconnect network that enables multiple nodes in the
system to communicate. It handles the internal communication of the Teradata Database.
All communication between Parsing Engines(PEs) and AMPs is done via the BYNET.
When the PE dispatches the steps for the AMPs to perform, they are dispatched onto the
BYNET. The messages are routed to the appropriate AMP(s) where results sets and status
information are generated. This response information is also routed back to the requesting
PE via the BYNET. Depending on the nature of the dispatch request, the communication
between nodes may be to all nodes or to one specific node in the system.
The BYNET is the combinations - hardware and software, which handle the communication
between the vprocs and the nodes.
Hardware: The nodes of an MPP system are connected with the BYNET hardware,
consisting of BYNET boards and cables.
Software: The BYNET driver is installed on every node. This BYNET driver is an interface
between the PDE software and the BYNET hardware.
Note :- SMP systems do not contain BYNET hardware. The PDE(Parallel Database
Extensions) and BYNET software emulate BYNET activity in a single-node environment.
Below are the features of BYNET
Scalable
High performance
Fault tolerant

18

TERADATA INTERVIEW QUESTIONS


Load balanced
What is AMP in Teradata ?

The AMP is a vproc in the Teradata Database's shared-nothing architecture that is


responsible for managing a portion of the database. Each AMP will manage some portion of
each table on the system. AMPs do the physical work associated with generating an answer
set which includes sorting, aggregating, formatting, and converting. The AMPs retrieve and
perform all database management functions on the required rows from a table. An AMP
accesses data from its single associated vdisk. AMPs is also able to redistribute a copy of the
data to other AMPs.
what are different types of journals in teradata?
There are 3 different types of journals available in Teradata. They are
1. Transient Journal - This maintains current transaction history. Once the query is
successful it deletes entries from its table . If the current query transaction fails, It rolls
back data from its table.
2. Permanent Journal - This is defined when a table is created. It can store BEFORE or
AFTER image of tables. DUAL copies can also be stored. Permanent Journal maintains
Complete history of table.
3.Down AMP recovery Journal (DARJ) - This journal activates when the AMP which was
supposed to process goes down. This journal will store all entries for AMP which went down.
Once that AMP is up, DARJ copies all entries to that AMP and makes that AMP is sync with
current environment.
What is RAID, What are the types of RAID?
Redundant Array of Inexpensive Disks (RAID) is a type of protection available in Teradata.
RAID provides Data protection at the disk Drive level. It ensures data is available even
when the disk drive had failed.
There are around 6 levels of RAID ( RAID0 to RAID5) . Teradata supports Two levels of
RAID protection
RAID 1 - Mirrored copy of data in other disk
RAID 5 - Parity bit (XOR) based Data protection on each disk array.
One of the major overhead's of RAID is Space consumption.
What are different types of Spaces available in Teradata ?
There are 3 types of Spaces available in teradata ,they are

19

TERADATA INTERVIEW QUESTIONS


1. Perm space
-This is disk space used for storing user data rows in any tables located on the database.
-Both Users & databases can be given perm space.
-This Space is not pre-allocated , it is used up when the data rows are stored on disk.
2.Spool Space
-It is a temporary workspace which is used for processing Rows for given SQL statements.
-Spool space is assigned only to users . -Once the SQL processing is complete the spool is freed and given to some other query.
-Unused Perm space is automatically available for Spool .
3. TEMP space
-It is allocated to any databases/users where Global temporary tables are created and data
is stored in them.
-Unused perm space is available for TEMP space.

How do you see a DDL for an existing table in Teradata?


By using show table command as follows
show table tablename ;
This will display DDL structure of table along with following details
Fallback
Before/after journal
set/multiset table type
Index(PI,SI,PPI)
details about column - datatype ,default,identity/primary -foreign key

Vous aimerez peut-être aussi