If the vCenter Server database is very large (50 GB or more) and the row count in the
VPX_HIST_STAT# table is very high (800 million lines or more), the database rollup scripts may have difficulty handling the amount of data. Rollup scripts run faster if you reduce the size of the vCenter Server database.
Before you reduce the size of the vCenter Server database, you may want to defragment the indexes on your Microsoft SQL database server. For more information, see
Defragmenting VMware VirtualCenter or vCenter Server performance data indexes on a Microsoft SQL database (1003990).
Reducing the size of the vCenter Server database 2.x
To reduce the size of the vCenter Server database:
- Ensure that you have a good backup of the vCenter Server database. Do not skip this step.
- Shut down the VMware VirtualCenter Server service and any other services (such as VMware VDI or VMware Lab Manager) that use the database. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Note: Again, ensure that you have a recent backup of the vCenter Server database before continuing. Do not skip this step.
- Truncate the
VPX_HIST_STAT1
table and corresponding VPX_SAMPLE_TIME1
table. After completing the truncate, verify if the rollup jobs are now completing successfully. For more information, see step 4.
Warning: The truncate function is destructive. VMware highly recommends that a Database Administrator perform this step.
To truncate the tables, execute these SQL statements:
truncate table VPX_HIST_STAT1;
Note: In vCenter Server 5.1and 5.5, the table name is VPX_HIST_STAT1_n.
truncate table VPX_SAMPLE_TIME1;
If the rollup jobs do not complete successfully, it may be necessary to truncate the VPX_HIST_STAT2
table, and the corresponding table, VPX_SAMPLE_TIME2
. Continue truncating the VPX_HIST_STAT[1-4]
tables and corresponding VPX_SAMPLE_TIME[1-4]
tables until the rollup jobs are completing successfully.
Note: These additional tables in vCenter Server 4.1 and 5.0 can also be truncated to further reduce the vCenter Server database size. The VPX_TEMPTABLEx
tables are a staging/cache area for the performance data before they are processed and moved to VPX_HIST_STAT1
.
truncate table VPX_TEMPTABLE0;
truncate table VPX_TEMPTABLE1;
truncate table VPX_TEMPTABLE2;
- To run the rollup scripts perform these steps:
- Using SQL Management Studio, connect to the SQL database for vCenter Server.
- Navigate to SQL Server Agent > Jobs.
- Select the individual rollup jobs, right-click and select Start Job at Step.
- Start the VMware VirtualCenter Server service and any other service service that you stopped in step 2.