"The transaction log for database 'VIM_VCDB' is full" error on a Microsoft SQL DB server
search cancel

"The transaction log for database 'VIM_VCDB' is full" error on a Microsoft SQL DB server

book

Article ID: 321431

calendar_today

Updated On:

Products

VMware Cloud Director VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides the resolution for the The transaction log for database 'vim_vcdb' is full error on a Microsoft SQL database server.


Symptoms:
  • The transaction log (.ldf) of the VirtualCenter database may grow to an excessive size.
  • The Windows event error states:

    Faulty Application: vpxd.exe
     
  • Cannot start the VMware VirtualCenter Server service.
  • In the Virtual Center vpxd.log file when connected to Microsoft SQL database, you see the error similar to:
     
    ODBC error: (42000) - [Microsoft][ODBC SQL Server Driver][SQL Server]The log file for database '<database>' is full. Back up the transaction log for the database to free up some log space.
     
  • Verbose logging in the VirtualCenter vpxd.log file shows an error similar to:

    [VpxdVdb] Failed to get next sequence number: "ODBC error: (42000) - [Microsoft][SQL Native Client][SQL Server]The transaction log for database 'VIM_VCDB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases" is returned when executing SQL statement "update vpx_sequence WITH (ROWLOCK) set id = ? where name = ?"


Environment

VMware ESX 4.0.x
VMware ESXi 4.0.x Embedded
VMware ESXi 4.1.x Embedded
VMware vCenter Server 5.1.x
VMware vCenter Server 5.0.x
VMware vCenter Server 4.0.x
VMware vCenter Server 6.7.x
VMware VirtualCenter 2.0.x
VMware vCenter Server 6.5.x
VMware ESXi 4.1.x Installable
VMware vCenter Server 6.0.x
VMware vCenter Server 5.5.x
VMware ESXi 4.0.x Installable
VMware vCenter Server 4.1.x
VMware VirtualCenter 2.5.x

Resolution

Many customers choose to deploy VirtualCenter Server with a Microsoft SQL Server database. SQL Server offers administrators a choice of recovery models, which is the primary factor that determines transaction log disk space requirements. The full recovery model is default and has the potential to consume all available disk space, if appropriate database maintenance is not performed. It is a best practice to schedule regular backups of the database and transaction log to avoid unnecessary growth.
 
In some instances, VirtualCenter may crash because all disk space is consumed by the transaction logs or not start due to lack of transaction log space. In these cases where full backup cannot be performed and free space is required to get VirtualCenter to start, it is possible to 'commit' and then shrink the transaction logs.
 
To commit and shrink the transaction logs:
 
Note: If this is a production database, backup the database after following these steps. When the transaction log is committed replay is not available for any transactions in a disaster recovery scenario after the last full backup that was performed.

Microsoft SQL 

On a Microsoft SQL server:

 
Note: Microsoft SQL Server Management Studio Express can be used for SQL server 2005 Express Edition. If it is not installed on the server, you cant download and install it from the Microsoft Download Center. For Microsoft SQL 2008 Express edition, see Download Center.

Note: The preceding link was correct as of November 28, 2019. If you find the link is broken, provide feedback and a VMware employee will update the link.
  1. Log in to the Microsoft SQL Server as an administrator.
  2. Open up SQL Management Studio.

    Note: If you are using MS SQL 2005, ensure that you use MS SQL Management Studio 2005. Alternatively, if you are using MS SQL 2008, ensure that you use MS SQL Management Studio 2008.
     
  3. Right-click the database that VirtualCenter is using.
  4. Click Properties.
  5. Click the Options link.
  6. Set the Recovery Model to Simple:
    vim_vcdb
     
  7. Click OK.
  8. Right-click on the database again.
  9. Click Tasks > Shrink > Files.
  10. On the Shrink Database window select the file type as Log . The file name appears in the filename drop down as databasename_log:

    sql server transaction log full

    The space used versus the space allocated displays. After you set the recovery model to Simple, the majority of the space in the transaction log released.
  11. Ensure that the Release unused space radio button is selected.
  12. Click OK on this window to shrink the transaction log.
Free space is now available on the server. If the VMware VirtualCenter Server service was not starting due to lack of space in the transaction log attempt to start the service again at this point.
 
Note: If there is more than one transaction log for the database, perform the preceding steps for each of the logs. Also see, Investigating the health of a vCenter Server database (1003979) and Determining where growth is occurring in the vCenter Server database (1028356)


Workaround:
To work around this issue:
  1. Log in to SQL Server Management Studio Express.
  2. Select vCenter database.
  3. Right Click on vCenter database and select  Properties as shown below.
sql transaction log
  1. Click on Files and set the Maximum File size as shown in the below screenshot:
database log
  1. Click OK.


Additional Information

When the database is in simple recovery mode, regular backups of the transaction logs are not required as they do not grow substantially in size. The downside of this model is that it does not keep a record of the transaction logs, and therefore if there is a database failure all changes made after the last full backup are lost. If recovery from a failure is a high priority than the full recovery model must be used. Ensure that regular maintenance is performed by backing up the database and transaction logs. This allows for recovery of all data up until the point of failure. For more information, see the Microsoft article Recovery Models (SQL Server).

Alternatively, you can also configure the autogrow option to manage the growth of transaction logs is to configure the autogrow option. To use this option, engage your DBA. For more information see Microsoft Knowledge Base article 315512.
 
Note: The preceding link was correct as of August 20, 2019. If you find that the link is broken, please provide feedback and a VMware employee will update the link.

Note: SQL Express instance for 2008 R2 has a default restriction of 500 MB on the transaction log. The size can be increased or set to unrestricted (max file size possible).