The nz manualvacuum command
The nz manualvacuum command performs a comprehensive vacuum and reindex operation on all databases in your NPSaaS instance. This maintenance operation helps reclaim disk space and optimize database performance by removing obsolete
data and rebuilding indexes. This command was introduced in nzcli version 11.3.1.3.
Overview
The manual vacuum operation is a critical maintenance task that:
- Stops the NPS system (
nzstop) - Creates a backup of the catalog data
- Performs vacuum and reindex operations on all databases
- Restarts the NPS system (
nzstart)
The system is unavailable during this operation, which may take significant time depending on the size of your databases.
Prerequisites
Before running the manual vacuum operation, ensure that:
- You have administrative access to the NPSaaS instance
- You have downloaded and configured the
nzcommand-line tool version 11.3.1.3 or later - You have set the required environment variables (
APISERVER_URL,NZ_USER,NZ_PASSWORD) or are prepared to provide them as command options - You have scheduled a maintenance window, as the system will be unavailable during the operation
- You have sufficient disk space for the catalog backup
Syntax
nz manualvacuum [options]
Options
| Option | Description |
|---|---|
-apiserver <APISERVER> |
The URL of the API server. Can be set using the APISERVER_URL environment variable. (required) |
-u <USER> |
NPS username. Can be set using the NZ_USER environment variable. (required) |
-pw <PASSWORD> |
NPS password. Can be set using the NZ_PASSWORD environment variable. (required) |
-force |
Skip the confirmation prompt and proceed with the operation immediately |
-format <FORMAT> |
Output format for the command results |
-host <HOST> |
The URL of the API server. Can be set using the NZ_HOST environment variable |
Examples
Running manual vacuum with confirmation prompt
./nz manualvacuum -apiserver <apiserver-url> -u <nps-admin-user> -pw <nps-admin-user-password>
The command displays a warning and prompts for confirmation:
WARNING: Manual Vacuum Operation
=====================================
This operation will:
1. Stop NPS (nzstop)
2. Run nz_manual_vacuum
3. Start NPS (nzstart)
This process may take significant time and will restart the system.
The system will be unavailable during this operation.
Do you want to continue? (yes/no):
Running manual vacuum without confirmation
Use the -force option to skip the confirmation prompt:
./nz manualvacuum -force -apiserver <apiserver-url> -u <nps-admin-user> -pw <nps-admin-user-password>
Using environment variables
Set environment variables to avoid specifying credentials in the command:
export APISERVER_URL=<apiserver-url>
export NZ_USER=<nps-admin-user>
export NZ_PASSWORD=<nps-admin-user-password>
./nz manualvacuum -force
Operation workflow
When you run the nz manualvacuum command, the following workflow is executed. Internally, the command invokes the nz_manual_vacuum system binary on the NPS host.
- System stop: The NPS system is stopped using the
nzstopcommand - Catalog backup: A backup of the catalog data is created at
/nz/manual_vacuum/nz_manual_vacuum.<timestamp>.tar.gz - Vacuum and reindex: The operation performs vacuum and reindex on:
- The
_T_OBJECTsystem table - All user and system databases in sequence
- The
- System start: The NPS system is restarted using the
nzstartcommand - Completion: The operation completes and displays a summary of the results
Output and logs
The manual vacuum operation generates:
- Log file:
/nz/manual_vacuum/nz_manual_vacuum.<timestamp>.log - Backup file:
/nz/manual_vacuum/nz_manual_vacuum.<timestamp>.tar.gz - Console output: Detailed progress information including:
- Operation handle and timestamp
- Command execution status
- Timing information for each database
- Size comparison (before and after)
- Completion status
Sample output
Manual vacuum completed successfully
Output:
================================================================================
Manual Vacuum Workflow Started
Handle: nzrest.68n6kkr8.manual_vacuum
User: admin
Timestamp: 2026-06-09 14:08:12,790
================================================================================
# Database 1 of 19 SYSTEM
TIMINGS (vacuum ): Elapsed Time: 0.21
TIMINGS (reindex ): Elapsed Time: 0.39
...
###############################################################################
Size Before Size After Pathname
=============== =============== =========================================================
3924887043 3915646467 /data/catalog/data.1.0
###############################################################################
log file: /nz/manual_vacuum/nz_manual_vacuum.20260609_140932.log
backup file: /nz/manual_vacuum/nz_manual_vacuum.20260609_140932.tar.gz
================================================================================
Manual Vacuum Workflow Completed Successfully
All commands executed without errors
================================================================================
Best practices
- Schedule manual vacuum operations during maintenance windows when the system can be offline
- Monitor disk space before running the operation to ensure sufficient space for the catalog backup
- Review the log files after completion to verify successful execution
- Consider the size of your databases when planning the maintenance window, as larger databases require more time
- Keep the backup files for recovery purposes until you verify the operation completed successfully