vCD SQL Transaction Logs full?

There are a ton of blogs out there with complex queries and actions you can perform when your transaction logs are full and the vCD Web Interface fails with an error like:

com.vmware.vcloud.common.persist.exception
.CellNotActiveException: Cell is not active

Well, I decided to make it simple for those who just want to get your environment back up and running ASAP.

Running DBCC commands are pointless if your transaction logs are full because your DB cant log its action and therefore fails.  Performing these basic steps will get your vCD Web Interface up and running ASAP.

  1. If your SQL server is a VM, add a new disk to the VM that has about 10GB.  If your server is physical, hook up an external HD (or internal) that has a min of 10GB.
  2. Go into Disk Management on your Windows server that runs your SQL.  The new drive should show up in there.  Initialize the disk (do NOT format).
  3. Right click on the drive that holds your DB Transaction Logs.  Select Extend Volume.  This will allow you to add space to this drive so that you can perform the DBCC functions.
  4. At this point ACT QUICK, as your vCD will start logging to the Transaction File and it will fill up quick.
  5. Right click on your DB in the SQL Server Management Studio and select PROPERTIES.  In the popup window select the OPTIONS page.  Change the Recovery Model to SIMPLE, and change the AUTO SHRINK to TRUE.  Click OK.  (These settings are the big reason that you filled up your transaction logs so quick.  Standard practices in our production environment is to have SIMPLE recovery model, with AUTO SHRINK enabled.  Just make sure you have some sort of automatic backup being performed on your DB regularly.ImportantSettings
  6. In the SQL Server Management Studio, run the following query:
    BACKUP DATABASE yourdbnamehere
    TO DISK = 'C:\YourBackupFileName.BAK'
  7. After the backup is run, it will tag the log files as shrinkable because they have been backed up.  Run the following query to shrink the log files (see #8 below):
    DBCC SHRINKFILE ('yourdbfilename_log', 1)

    NOTE: The file name above is your actual Transaction log file name, which is not necessarily your db file name. You can find this name by right click on your DB in the SQL Server Management Studio and select PROPERTIES.  In the popup window select the FILES page.

    The ‘1’ in the command tells SQL to try to shrink it to 1MB.  Do not worry, if it cant be shrunk that low, SQL will simply shrink it as low as it can.

  8.  At this point you will need to restart your vCD cells by running the following command on each cell:
    service vmware-vcd restart
  9.  After the cells are fully restarted, you should be up and running!

 

 

You may also like