29 December 2013

FIX Transaction Log Full Error 9002‏

We have to find out full transaction log of any database depends on what condition caused the log to fill entire drive.
Here is the script for releasing transactional log from the database

STEP-1
Run the below script for finding logical name of your log file 
EXEC SP_Helpdb 'XXX'
GO 

STEP- 2
USE XXX
GO
CHECKPOINT
GO
BACKUP LOG XXX WITH TRUNCATE_ONLY
GO
dbcc shrinkfile ('XXX_log',TRUNCATEONLY)
go
dbcc SHRINKFILE (XXX_log, 1)
GO

Change your database name with XXX and logical name of your database log file with XXX_log.

No comments:

Post a Comment