Skip to content

Instantly share code, notes, and snippets.

@JustinMcNamara74
Last active July 28, 2017 16:18
Show Gist options
  • Save JustinMcNamara74/8041a73b92d14905039a3c2f775fef9d to your computer and use it in GitHub Desktop.
Save JustinMcNamara74/8041a73b92d14905039a3c2f775fef9d to your computer and use it in GitHub Desktop.
#NETEZZA Find and groom altered tables

List all altered tabled

Run the command:
nz_alterd_tables
Sample Results:
Database Schema Table Name Size (Bytes) # Of Versions
DB1 SCHEMA1 TABLE1 59,506,688 2
DB2 SCHEMA2 TABLE2 1,538,129,920 2

Groom All altered tables

Run the command:
nz_alterd_tables -groom
Sample Results:
Grooming SCHEMA1.DB1.TABLE1     @ 2017-07-28 05:56:04
NOTICE:  Groom will not purge records deleted by transactions that started after 2017-07-28 05:51:02, the start time of the oldest unfinished stablexid transaction 0x3e2bf0a.
NOTICE:  If this process is interrupted please either repeat GROOM VERSIONS or issue 'GENERATE STATISTICS ON "TABLE1"'
NOTICE:  Groom processed 0 pages; purged 0 records; scan size unchanged; table size unchanged.
GROOM VERSIONS
Elapsed time: 0m3.761s
....
....

Groom an single DB

Run the command:
nz_groom [db_name]

Example:

nz_groom DB1
Sample Results:
Name Remaining Rows Remaining Size Reclaimable Rows Reclaimable Size NON-Groomable Rows
TABLE1 100 542,112 5,000 2,123,315 0
TABLE2 54 542,112 5,000 2,123,315 0
TABLE3 460,000 23,056,093 0 0 0
TABLE4 100 542,112 5,000 7,923,315 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment