Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL SERVER Transaction log full

How to free Transaction log space in SQL SERVER 2005:

I have Transaction log size = 70 GB and there four transaction logs 1,2,3,4 in different drives. Through DBCC SQLPERF(LOGSPACE) I found that the transaction log is Full (uses 100 %) and I want to free up the space in transaction log and I don't want T-log backup. I don't have space to backup the transaction log. And my DB is in Replication state.

  1. How can I free up the Transaction log or
  2. Instead of 3 transaction log files, can I have only one log file or
  3. If shrink method what to do with Replication?
like image 669
Dhiva Avatar asked Dec 17 '25 01:12

Dhiva


1 Answers

Perform the following sequence of statements:

BACKUP LOG <db_name> WITH TRUNCATE_ONLY  
--or save to log to other drives on disk if required
GO

CHECKPOINT
GO

--replace 2 with your actual log file number.
DBCC SHRINKFILE (2, 100)     

If the log does not shrink then check the reason of log file growth. More information about this can be found here:

http://sqlreality.com/blog/ms-sql-server-2008/troubleshooting-the-full-transaction-log-problem/

like image 50
subhash Avatar answered Dec 19 '25 17:12

subhash