GROOM and the nzreclaim command

When you run the GROOM TABLE command, it removes outdated and deleted records from tables while allowing you access to all tables in the system.

Several examples follow:
  • To use the GROOM TABLE command in a SQL session:
    MYDB.SCHEMA(USER1)=> GROOM TABLE ORDERS;
    NOTICE:  Groom processed 25 pages; purged 9 records; scan size 
    shrunk by 9 pages; table size shrunk by 9 extents.
    GROOM RECORDS ALL
  • If you created scripts to run nzreclaim from the command line as in the previous example, you can update those scripts to use the new SQL GROOM TABLE command as in the following example:
    [nz@nzhost ~]$ nzsql mydb -u user1 -pw password -c "groom table 
    mynation"
  • If you use the nzreclaim command to groom a table:
    [nz@nzhost ~]$ nzreclaim -db mydb -u user1 -pw password -t mynation
    nzsql -u user1 -pw password mydb -c"groom table mynation  " 2>&1
    NOTICE:  Groom processed 25 pages; purged 9 records; scan size 
    shrunk by 9 pages; table size shrunk by 9 extents.
    GROOM RECORDS ALL

    As shown in the example, the nzreclaim command calls the GROOM TABLE command to update and reclaim the table. As a best practice, use the GROOM TABLE command instead of nzreclaim.