How do I connect to a Netezza database from Unix?

Nico Chart_21517
Nico Chart_21517
Altair Employee
edited October 15 in Altair RapidMiner

Install the relevant client libraries for connecting to NETEZZA and ensure that they can be located by SLC.
Note that the Netezza client depends on the UnixODBC utility also being installed and configured.

(Make sure you select the 64-bit connector to match your 64-bit Altair SLC installation as we no longer support 32-bit.)

The typical steps needed to connect to a Netezza database from Unix in 64-bit mode would be:
1. Get hold of the Netezza 64-bit version 6.0 client for Unix
2. Unpack the kit into some area e.g. $HOME/netezza for this example
3. Update the LD_LIBRARY_PATH to point to directory containing the libnzodbc.so shared object library, and also the path to the unixODBC 2.3.2 object library, e.g.:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/netezza/lib64:$HOME/odbc/unixodbc/unixODBC-2.3.2/lib
4. Update the PATH environmental variable to point to the directory containing the nzodbcsql executable PATH=$PATH:$HOME/netezza/bin64
5. Add an entry to your odbc.ini of the form:


[ODBC Data Sources]
NZSQL = NetezzaSQL

[NZSQL]
Description = NetezzaSQL ODBC
Driver = /home/gm/odbc/netezza/lib64/libnzodbc.so
Servername = netezza
Port = 5480
Database = <YOUR_DATABASENAME>
Username = <YOUR_USERNAME>
Password = <YOUR_PASSWORD>
ReadOnly = false
ShowSystemTables = false
LegacySQLTables = false
LoginTimeout = 0
QueryTimeout = 0
;Specifies date format as follows - 1: YMD 2: MDY 3: DMY
DateFormat = 1
NumericAsChar = false
SQLBitOneZero = false
StripCRLF = false
securityLevel = preferredUnSecured

6. Create or customize your odbcinst.ini file based on a sample from the netezza client

[NetezzaSQL]
Description = Netezza ODBC driver
Driver = /home/gm/odbc/netezza/lib64/libnzodbc.so
Setup = /home/gm/odbc/netezza/lib64/libnzodbc.so
APILevel = 1
ConnectFunctions = YYN
Description = Netezza ODBC driver
DriverODBCVer = 03.51
DebugLogging = false
LogPath = /home/gm/odbc/netezza
UnicodeTranslationOption = utf16

7. Make sure you have environmental variables NZ_ODBC_INI_PATH setup to point to the directory containing odbc.ini and odbcinst.ini files and ODBCINI = path_to_odbc.ini and ODBCINST= path_to_odbcinst.ini
NOTE: You will need to replace <YOUR..> parts with your own specific details and /home/gm with the path to where your Netezza client lives.
8. You should then be able to re-try your libname statement of the form:
Libname nz netezza user=<your_username> password=<your_password> DSN=NZSQL;

n.b. environment variable settings ('export' commands) may be conveniently placed in ~/altairslcenv.sh (for single user) or /opt/altair/slc/2024/altairslcenv.sh (for all users).

 

Tagged: