Thursday, June 30, 2016

Netezza: how to install Netezza ODBC driver on Linux

Download driver installation software from IBM Fix central. 

Put downloaded file into temporary directory, so you can clean it later:

 mv  ~/nz-linuxclient-v7.2.1.2-P1.tar.gz  /tmp/install2detete

Untar package: 

tar xvf nz-linuxclient-v7.2.1.2-P1.tar.gz

[root@sm3 nz.7.2.1.2]# tar xvf nz-linuxclient-v7.2.1.2-P1.tar.gz
datadirect.package.tar.z
linux/
linux/npsclient.7.2.1.2-P1.tar.gz
linux/unpack
linux64/
linux64/npsclient.7.2.1.2-P1.tar.gz
linux64/unpack
webadmin/
webadmin/npswebclient.7.2.1.2-P1.tar
webadmin/unpack
[root@sm3 nz.7.2.1.2]# ll
total 382572
-rw-r--r-- 1    10507    12009  71226753 May 26 22:45 datadirect.package.tar.z
drwxr-xr-x 2    10507    12009      4096 May 26 22:45 linux
drwxr-xr-x 2    10507    12009      4096 May 26 22:45 linux64
-rw-r--r-- 1 UUUUUUUUUU1 320115759 Jun 30 14:34 nz-linuxclient-v7.2.1.2-P1.tar.gz
drwxr-xr-x 2    10507    12009      4096 May 26 22:45 webadmin

Install 64-bit driver:

./unpack

[root@sm3 linux64]#cd ./linux64
[root@sm3 linux64]# ll
total 28556
-rw-r--r-- 1 10507 12009 29190391 May 24 21:34 npsclient.7.2.1.2-P1.tar.gz
-rwxr-xr-x 1 10507 12009    14798 May 24 21:34 unpack
[root@sm3 linux64]#
-------------------------------------------------------------------------------
IBM Netezza -- NPS Linux Client 7.2.1.2-P1
(C) Copyright IBM Corp. 2002, 2016  All Rights Reserved.
-------------------------------------------------------------------------------

Validating package checksum ... ok

Where should the NPS Linux Client be unpacked? [/usr/local/nz] /usr/local/nz.7.2.1.2

Installing in an existing directory. Changing permissions to overwrite existing files...
 0%          25%         50%         75%          100%
 |||||||||||||||||||||||||||||||||||||||||||||||||||

Unpacking complete.


Test installation: 

./nzrev
./nzodbcsql -h 10.99.97.67 -d nzdba -u UUUUU -p XXXXX -q 'select count(*) from _v_table;'
./nzodbcsql -c "Driver={NetezzaSQL};servername=10.99.97.67;port=5480;database=SYSTEM;username=UUUUU;password=XXXXX;"
./nzsql       -h 10.99.97.67 -d nzdba -u UUUUU -pw XXXXX -c 'select count(*) from _v_table;'


[root@sm3 bin]# nzrev
Release 7.2.1.2-P1 [Build 48187]


[root@sm3 bin]# /usr/local/nz.7.2.1.2/bin/nzodbcsql -h 10.99.97.97 -d nzdba -u UUUUU -p XXXXX -q 'select count(*) from _v_table;'
 COUNT
-------
 369
Rows Returned : 1


[root@sm3 bin]# /usr/local/nz.7.2.1.2/bin/nzodbcsql -c "Driver={NetezzaSQL};servername=10.99.97.97;port=5480;database=SYSTEM;username=UUUUU;password=XXXXX;"

NZODBCSQL - program to test Netezza ODBC driver
            NOT FOR PRODUCTION USE

     Type 'quit' or '\q' or CTRL-D or ENTER at the prompt to quit
     NOTE: Max 100 rows are displayed (for selects)

        Driver version          : 'Release 7.2.1.2-P1 [Build 48187]'
        NPS version             : '07.02.0000 Release 7.2.0.5-P1 [Build 45115]'
        Database                : 'SYSTEM'

nzodbc > \q


[root@sm3 bin]# /usr/local/nz.7.2.1.2/bin/nzsql -h 10.99.97.97 -d nzdba -u UUUUU -pw XXXXX -c 'select count(*) from _v_table;'
 COUNT
-------
   369
(1 row)




COMMAND REFERENCE: 

[root@sm3 nz.7.2.1.2]# ./nzodbcsql -h

NZODBCSQL - program to test Netezza ODBC driver
            NOT FOR PRODUCTION USE

    Usage : nzodbcsql [options] [ Db [ User [ Password ] ] ]

      options :
        -h <host>         : Host/server to connect [NZ_HOST/localhost]
        -d <database>     : Database to connect [NZ_DATABASE]
        -c <conn-string>  : Connection string
        -n <dsn>          : Datasource Name
        -u <user>         : User to connect [NZ_USER]
        -p <password>     : Password to use [NZ_PASSWORD]
        -m <max-rows>     : Maximum rows displayed for selects [100]
        -f <sql-file>     : Sql-file as input (non-interactive)
        -q <sql-query>    : Sql-query as input (non-interactive)

    Option precedence (low to high) : Env-variables, DSN, Conn-string, Cmd-line

    Atleast one of DSN, Conn-string and Host/Db/User/Passwd is required





TROUBLESHOOTING KNOW ISSUES:

  • Verify that executables have necessary permissions.
Example: 
[root@sm3 bin]# ls -lh /usr/local/nz.7.2.1.2/bin
total 197M
lrwxrwxrwx 1 10507 12009   19 Jun 30 14:41 libcrypto.so.10 -> libcrypto.so.1.0.1e
-r--r--r-- 1 10507 12009 6.2M May 24 21:02 libcrypto.so.1.0.1e
-rwxr-xr-x 1 10507 12009  24M May 24 21:13 libnzodbc_nzload.so
lrwxrwxrwx 1 10507 12009   16 Jun 30 14:41 libssl.so.10 -> libssl.so.1.0.1e
-r--r--r-- 1 10507 12009 1.7M May 24 21:02 libssl.so.1.0.1e
-rwxr-xr-x 1 10507 12009  22M May 24 21:13 nzconvert
-rwxr-xr-x 1 10507 12009  12M May 24 21:11 nzds
-rwxr-xr-x 1 10507 12009  12M May 24 21:11 nzevent
-rwxr-xr-x 1 10507 12009  12M May 24 21:11 nzhw
-rwxr-xr-x 1 10507 12009 9.8M May 24 21:13 nzload
-rwxr-xr-x 1 10507 12009  31K May 24 21:15 nzodbcsql
-rwxr-xr-x 1 10507 12009  11M May 24 21:10 nzpassword
-rwxr-xr-x 1 10507 12009 8.9K May 24 21:11 nzreclaim
-rwxr-xr-x 1 10507 12009 7.8M May 24 21:10 nzrev
-rwxr-xr-x 1 10507 12009  12M May 24 21:10 nzsession
-rwxr-xr-x 1 10507 12009  12M May 24 21:11 nzspupart
-rwxr-xr-x 1 10507 12009  26M May 24 21:13 nzsql
-rwxr-xr-x 1 10507 12009  11M May 24 21:10 nzstate
-rwxr-xr-x 1 10507 12009  12M May 24 21:11 nzstats
-rwxr-xr-x 1 10507 12009  11M May 24 21:10 nzsys

  • Verify that soft link to odbc.ini file is pointing to correct file. 
  • Verify file references in odbcinst.ini pointing to existing files or soft links. 
  • Revise variable, if necessary, set variables: 

Example:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nz/bin/:/usr/local/nz/lib/:/usr/local/nz/lib64/:
export ODBCINI=/usr/local/nz/bin/odbc.ini
export PATH=${PATH}:/usr/local/nz/bin
export NZ_ODBC_INI_PATH=/usr/local/nz/bin




MORE DOCUMENTATION

No comments:

Post a Comment