If the VirtualCenter database is very large (50GB or more) and the row count in the 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 VirtualCenter database.
Here's how you reduce the size of the VirtualCenter database:
Warning: This procedure erases all historical data and is considered destructive. Are you REALLY sure you want to do this... I did and it DOES work but I have to give you the disclaimer just in case Murphy decides to play games with you...
VMware highly recommends that a Database Administrator perform this step. - Trust me... Go find your DBA if you have one.
To truncate the tables within the database:
Warning: Yes another Warning...This procedure is destructive and erases historical data. OK - I'm done with the warnings I promise.
- *** Ensure that you have a good backup of the database. Do not skip this step. ***
- Shutdown the VirtualCenter Server service and any other services (such as VMware VDI or VMware Lab Manager) which use the database.
- Run the following commands against the Database:
truncate table vpx_hist_STAT1
truncate table vpx_hist_STAT2
truncate table vpx_hist_STAT3
truncate table vpx_hist_STAT4
truncate table vpx_sample_time1
truncate table vpx_sample_time2
truncate table vpx_sample_time3
truncate table vpx_sample_time4
3. Set the VirtualCenter database to simple recovery mode
4. Shrink log and database files
5. Backup the database
6. Start the VirtualCenter Server services that you stopped in step 2.
Your database should now be much smaller in size and manageable. Make sure your database rollup scripts are also turned back on or your VC won't collect future Historical Performance Statistics.
Please refer to this article if the Rollup Scripts are missing: vmWorldz Article
0 comments:
Post a Comment