Tuesday, January 24, 2017

SQuirreL SQL Client - for netezza on window/linux,mac


SQuirreL SQL Client


SQuirreL SQL Client is a graphical Java program that will allow you to view the structure of a JDBC compliant database, browse the data in tables, issue SQL commands etc. The minimum version of Java supported is 1.6.x as of SQuirreL version 3.0.
SQuirreL's functionality can be extended through the use of plugins.

My client having issue connecting netezza on mac using any sql client tool. He was forced to use "Parallels" to install window client tool to connect to netezza.

SQuirreL SQL Client  is java based tool ,which could be installed on any OS , including mac, window, linux etc.

Download and Install client -




After installing SQuirreL tool, first step is to configure it for netezza. 
Below the steps to configure this tool -

Create new Driver for Netezza

You will find “Aliases” & “Drivers” tabs on left pan. Click on “Drivers” tab -> Click on “+” icon to add new Drivers.

Drivers

  • Name : Give some user friendly name
  • Example URL: jdbc:netezza://hostname or ip address:5480/databasename
  • Website URL : jdbc:netezza:// hostname or ip address:5480/databasename 
  • Extra Class Path : Click on “Add” to browse the netezza jar file. If you don't have netezza jdbc driver (jar file), you can dowload it from IBM.
  • Class Name : org.netezza.Driver


Click OK


Once you configured and created driver, its time to create/configure alias.


  • Click on “Aliases” tab on left pan
  • Click on “+” icon to add new aliases. 
  • Add Alias window will open.
  • Name : Pass user friendly name
  • Drivers : Select you drivers, which you have created in previous step
  • URL : jdbc:netezza://hostname or ip address:5480/database name
  • User name : Your Netezza User name
  • Password : Your netezza password
  • Click on “Test” to test the connection



  • Once test connection successful , now its time to run your query
  • Select your netezza Aliases name.
  • Click on “Connect to Selected Alias (Control O)” icon 
  • Now to to “SQL” tab and run you query 


Thanks & Good luck. Post me question, in case you have any problem configuring this tool. 



Monday, January 9, 2017

Netezza - Installing UDF




Netezza is not showing UDF (User Defined Function) ?


Solution: You probably need to install SQL Extensions toolkit.

You may find the installer at below path.  Or just find libnetcrypto  folder.
You may find installer under libnetcrypto  folder or one folder beneath.


Login as nz user.

cd /export/home/nz/sqlext/libnetcrypto
Once you find "install", run below command.
 ./install -d dbname -schema schemaname  -u username -W password


Additional link -
https://www.ibm.com/support/knowledgecenter/SSULQD_7.2.1/com.ibm.nz.sqltk.doc/t_sqlext_enabling.html#t_sqlext_enabling



[nz@hostname]$ cd /export/home/nz/apps/libnetcrypto/7.2.1.3/
[nz@hostname]$ ./install -d dw_audit
Installing libnetcrypto to default schema of database dw_audit in unfenced mode: .................................................. Done
[nz@hostname]$ pwd
/export/home/nz/apps/libnetxml/7.2.1.3
[nz@hostname]$ ./install -d databasename
Installing libnetxml to default schema of database databasename in unfenced mode: ............................................ Done

[nz@hostname]$ nzsql
Welcome to nzsql, the IBM Netezza SQL interactive terminal.

Type:  \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

SYSTEM.ADMIN(ADMIN)=> \c databasename
You are now connected to database dw_audit.
databasename.NZUSER(ADMIN)=> select regexp_version();
                                    REGEXP_VERSION
--------------------------------------------------------------------------------------
 IBM Netezza SQL Extensions XML / Regular Expression Library Version 7.2.1.3 Build ()
(1 row)

databasename.NZUSER(ADMIN)=>  SELECT CRYPTO_VERSION();
                           CRYPTO_VERSION
--------------------------------------------------------------------
 IBM Netezza SQL Extensions Crypto Library Version 7.2.1.3 Build ()
(1 row)

databasename.NZUSER(ADMIN)=> select REGEXP_MATCH_COUNT('This is comcast sytem.','is');
 REGEXP_MATCH_COUNT
--------------------
                  2
(1 row)