In some situation, the transaction log grow too big until the harddisk space become unavailable and backup cannot be performed to truncate the log immediately.
How to truncate and shrink the transaction log manually?
Run the below 2 SQL query:
===============================
use databasename
DBCC LOGINFO('databasename')
go
DBCC LOGINFO('databasename')
go
==============================
Note down the fileID
==========================
Use databasename
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
Backup LOG databasename WITH TRUNCATE_ONLY
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
GO
========================================
==========================
Use databasename
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
Backup LOG databasename WITH TRUNCATE_ONLY
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
GO
========================================
Please perform full database backup immediately after the above SQL statement.
1 comment:
work till short jor....
Post a Comment