Tuesday, November 25, 2014

Teradata - ODBC.ini Entry Explained

Actually, detail of Teradata odbc.ini structure can be found in ODBC Driver for Teradata
User Guide. But, it is a 228 pages document. So, the purpose of this blog entry is to provide essential summarized information about what is required in the odbc.ini for connecting to a Teradata database.

Below describe the required tag for the Teradata specific odbc.ini file

ODBC Options Section

This section mainly define the ODBC Driver installation directory.

[ODBC]
InstallDir="filepath" //Required. You should provide the full path for Teradata ODBC Driver installation directory. An example default installation directory is /opt/teradata/client/ODBC_64.

ODBC Data Sources Section

This section define the the Data Source Name (DSN) and its corresponding Teradata ODBC Driver

[ODBC Data Sources]
data-source-name="driver" //Required. Provide the DSN and its driver name. An entry for each data source. The driver file should have either .so or .sl extension

Data Source Specification Section

This section define the data source specification for each data source entry listed in the ODBC Data Source Section. The in this section correspond to the ODBC Data Source Section data-source-name.

[data-source-name]
Driver="driver-path" //Required.  The full path to the Teradata ODBC Driver shared object file. It should be a .so or .sl file
Description="data-source-desc" //Optional. Provide a description for this data source entry
DBCName="IP-addr-or-alias" // Required. The IP address or FQDN (fully qualified domain name) of the Teradata server. This can be multiple entries
Username="name" //Optional. The username to be used by this data source name entry
Password="password" //Optional. The password for the username defined in Username tag.
DefaultDatabase="database-name" //Optional. The default database for this data source name entry

32-bit odbc.ini File Example

[ODBC]
InstallDir=/opt/teradata/client/14.00/odbc_32

[ODBC Data Sources]
your_default=tdata.so
your_testing_dsn=tdata.so

[your_testing_dsn]
Driver=/opt/teradata/client/14.00/odbc_32/lib/tdata.so
Description=My testing Teradata database
DBCName=182.123.111.222
DBCName2=44.55.22.11
DBCName3=your_teradata_database.com

[your_default]
Driver=/opt/teradata/client/14.00/odbc_32/lib/tdata.so
Description=My Default DSN
DBCName=10.10.10.10

64-bit odbc.ini File Example

[ODBC]
InstallDir=/opt/teradata/client/14.00/odbc_64

[ODBC Data Sources]
your_default=tdata.so
your_testing_dsn=tdata.so

[your_testing_dsn]
Driver=/opt/teradata/client/14.00/odbc_64/lib/tdata.so
Description=Yet another testing DSN
DBCName=12.34.56.78
Username=my_test_id
Password=my_test_password
DefaultDatabase=my_database

[your_default]
Driver=/opt/teradata/client/14.00/odbc_64/lib/tdata.so
Description=Yet another default database
DBCName=87.65.43.21
DBCName2=default_database.com
Username=my_default_user
Password=my_default_password
DefaultDatabase=my_default_database

Reference
1. ODBC Driver for Teradata User Guide 

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster Scenario 3 VMs involved: 1) NameNode, ResourceManager - Host...