Use the nzreclaim command to recover disk space that is used by updated or deleted data by using the GROOM TABLE command.
nzreclaim [-h|-rev] [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. |
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
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. |
Use the TRUNCATE command to quickly delete all rows in a table without requiring a GROOM TABLE afterwards.
The following provides sample usage:
nzreclaim -u admin -pw password -db emp -t mytable
nzsql -u admin -pw password emp -c"groom table mytable " 2>&1
NOTICE: Groom processed 392131 pages; purged 2342 records; scan
size unchanged; table size unchanged.
GROOM RECORDS ALL
nzreclaim -u admin -pw password -blocks -db emp -schema acme
nzreclaim -u user -pw password -startEndBlocks -db emp