The nzhistcleanupdb command

Issue the nzhistcleanupdb command to delete outdated history information from a history database.

Syntax

The nzhistcleanupdb command has the following syntax:
nzhistcleanupdb [options]

Inputs

The nzhistcleanupdb command takes the following input options:
Table 1. The nzhistcleanupdb input options
Input Description
{-d | --db} dbname The name of the history database from which you want to remove old data. If you want to specify a delimited name, you must enclose the name in double quotation marks, and you must escape the quotes with a backslash. For example:

-d \"MyDbName\"

{-n | --host} NZ_HOST The host name of the system where the database resides. The default and only value for this option is NZ_HOST.
{-u | --user} user The user account that permits access to the database. The default is NZ_USER. The user must both be able to access the history database and must have the Delete privilege for the history database tables.

If you want to specify a delimited name, you must enclose the name in double quotation marks, and you must escape the quotes with a backslash. For example:

-u \"MyUserName\"

{-p | --pw} password The password for the user account that permits access to the database. The default is NZ_PASSWORD.
{-t | --time} "<yyyy-mm-dd[,hh:mm[:ss] ]>" The date and time threshold. All data recorded before this date and time is deleted. The date (year, month, and day) is required. The time (hours, minutes, and seconds) is optional. The default time is 12:00 AM (midnight, start of day).
-f | --force Do not prompt for confirmation.
-g | --groom Run a groom operation (that is, automatically issue the GROOM TABLE command) after the cleanup operation completes. This updates the zone maps for the history data tables, which improves the performance of queries against those tables.
-h | --help Display the usage and syntax for the command.

Description

Issue the nzhistcleanupdb command to delete outdated history information from a history database.
Privileges required
You must be the nz user to run this command, and you must specify a database user account who is either the owner or user of the history database or who has administration privileges to update the history database and its tables.

Usage

The following command removes from the history database with the name histdb any history data that was collected before October 31, 2013, and automatically grooms the history tables afterward:
[nz@nzhost ~]$ nzhistcleanupdb -d histdb -u smith -pw password -t 
"2009-10-31" -g
About to DELETE all history entries older than 2013-10-31 00:00:00 
(GMT) from histdb.
Proceed (yes/no)? :yes
BEGIN
DELETE 0
DELETE 98
DELETE 34
DELETE 0
DELETE 0
DELETE 188
DELETE 188
DELETE 62
DELETE 65
DELETE 0
DELETE 0
DELETE 0
DELETE 503
COMMIT