Wednesday 21 March 2012

MS SQL 2012 - How to Fix Error ERROR 9002 LOG FILE IS FULL




Run
DBCC SQLPERF( LOGSPACE ) 
to view the size of each database log








Next run the following statement to check the name of the log file (ensure that proper database is selected, in my case I want to check the size of the log file of the School database, therefore I selected School Database)
Select * FROM Sys.Database_files


You can see that log file name is School_log.
Now run the following statement to shrink the log file
DBCC SHRINKFILE(School_log, 1)

To check the size of the log file after shrinkage run again the following statement
DBCC SQLPERF( LOGSPACE ) 


No comments:

Post a Comment