Solved

Large Transaction Log will not shrink

Posted on 2008-10-23
10
535 Views
Last Modified: 2008-11-01
Our database transaction log has grown from 500MB to 9Gb very quickly and we are now running out of disk space.

We have tried Backup Log with Truncate_only
also DBCC shrinkfile (log_file_name,1000)

We read about a method of solving this by detaching the database however this database is a publisher in merge replication and we get an error message back.

We have set the recovery model from Full to Simple with no joy.

We have tried stopping the SQL Server and renaming the Log file with no success.

We have tried restarting the Server with no success.

We are using SQL 2005 SP2 on a dell quad core 8Gb Ram server using Windows 2003 OS.

DBCC OPENTRAN returns message
Transaction information for database databasename.

Replicated Transaction Information:
        Oldest distributed LSN     : (0:0:0)
        Oldest non-distributed LSN : (1298820:6778:1)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

...indicating uncommitted replication transactions I believe.
0
Comment
Question by:daletrotman
  • 5
  • 3
  • 2
10 Comments
 
LVL 32

Expert Comment

by:Daniel Wilson
Comment Utility
If setting the recovery mode to simple is acceptable, do a Backup Log with Truncate_only and a shrink after changing the recovery mode.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
the backup log will not be effective, as there IS some transaction open.
try to locate some "old" session, and kill it eventually (at least, make sure it commits/rolls back any open transaction.
0
 

Author Comment

by:daletrotman
Comment Utility
Daniel: I have tried these suggestions (as detailed in the post). As Angelll has noted these will not work.

Angel: There is no "old" session to kill unfortunately.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>Angel: There is no "old" session to kill unfortunately.
Indeed, the transaction is a transaction waiting to be replicated.

so, you will have to either repair or kill the replication on that database
0
 

Author Comment

by:daletrotman
Comment Utility
sp_replcmds results...
database:    databasename-v6-01      
replicated transactions:     2  
replication rate trans/sec:     0  
replication latency (sec):     263220.2  
replbeginlsn:    0x0013D18400001A7A0001            
replnextlsn:      0x0013D18400001AA80001

the latentcy equals about 72+ hours which is approximately when our troubles started.

Any suggestions on how to repair the merge/snapshot replication on the database?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
start by checking if the replication jobs are running (sql server agent jobs)
0
 

Author Comment

by:daletrotman
Comment Utility
AngelIII: We have no problem with any of the replication jobs, publications or subscriptions. Everything is as it should be.
0
 

Accepted Solution

by:
daletrotman earned 0 total points
Comment Utility
This problem has now been solved.
Our replication publisher was publishing to 2 separate subscription servers, a LIVE server and a backup/test server. After removing the subscriptions to the backup/test server the open/uncommitted tranactions were released/deleted. Using dbcc opentran then showed us "No open transactions". The dbcc shrinkfile command then worked successfully.

Case closed. On to new problems..!!
0
 
LVL 32

Expert Comment

by:Daniel Wilson
Comment Utility
Sounds to me like AngelIII's http:22794868 was the solution.
0
 

Author Comment

by:daletrotman
Comment Utility
Daniel: Fortunately we did not need to kill replication from either subscriber or the publisher. Simply remove the subscriptions from one of the subscribers. Replication remained intact throughout the process.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now