Commonly used Netezza Utilities

  • Post author:
  • Post last modified:April 25, 2018
  • Post category:Netezza
  • Reading time:3 mins read

It is very easy to perform the ETL (Extract, Transform and Load) functionalities in Netezza. Netezza supports utilities those can be used to perform the ETL/ELT operations. Below are some of commonly used Netezza utilities:

Read:

nzload utility

nzload is bulk data load utility available in Netezza. This utility supports loading data from flat file to Netezza database tables. Below is the syntax and usage:

Usage:

nzload -host <host> -db <database> -u <username> -pw <password> -t <target_table_name > -df /user/home/flat_file.txt

by default, nzload supports ‘|’ delimiter. You can overwrite it y using -Delim options.

Form more information read:

nzsql utility

nzsql is one of the Netezza utilities. The Netezza nzsql command invokes a SQL command interpreter on the Netezza host or any Unix/Linux system that can act as a edge node to connect to Netezza host. In order to use nzsql utility first driver should be installed on the machine.

You can use the nzsql command to perform all the sql related stuffs. E.g. create database objects, run queries, and manage various databases created on that particular server. You cannot manage the object created in different host or server.

Usage:

nzsql -u [username] -pw [password] -d [database] -host [Netezza_host]

For more information read:

nz_migrate utility

If you want to migrate data from one netezza server to other, then you can use the Netezza nz_migrate utility. All the tables mentioned in the tablelist parameter are migrated to the target database. You can also set the option to create target tables or truncate target tables before migrating the data. NZ_Migrate utility is faster then nzload utility as it does the migration by running many parallel threads.

Usage:

nz_migrate -shost <src_host> -thost <tgt_host> -sdb <src_db> -tdb <tgt_db> -suser <src_user> -spassword <src_password> -tuser <tgt_user> -tpassword <tgt_password> -t <table1, table2, ...> -cksum fast -genStats Full -TruncateTargetTable YES >> $log

Related reading:

External tables utility

Another way to migrate data in Netezza is to unload the table using create external table and then insert the data from that external table into the target table.

Usage:

CREATE EXTERNAL TABLE '/data/export.csv' USING (DELIM '~') AS
SELECT * from <table>;

INSERT INTO <target_table> SELECT * FROM EXTERNAL '/data/export.csv' USING (DELIM '~');

 

This Post Has 2 Comments

  1. mani

    What is difference between differential backup and groom ?

    1. Vithal Sampagar

      Hi,

      Below is the short and simple explanation.

      Groom: The GROOM TABLE command is used to maintain the user tables by reclaiming disk space for deleted or outdated rows. You can also use GROOM TABLE command to reorganize the tables by their organizing keys columns. Read my other post for more information: Groom in Netezza Tables and Databases with Aginity

      Differential Backup: It is a type of database backup. This backup type includes all the changes that are made to the database since the previous full, differential or cumulative backup. You should have full backup of the database before using differential backup option.
      Read my other post for more information: Netezza Backup and Restore: Best Practices

Comments are closed.