What are some vSphere best practices, tips & tricks that you know of?

follow the steps below to clean up your SQL database.

1 -Truncate All Performance Data 1.1 Stop vCenter Server service in services (services.msc)

1.2 Open SQL Management Studio and connect to the database.

1.3 Right click on the vCenter database (named VIM_VCDB by default) and click ‘New Query’. Copy the following query and click ‘execute’.

Declare @current_table varchar(100) declare @sqlstatement nvarchar(4000) --move declare cursor into sql to be executed set @sqlstatement = 'Declare table_cursor CURSOR FOR SELECT name FROM sys.tables where name like ''VPX_HI%'' or name like ''VPX_SAMPLE%'''

exec sp_executesql @sqlstatement

OPEN table_cursor
FETCH NEXT FROM table_cursor
INTO @current_table

WHILE @@FETCH_STATUS = 0
BEGIN
set @sqlstatement = 'truncate table ' + @current_table
exec sp_executesql @sqlstatement

FETCH NEXT FROM table_cursor
INTO @current_table

END
CLOSE table_cursor

DEALLOCATE table_cursor

2 -Purge old data from the database

2.1 Connect to the database with SQL Server Management Studio.

2.2 Expand ‘databases’ –> ‘VIM_VCDB’ –> ‘Tables’ and locate ‘dbo.VPX_Parameter’, right click on it and click ‘Edit Top 200 Rows’.

2.3 Edit the rows ‘event.maxAge’ and ‘event.maxAgeEnabled’. set max age to 30 and maxAgeEnabled to true

2.4 Navigate to ‘VIM_VCDB’ –> ‘Programmability’ –> ‘Stored Procedures’ and right click on ‘dbo.cleanup_events_tasks_proc’ then click ‘Execute Stored Procedure’. This will purge old task and event data from the database and may take some time.

3 -Shrink the SQL database 3.1 As before connect using SQL Server Management Studio.

3.2 Right click on the VIM_VCDB database and click properties. Under options set the ‘Reovery model’ to ‘Simple’ and click OK.

3.3 Right click on ‘VIM_VCDB’ and go to ‘Tasks’ –> ‘Shrink’ –> ‘Database’.

3.4 Click on OK to shrink the database.

3.5 Start the vCenter Server Service (services.msc)

/r/vmware Thread Parent