The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
Reducing the size of the vCenter Server database when the rollup scripts take a long time to run (1007453)
- The vCenter Server database is very large (50 GB or more) and the row count in the
VPX_HIST_STATtables is very high (800 million lines or more).
- Rollup scripts are running very slowly or may not complete successfully.
- Performance Charts may not display recent data.
- Gaps are appearing in the Performance Charts.
- When this issue is encountered, you may see this message in the Windows Event Viewer on vCenter Server:
Stats insertion failed for entity esxhost.domain.com due to ODBC error
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 VirtualCenter performance data indexes on a Microsoft SQL database (1003990).
To reduce the size of the vCenter Server database:Warning: This procedure erases all historical data. If you want to retain some historical performance data instead of deleting all of it, see Purging old data from the database used by vCenter Server (1025914) or Purging old data from the database used by VirtualCenter 2.x (1000125).
Note: The below steps are not applicable to vCenter Server 5.1 and 5.5. To truncate performance data on the vCenter Server 5.1 and 5.5 database see the following section, To truncate all performance data from vCenter Server 5.1.
- 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_STAT1table and corresponding
VPX_SAMPLE_TIME1table. Once the truncate has completed, 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;
Note: To reduce the size of vCenter Server Database, you can also delete the data from the
VPX_TASKtables. To delete the data from these tables, see Purging old data from the database used by vCenter Server (1025914) or Purging old data from the database used by VirtualCenter 2.x (1000125).
If the rollup jobs do not complete successfully, it may be necessary to truncate the
VPX_HIST_STAT2table, 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_TEMPTABLExtables are a staging/cache area for the performance data before they are processed and moved to
truncate table VPX_TEMPTABLE0;
truncate table VPX_TEMPTABLE1;
truncate table VPX_TEMPTABLE2;
- Run the rollup scripts using 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.
To truncate all performance data from vCenter Server 5.1 and 5.5
Warning: This procedure permanently removes all historical performance data. Ensure to take a backup of the database/schema before proceeding.
- Stop the VMware VirtualCenter Server service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Note: Ensure that you have a recent backup of the vCenter Server database before continuing. Do not skip this step.
- Log in to the vCenter Server database using SQL*Plus (for Oracle) or SQL Management Studio (for SQL Server).
- Copy and paste the contents of the Oracle_truncate_5.1.sql script attached to this article into SQL*Plus. Alternatively, for SQL Server, copy and paste the contents of the SQL_truncate_5.1.sql script into SQL Management Studio.
- Execute the script to delete the data.
- Restart the vCenter Server services.
- For more information about the truncate function, refer to the applicable database vendor documentation or support. Refer to these pages for information which may assist in the process:
- For additional database maintenance:
- Set the vCenter Server database to simple recovery mode
- Shrink log and database files
- Setting the Recovery Model to Simple ensures that the transaction log does not grow to the maximum size.
- For translated versions of this article, see:
Note: The links in this article were correct as of January 25, 2013. If you find a link is broken, provide feedback and a VMware employee will update the link.
- Purging old data from the database used by VirtualCenter 2.x
- Stopping, starting, or restarting vCenter services
- Defragmenting VirtualCenter performance data indexes on a Microsoft SQL database
- Updating rollup jobs after the error: Performance data is currently not available for this entity
- Purging old data from the database used by VMware vCenter Server 4.x and 5.x
- Reducir el tamaño de la base de datos de vCenter Server cuando los scripts de rollup toman largo tiempo en ejecutarse
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.