Introduction to Teradata · PDF file Teradata Director Program ( TDP for channel attached...

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of Introduction to Teradata · PDF file Teradata Director Program ( TDP for channel attached...

  • 1

    Introduction to Teradata RDBMS Teradata RDBMS is a complete relational database management system. The system is based on off-the-shelf Symmetric Multiprocessing (SMP) technology combined with a communication network connecting the SMP systems to form a Massively Parallel Processing (MMP) system. BYNET is a hardware inter-processor network to link SMP nodes. All processors in a same SMP node are connected by a virtual BYNET. We use the following figure to explain how each component in this DBMS works together. PDE (Parallel Database Extensions):

    This component is an interface layer on the top of operating system. Its functions include: executing vprocs (virtualprocessors), providing a parallel environment, scheduling sessions, debugging, etc.

    SQL query Result Table



    Parser Dispatcher

    Database Management System

    Teradata File System

    Disk Subsystem



    PDE BYNET Inter-Processor Network

    AMPs Database Engine

    Parsing Engine PEs

  • 2

    Teradata File System: It allows Teradata RDBMS to store and retrieve data regardless of low-level operating system interface.

    PE (Parsing Engine): Communicate with client Manage sessions Parse SQL statements Communicate with AMPs Return result to the client

    AMP (Access Module Processor):

    BYNET interface Manage database Interface to disk subsystem

    CLI (Call Level Interface): A SQL query is submitted and transferred in CLI packet format TDP (Teradata Director Program): Route the packets to the specified Teradata RDBMS server Teradata RDBMS has the following components that support all data communication management:

    � Call Level Interface ( CLI ) � WinCLI & ODBC � Teradata Director Program ( TDP for channel attached client ) � Micro TDP ( TDP for network attached client )

    Introduction to Teradata Client Software Teradata Client Software components include:

    � BTEQ Basic Teradata Query is a general-purpose program that you can use to submit data, commands and SQL statements to Teradata RDBMS.

  • 3

    � C / COBOL / PL/I preprocessors If you use embedded SQL to develop client applications, you need these tools to pre- compile your programs.

    � CLI � ODBC � TDP/MTDP/MOSI � Achieve/Restore data to/from tape (ASF2)

    � Queryman

    Queryman is based on ODBC, you can logon through a DSN and enter any SQL statement to manipulate the data in database.

    � FastLoad � MultiLoad

    � FastExport

    � Open Teradata Backup (OTB)

    � Tpump

    � Teradata Manager

    � WinDDI

    All client components are based on CLI or ODBC or Both of them. So, once you install the client software, you should configure these two components appropriately before you execute these client utilities. Teradata RDBMS is able to support JDBC programs in both forms of application and applet. The client installation manual mentions that we need to install JDBC driver on client computers, and we also need to start a JDBC Gateway and Web server on database server. Teradata supports at least two types of JDBC drivers. The first type can be loaded locally and the second one should be downloadable. In either of two ways, to support your development, you need local JDBC driver or Web server / JDBC Gateway running on the same node on which Query Manager is running. But in the setup CD we received, there is no JDBC driver and any Java Development Tools. Moreover, Web server is not started on tour system yet.

  • 4

    Installation and Configuration Because the installation is easy, we just give some tips:

    You need one floppy disk which contains licenses for all components you could install. Each component has one entry in the license txt file.

    If you are asked to choose ODBC or Teradata ODBC with DBQM enhanced version to

    install. Just forget it. In this case, you can not install DBQM_Admin, DBQM_Client, and DBQM_Server. These three components are used to optimize the processing of your SQL queries. Fortunately, your client software still works smoothly without them.

    Because CLI and ODBC are the infrastructures of other components, you may not delete

    either one of them from the installation list if there is any component based on it.

    After ODBC installation, you will be asked to run ODBC administrator to configure a Data Source Name (DSN). You may cancel it simply because you can do this job later. After Teradata Manager installation, you will be asked to run Start RDBMS Setup. You also can do it later.

    For more information, please visit and download Teradata Client for Windows Installation Guide. Configuration includes several steps:

    Setting Network Parameters For Windows 2000, do the following step: Start -> Search -> For Files or Folders. You can find the file: hosts

    Use Notepad to edit the hosts file as follows:

  • 5

    Add one line into your hosts file: “ teradatacop1 ”. Here, is the IP address of the top node of the system on which Query Manager is running. “teradata” will be the TDPID which is used in many client components you installed. “cop” is a fixed suffix string and “1” indicate that there is one RDBMS.

    Setting System Environment Parameters For Windows 2000, do the following step: Start -> Settings -> Control Panel

    Find the icon “System”, double click it, get the following window, then choose “Advanced” sub-window

  • 6

    click “Environment Variables…” button

  • 7

    Then you can click button “New…” to create some System Variables as follows:

    COPLIB = the directory which contains the file clispb.dat This file is copied to your computer when you install Teradata Client Software. It contains some default settings for CLI.

    COPANOMLOG = the full path and the log file name You can set it as you want. If the file doesn’t exist, when an error occurs, the client software will create the file to record the log information.

    TDMSTPORT = 1025 Because our server is listening the connect request on port 1025, you should set it as 1025. This is also the default port number used by those client components. If you don’t set it, perhaps you will not have any problem now. But we still suggest you add this system environment variable for the future usage. You shouldn’t insert a line tdmst 1025/TCP into the file C:\WINNT\System32\drivers\etc\services directly without correct the setting on environment variable TDMSTPORT. According to our test, that doesn’t work.

    Setting CLI System Parameter Block You can find the file clispb.dat after you install the client software. In our computer, it is under the directory C:\Program Files\NCR\Teradata Client. Please use Notepad to open it. You will see

  • 8

    Originally, i_dbcpath was set as dbc. That is not the same as what I set in the file hosts. So I modify it as teradata. When you use some components based on CLI and do not specify the TDPID or RDBMS, the components will open this file to find this default setting. So we suggest you to set it as what you set in your file hosts.

    For other entries in this file, you can just keep them as original settings.

    To use utilities such as Queryman and WinDDI, you still need to configure a Data Source Name (DSN) for yourself. We will discuss how to configure a DSN in the section “Developing ODBC applications”.

  • 9

    BTEQ BTEQ is like a RDBMS console. This utility enables you to connect to Teradata RDBMS server as any valid database user, set the session environment and execute SQL statement as long as you have such privileges. BTEQWin is a Windows version of BTEQ. Both of them work on two components: CLI and TDP/MTDP. BTEQ commands or SQL statements entered into the BTEQ are packed into CLI packets, then TDP/MTDP transfers them to RDBMS. BTEQ supports 55 commands which fall into four groups:

    o Session Control Commands o File Control Commands o Sequence Control Commands o Format Control Commands

    Here, we do not introduce each command. But, some usage tips and examples for the frequently used commands are given here. Usage Tips: o BTEQ commands consist of a dot character followed by a command keyword, command

    options, and parameters. .LOGON teradata/john

    o Teradata SQL statement doesn’t begin with a dot character, but it must end with a ‘;’

    character. SELECT * FROM students Where name = “Jack”;

    o You can enter both BTEQ commands and SQL statements in any combination of uppercase and lowercase and mixed-case formats. .Logoff

    o If you want to submit a transaction which includes several SQL statements, do as the following example: Select * from students ;insert into table students Values(‘00001’, ‘Jack’,’M’,25 ) ;select * from students; After you enter the last ‘;’ and hit the [enter] key, these SQL requests will be submitted as a transaction. If anyone of them has an error, the whole transactio