To verify database in vPostgres, Microsoft and Oracle:
Verifying vPostgres embedded database
To verify where growth is occurring in a vPostgres embedded database:
1. Login to vPostgres:
• Login to the vPostgres Embedded database in a vCenter Server Appliance deployment:
• Login to the vPostgres Embedded database in a Windows based vCenter Server installation, see this:
2. Then execute the following query to see an output containing the biggest tables in VCDB:
SELECT nspname || '.' || relname AS "relation", pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) WHERE nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind <> 'i' AND nspname !~ '^pg_toast' ORDER BY pg_total_relation_size(C.oid) DESC LIMIT 20;
From the output of the query above, you can determine what tables have the biggest size and from there proceed with a clean up process. You might see that the tables using more space are the ones explained in the Purpose section.
Verifying Microsoft SQL Server database
The first step in reviewing the configuration with Microsoft SQL Server is determining if space is being consumed from within the database (
.mdf) file or the transaction log (
.ldf). It is important to identify this first because it affects how you troubleshoot the issue.
To verify where growth is occurring in a Microsoft SQL database:
1. Open Microsoft SQL Server Management Studio.
2. Right-click the vCenter Server database and select Tasks > Shrink > Files.
3. By default, the currently allocated space and available free space is shown for the database. Note the currently allocated space and the available free space.
4. Click File type and select Log from the dropdown. The currently allocated space and the available free space fields change to show the space allocated and available for the Transaction Log. Note the currently allocated space and the available free space.
From the information noted in these fields, you can make a judgement on the allocation of the disk space. Depending on where the space is allocated, proper steps can be taken to address the issue. The next sections discuss how to validate what is causing the usage of the space.
Determining what is causing VCDB to grow in MS SQL Server
Use one of these methods to validate where space is being consumed within the database:
• Manually run this SQL query against the vCenter Server database:
select object_name(id) [Table Name],
[Table Size] = convert (varchar, dpages * 8 / 1024) + 'MB'
from sysindexes where indid in (0,1)
order by dpages desc
This query lists all tables in the vCenter Server database by table size in MB.
• Manually run this SQL query for individual tables:
exec sp_spaceused tablename;
Note: Querying the database one table at a time may be time consuming. To query all tables simultaneously, use this SQL Query:
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"
vCenter Server Transaction log growth in Microsoft SQL Server
Regardless of the recovery model, VMware recommends that you take regular backups of the database and that a truncate of the transaction log is performed at the same time as the backup. This regular maintenance prevents the size of the transaction logs from posing an issue to the amount of disk space available to the system. For more information on the transaction logs and how to shrink them, see:
Verifying Oracle databases
If you are using Oracle, run this query to validate the space per table:
select segment_name, blocks * 8192 from user_segments;Note: This assumes that the database is configured to have 8k bytes. To get MB instead of bytes, divide by 1024.
For more information on diagnosing causes to the space growth in the listed tables, see Troubleshooting growth of the vCenter Server database in
Investigating the health of a vCenter Server database (1003979)