Reduce the historical data records before running the vCenter Server upgrade. You can use a script for your type of database. The scripts for the supported database types are mentioned in this KB article.
The scripts contain three main parameters:
All tasks older than TaskMaxAgeInDays day will be deleted.
All events older than EventMaxAgeInDays day will be deleted.
All statisticts older than StatMaxAgeInDays day will be deleted.
-1 | Skips the respective historical data deletion. For example, TaskMaxAgeInDays = -1, means that no task records will be deleted. |
0 | Deletes all historical data for the respective component. For example, TaskMaxAgeInDays = 0, will delete all task records. |
1 and more | Deletes data older than the number you entere, in days. For example, TaskMaxAgeInDays = 10, leaves the task records gathered within the last 10 days and deletes all of the records gathered before that. |
If vCenter Server is installed on a Windows machine:
vcdb.properties
file in the %VMWARE_CFG_DIR%\vmware-vpx\
folder and open the file in a text editor.vcdb.properties
file, locate the password of the vCenter Server database user and record it.If you deployed the vCenter Server Appliance
vcdb.properties
file in the /etc/vmware-vpx/
folder and open the file in a text editor.vcdb.properties
file, locate the password of the vCenter Server database user and record it.cat /etc/vmware-vpx/vcdb.properties | grep "password =" | awk '{ print $3 }'
Run the script for your database
If your database is Microsoft SQL Server:
sqlcmd -S IP-address-or-FQDN-of-the-database-machine -U vCenter-Server-database-user -P password -d database-name -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -i download-path\
2110031_MS_SQL_task_event_stat.sql
If your database is Oracle:
2110031_
Oracle_task_event_task.sql
script attached to this KB article.sqlplus
with the vCenter Server database user name and password:
sqlplus vCenter-Server-database-user/password
@ <PATH></PATH>/2110031_Oracle_task_event_stat.sql task-days event-days stat-days
Note: The order of the task, event and stat days is critical for the correct script execution.
If your database is PostgreSQL:
Postgres_task_event_task.sql
script attached to this KB article.psql
and when prompted provide the vCenter Server user password.
C:\Program Files|VMware\vCenter Server\Postgres\bin
and run psql:
psql -U vCenter-Server-database-user -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -d <DATABASE></DATABASE>-t -q -f download-path\2110031_Postgres_task_event_stat.sql
/opt/vmware/vpostgres/current/bin/psql -U vCenter-Server-database-user -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -d database -t -q -f download-path/2110031_Postgres_task_event_stat.sql