Thursday, February 9, 2017

Setting Teradata environment on UNIX

                                                      Setting Teradata ENV on UNIX

This document describes in detail ,the following

-                      What version of teradata client ,odbc and server we support/supported
-                      How to set up env for odbc and loaders on unix
-                      Sample entry used in odbc.ini file
-                      How to test odbc connectivity on unix
-                      How to connect to teradata client through bteq on unix

Supported Versions :

PowerCenter Version
Teradata Client
NCR ODBC Driver
Teradata Server
Juggernaut
TUF- 611
ODBC 3.00.01.04
V2R4.01.02.00
K2 + 5.11
TUF – 610
ODBC 2.08.02.00
V2R4.00.02.00
5.1,5.0 + 4.x
TUF –5.3 on unix
Cli 9802 on NT

V2R2

Unix ENV setup:

On Solaris and HP:

In solaris and hp boxes,
Teradata client(all loaders) are installed in /databases/td-tuf611/usr
Teradata ODBC in /databases/td-tuf611/usr/odbc

It is adviceable to have CLOSEDODBC driver before teradata odbc driver

Have env as follows,(it includes both loader and odbc drivers)

setenv CLOSEDODBCHOME /databases/closed_odbc4.1
setenv TERADATA_HOME /databases/td-tuf611/usr

 libpath should have
“${CLOSEDODBCHOME}/lib:${TERADATA_HOME}/lib:
${TERADATA_HOME}/odbc/lib”

Path should have,
${CLOSEDODBCHOME}/bin \
    ${TERADATA_HOME}/bin \

Pls Note : Teradata ODBC sessions will not run on corvette as NCR does not support installing latest client 611 on 2.6 boxes.


On AIX:

AIX installation by default installs all the loaders and teradata client under common directories.

Have env as follows,

setenv CLOSEDODBCHOME /databases/closed_odbc4.1
setenv TERADATA_HOME /usr/lpp
setenv TERADATA_ODBCHOME /databases/td-tuf611

libpath should have
“${CLOSEDODBCHOME}/lib:${TERADATA_HOME}:
${TERADATA_ODBCHOME}/lib”

path should have,
${CLOSEDODBCHOME}/bin \
    ${TERADATA_HOME} \


Sample ODBC.ini File entry :

In juggernaut,database name can be overrided at session level while creating database connection.

tdv2r41=tdv2r41 teradata connection

[tdv2r41]
Driver=/databases/td-tuf611/usr/odbc/drivers/tdata.sl
Description=NCR 3600 running Teradata V2R41
DBCName=tdv2r41
SessionMode=Teradata
StCheckLevel=0
DateTimeFormat=AAA
LastUser=
Username=qasrvrk2
Password=qasrvrk2
Database=
DefaultDatabase=qasrvrk2 ---------------à this value can be overrided at session level

ODBC Connectivity Test :

To check if odbc driver gets loaded correctly,
As  you have closed odbc in path, type the following in the unix prompt ,

=>ivtestlib <driver specified in the odbc.ini file>
=>ivtestlib /databases/td-tuf611/usr/odbc/drivers/tdata.sl
Load of /databases/td-tuf611/usr/odbc/drivers/tdata.sl successful, qehandle is 0x7F7ED428
Above msg confirms that env is set correctly.

You can confirm it by executing the following program in teradata odbc location,

=>cd /databases/td-tuf611/usr/odbc/samples/C

execute adhoc program and will prompt to enter user id and passwd. DataSourceName is the name specified in the odbc.ini file

=>adhoc

Enter Data Source Name: tdv2r41
Enter userID: qasrvrk2
Enter password: qasrvrk2

.....ODBC connection successful.

ODBC version        = -03.52.0000-
DBMS name           = -Teradata-
DBMS version        = -04.01.0200  V2R-
Driver name         = -tdata.sl-
Driver version      = - 3.00.01.04-
Driver ODBC version = -03.51-
Enter SQL string: select * from aaaa;
A1A2

Enter SQL string: quit;
ODBC connection closed
=>

Accessing tables through BTEQ:

NCR has many client utilites to access teradata tables.One among them is BTEQ –Basic Teradata Query

To logon from unix,type as follows,

=>bteq
 Teradata BTEQ 06.01.00.00 for UNIX5. Enter your logon or BTEQ command:
.logon tdv2r41/qasrvrk2

.logon tdv2r41/qasrvrk2
Password: *****

 *** Logon successfully completed.
 *** Transaction Semantics are BTET.
 *** Character Set Name is 'ASCII'.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your DBC/SQL request or BTEQ command:
Select * from aaaa;
*** Query completed. No rows found.
 *** Total elapsed time was 1 second.
  
 BTEQ -- Enter your DBC/SQL request or BTEQ command:
Quit;
*** You are now logged off from the DBC.
 *** Exiting BTEQ...
 *** RC (return code) = 0
=>
  


2 comments: