Pages

Saturday, June 11, 2011

Not able to create New Site Collection in Moss 2007- Unknown Error

Issue:

Today I came across a new problem in My Moss 2007 enviornment.
When I tried to create a site collection under a Web application I received following error..

"A runtime exception was detected. Details follow. Message: The transaction log for database 'XX_DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases.

Reason:

When I looked deep in to the issue and checked the SQL logs I found that in the SQL error logs too.. there were N number of errors saying "The transaction log for database 'SharePoint_Config' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases"

When checked the siae of LDF file of Transaction database it was more than 5 GB in comparision to 600 MB of MDF file.

So, when Transation Log file of any data base becomes full , it does not allow to perform any operation on database. And so was the case with the Sharepoint_config database , It was not allowing to perform any action on it until the LDF files is made with some free space.

It did not allow to back up the database as well as backup also requires to write some transactions in Transaction log and it was already full.

Resolution:

I performed following steps to decrease the size of  Transaction log of sharepoint_config database:

1. To be on sager side took backup of Transation log with following SQL Query:
   
   BACKUP LOG Sharepoint_Config TO DISK='D:\SP Backup\SPconfigLogBackup.bak'
   GO

 
2. Now Shrank the Transaction log file to create space on disk and make the space in Transation log file as
    well with following SQL Query

 USE SharePoint_Config
 BACKUP LOG Sharepoint_Config WITH TRUNCATE_ONLY
 DBCC SHRINKFILE (N'SharePoint_Config_log' , 200)
 GO


After issuing these two Queries, I found that the size of LDF file of sharepoint_Confing database was reduced to 200 MB and I could take the backup of database too.

Once the transation log file was emptied, I was able to create the site collection again.

Hope this will help you guys...