If you have chosen to use the unixODBC Driver Manager, configure it as follows:
-
Get the templates for the ODBC connection settings files. Copy these files from the Aster Database driver’s Setup directory to the user’s home directory. The files you need are aster.ini, odbc.ini and odbcinst.ini:
# cd /usr/local/lib/stage/clients-odbc-linux64/Setup # cp odbc.ini ~ # cp odbcinst.ini ~ # cp aster.ini ~/.aster.ini
We have also renamed the aster.ini file, adding a dot at the beginning of the file name. You must do this. -
Edit the .aster.ini file as follows:
- Set DriverManagerEncoding to UTF-32.
-
Set ODBCInstLib to one of the following, depending on your OS:
- on Linux: <unixODBC_InstallDir>/lib/libodbcinst.so
- on Solaris:< unixODBC_InstallDir>/lib/libodbcinst.so
- on Mac OS:< unixODBC_InstallDir>/lib/libodbcinst.dylib
replacing <unixODBC_InstallDir> with the directory installed by the unixODBC driver.
- Set DriverLocale to en-US(or another locale or your choice).
-
Set LogLevel to one of the following levels:
- 0 or "Off"
- 1 or "Fatal"
- 2 or "Error"
- 3 or "Warning"
- 4 or "Info"
- 5 or "Debug"
- 6 or "Trace"
- LogPath - Set the path that the default logging implementation will create the log files in. The path defaults to the current working directory.
-
Set ErrorMessagesPath to point to the ErrorMessages subdirectory in the Aster Database driver directory. For this example, we edit the last line in the file to read:
ErrorMessagesPath=/usr/local/lib/stage/clients-odbc-<your_os>/ ErrorMessages
At this point, you can run “odbcinst -j” to find out where the ODBC driver expects to find its configuration files. -
In a text editor, edit the odbc.ini file, making the following changes:
- Set SERVER to the hostname or IP address of your Aster Database queen.
- Set PORT to 2406, the standard port on which your Aster Database queen listens for client connections.
- Set DATABASE to the name of the database in Aster Database you want to connect to.
- Optionally, you may set UID and PWD to your Aster Database SQL username and password, respectively.
- Finally, Teradata Aster recommends that you add the setting, NumericAndDecimalAsDouble=1.
-
Optionally, you can set a number of other database connection behavior settings. These include enable_quoted_identifiers (see Quoted-Identifier Handling), enable_backslash_escapes: See Escape Character Handling.
For this example, we set the contents of odbc.ini to read:
[ODBC Data Sources] Aster ODBC Driver DSN=AsterDriver [Aster ODBC Driver DSN] Driver=AsterDriver SERVER=10.50.52.100 PORT=2406 DATABASE=beehive NumericAndDecimalAsDouble=1 # UID=<USERNAME> # PWD=<PASSWORD>
You can have multiple data sources. The name “Aster ODBC Driver DSN” in the odbc.ini file is just a default name that Teradata Aster has given to the sample data source. You can rename this source and add more, as shown in this example:
[ODBC Data Sources] my_1st_source=AsterDriver my_2nd_source=AsterDriver [my_1st_source] Driver=AsterDriver SERVER=10.50.52.100 ... [my_2nd_source] Driver=AsterDriver SERVER=10.42.43.100 ...
-
In a text editor, edit the odbcinst.ini file, setting the Driver parameter to the Aster Database driver directory path. For this example, we set the contents of odbcinst.ini to read:
Driver parameter settings for unixODBC Operating System unixODBC Version Driver Parameter Setting Linux 32-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clients-odbc-linux32/ODBCDriver/lib/libAsterDriver.so IconvEncoding=UCS-4LE
Linux 64-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clients-odbc-linux64/ODBCDriver/lib/libAsterDriver.so IconvEncoding=UCS-4LE
Solaris 64-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clients-odbc-solaris-sparc64/ODBCDriver/libAsterDriver.so IconvEncoding=UCS-4LE
AIX 32-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clients-odbc-aix-ppc32/ODBCDriver/libAsterDriver.so IconvEncoding=UCS-4LE
AIX 64-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clients-odbc-aix-ppc64/ODBCDriver/libAsterDriver.so IconvEncoding=UCS-4LE
MacOS 64-bit unixODBC 2.3.1 [AsterDriver] Driver=/usr/local/lib/stage/clientsodbc-mac64/ODBCDriver/libAsterDriver.dylib IconvEncoding=UCS-4LE
- Save your changes to the odbcinst.ini file.
-
Add the <InstallDir>/unixODBC/lib directory to:
- On Linux: LD_LIBRARY_PATH
- On AIX PowerPC: LIBPATH
- On MacOS: DYLD_LIBRARY_PATH
The installation and configuration are now complete.