Skip to main content
Join our research panel and help shape the future of Teradata.Sign up.

Use Teradata with ODBC on Ubuntu

Overview

This how-to demonstrates how to use the ODBC driver with Teradata on Ubuntu.

Prerequisites

  • Access to a Teradata instance.
    Note

    If you need a test instance of Teradata, you can provision one for free at https://www.teradata.com/try

  • Root access to an Ubuntu machine. If you don't have a local Ubuntu machine, you can use an AWS EC2 instance as described in the steps below.
  • An AWS account (if using EC2).

Installation

Option 1: Launch an Ubuntu instance on AWS EC2

If you don't have a local Ubuntu machine, follow these steps to launch one on AWS EC2:

  1. Go to the AWS EC2 Console and click Launch Instance.
  2. Enter a name for your instance.
  3. Under Application and OS Images, select Ubuntu and choose Ubuntu Server 22.04 LTS as the AMI.
  4. Under Instance type, select t2.micro or t3.micro.
  5. Under Key pair, click Create new key pair. Name it, keep the defaults (RSA, .pem), and click Create key pair. The .pem file will download automatically — save it to ~/.ssh/.
  6. Under Network settings, ensure Allow SSH traffic is checked and set the source to My IP.
  7. Click Launch Instance.
  8. Once the instance is running, copy the Public IPv4 address from the instance details page.
  9. Set permissions on your key file and connect via SSH:
  1. Once connected, get root access:

Install dependencies

Install Teradata ODBC driver

Download the Teradata ODBC driver for Linux from the Teradata Downloads page. A Teradata account is required to download the driver. Download the file tdodbc2000__linux_x8664.20.00.00.66-1.tar.gz to your local machine.

If you are using an AWS EC2 instance, open a new terminal window on your local machine and use scp to transfer the file:

Back in your SSH session, extract and convert the driver package to a Debian-compatible format, then install it:

Configure ODBC

Create the file /etc/odbcinst.ini with the following content:

Use ODBC

Install pyodbc:

Create a test.py file with the following content. Replace DBCName, UID and PWD with your Teradata instance hostname, username and password:

Run the test application:

You should get output similar to:

Summary

This how-to demonstrated how to use ODBC with Teradata on Ubuntu. The how-to shows how to install the ODBC Teradata driver and the dependencies. It then shows how to configure ODBC and validate connectivity with a simple Python application.

Further reading