IBM PureData System for Analytics, Version 7.1

The nzreclaim command

Use the nzreclaim command to recover disk space that is used by updated or deleted data by using the GROOM TABLE command.

Note: Starting in release 6.0, the SQL GROOM TABLE command replaces the nzreclaim command. The nzreclaim command is now a “wrapper” that calls the GROOM TABLE command to reclaim space. if you have existing scripts that use the nzreclaim command, those scripts continue to run, although some of the options might be deprecated since they are not used by GROOM TABLE. You should use the GROOM TABLE command in your scripts.

Syntax

The nzreclaim command uses the following syntax:
nzreclaim [-h|-rev] [options]

Inputs

The nzreclaim command takes the following inputs:
Table 1. The nzreclaim input options
Input Description
nzreclaim -backupset options Specifies the backup set to use to find the rows that can be reclaimed. By default, nzreclaim uses the most recent backup set, but you can use this option to specify a different backup set for the reclaim-backup synchronization. If you specify NONE, the command reclaims all rows regardless of whether they were saved in a backup set.
nzreclaim -blocks options Removes empty blocks at the beginning of the table.
nzreclaim -records options Removes deleted records from a database or table.
nzreclaim -startEndBlocks options Removes empty blocks from the beginning and the end of the table.

Options

The nzreclaim command takes the following options:
Table 2. The nzreclaim options
Option Description
-u user Specifies the database user name [NZ_USER].
-pw password Specifies the user password [NZ_PASSWORD].
-host name Specifies host name or IP address [NZ_HOST].
-db database Grooms one or all tables in a specific database [NZ_DATABASE]. You can use the -t option to specify a table, or -allTbls to groom all the tables.
-allDbs Grooms all databases. You can use the -t option to specify a table to groom in all databases, or -allTbls to groom all tables in all databases.
-schema schema Specifies the schema in which to groom the tables if your Netezza® system supports multiple schemas. You can use this option with the -db option, but not with the -allDbs option. If you specify -schema and -allTbls, the command grooms all the tables in the schema. If you do not specify a schema, the system uses NZ_SCHEMA to identify the schema. If NZ_SCHEMA is not set, the system uses the default schema for the database.
-t tbl Grooms the specified table name. Grooms the specified table name. You must specify the database where the table resides. You can use the -db option to groom all the tables in one database. Use this with the
-db
and -schema options to groom the table in one schema. Use this with the-allDbs to groom that table in all the databases.
-allTbls Grooms all the tables in the specified database or schema. You use this with the -db option to groom all the tables in one database, or -allDbs to groom all tables in all databases.

Description

The nzreclaim command does the following:
Privileges required
You must have the Groom object privilege for the tables that you want to reclaim or reorganize.
Common tasks
Use the nzreclaim command to groom tables and recover disk space. Specify either record-level or block-level reclamation.
  • To remove all unused records throughout the table, specify nzreclaim -records.
  • To remove blocks from the beginning of the table, specify nzreclaim -blocks.
  • To remove unused blocks from the beginning and end of the table, specify nzreclaim ‑startEndBlocks.

Related commands

Use the TRUNCATE command to quickly delete all rows in a table without requiring a GROOM TABLE afterwards.

Usage

The following provides sample usage:



Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28