Skip to content

Archive for

libncurses.so.5: wrong ELF class: ELFCLASS64

Issue:
Netezza client is not working and is throwing below error.
$ nzsql
nzsql: error while loading shared libraries: libncurses.so.5: wrong ELF class: ELFCLASS64

Analysis:
$ pwd
/nzhome/nzclient/v707

$ ldd ./bin/nzsql
linux-gate.so.1 => (0x003e0000)
libz.so.1 => /lib/libz.so.1 (0x00256000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00600000)
libssl.so.6 => /nzhome/nzclient/lib/libssl.so.6 (0x00d8f000)
libcrypto.so.6 => /nzhome/nzclient/lib/libcrypto.so.6
(0x008c2000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00f01000)
libnsl.so.1 => /lib/libnsl.so.1 (0x001e4000)
libdl.so.2 => /lib/libdl.so.2 (0x002ef000)
libncurses.so.5 => not found
libm.so.6 => /lib/libm.so.6 (0x00bf0000)
libc.so.6 => /lib/libc.so.6 (0x003e1000)
libfreebl3.so => /lib/libfreebl3.so (0x0015b000)
libgssapi_krb5.so.2 => /lib/libgssapi_krb5.so.2 (0x00e87000)
libkrb5.so.3 => /lib/libkrb5.so.3 (0x002fe000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x00e1c000)
libk5crypto.so.3 => /lib/libk5crypto.so.3 (0x001aa000)
/lib/ld-linux.so.2 (0x0013b000)
libkrb5support.so.0 => /lib/libkrb5support.so.0 (0x00110000)
libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x0011b000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0011f000)
libselinux.so.1 => /lib/libselinux.so.1 (0x001ff000)

Here you will find that libncurses.so.5 is shown as not found. But when you check, you will see the symbolic link is alread created.
$ pwd
/nzhome/nzclient/v707/lib/

$ ls -lrt libncurses.so.5
libncurses.so.5 -> /lib64/libncurses.so.5

You will see that it is pointing to 64 bit library file. Which is wrong. It should point to /lib/libncurses.so.5

Solution:
In order to fix th issue, you have to delete the current soft link and create a new one which will point to 32bit library file.
$ pwd
/nzhome/nzclient/v707/lib/

$ rm libncurses.so.5

$ ln -s /lib/libncurses.so.5 /nzhome/nzclient/v707/lib/libncurses.so.5

$ ls -lrt libncurses.so.5
libncurses.so.5 -> /lib/libncurses.so.5

 

How to find SQL extention toolkit version?

To find the SQL extention toolkit version / functions installed on your Netezza server, we can run below select queries in system database or database where SQL Extention toolkit is enabled.

1) To find the version of xml functions installed on the server:

SYSTEM(ADMIN)=> SELECT regexp_version();

OUTPUT:
REGEXP_VERSION
————————————————————
IISI XML / Regular Expression Library Version 1.4 Build ()
(1 row)
2) To find the version of all the functions except xml functions run:

SYSTEM(ADMIN)=> SELECT CRYPTO_VERSION();

OUTPUT:
CRYPTO_VERSION
——————————————
IISI Crypto Library Version 1.4 Build ()
(1 row)

Normally both wil have same version but it posisble that someone may have installed one component and missed the other because when we install SQL Extention toolkit and enable for a databsae we have two steps each, one to install xml functions and other for non-xml.