SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Transaction Log Growing due to Pending Transaction (Replication)


Transaction Log Growing due to Pending Transaction (Replication)

Author
Message
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
SQL Server 2005 SP4 with Transactional replication.

I have this Database Log, which keeps growing due to a Pending transaction in the Database Log. (DB in SIMPLE recovery Mode)

If i issue a DBCC OPENTRAN i get :

Replicated Transaction Information:
Oldest distributed LSN : (0:0:0)
Oldest non-distributed LSN : (47839439:351:1)

The following Query using fn_dblog gives me LSN and Transaction ID Info.
select * from::fn_dblog(NULL,'47839439:351:1')

If i have to Shrink the Log i have to use sp_repldone to mark the transactions as replicated or skipped.

I take precautions in running this statement as this is not always what you want to do manually as it is internally done by the Log Reader Agent.

EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset=1

Now.. What if i Just want to mark just the transaction in question as done.. using the @xactid

How can i translate the CurrentLSN or TransactionID or LogRecord or Transaction SID or any other vlue to--> @xactid.....

Maninder
www.dbanation.com
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
Anyone..

Maninder
www.dbanation.com
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85450 Visits: 41080
MannySingh (4/8/2013)
Anyone..


Are you doing transaction log backups?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Neeraj Dwivedi
Neeraj Dwivedi
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1099 Visits: 1334
Check this url.. it may help.

http://blogs.msdn.com/b/repltalk/archive/2011/08/23/using-sp-repldone-to-skip-a-transaction.aspx
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
Jeff Moden (4/8/2013)
MannySingh (4/8/2013)
Anyone..


Are you doing transaction log backups?

if you check my question.. i have already mentioned the DB is in simple recovery mode, so Log backups are out of question..

Maninder
www.dbanation.com
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
dwivedi.neeraj (4/9/2013)
Check this url.. it may help.

http://blogs.msdn.com/b/repltalk/archive/2011/08/23/using-sp-repldone-to-skip-a-transaction.aspx


If you check my question.. I know about that command.. i am curious to now if the column values as mentioned can be converted to anything meaningful.

Maninder
www.dbanation.com
Neeraj Dwivedi
Neeraj Dwivedi
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1099 Visits: 1334
Anything meaningful?

I though you are looking for something to "What if i Just want to mark just the transaction in question as done.. using the @xactid ", and the url which I mentioned mentions that if you have transaction id info, you can get xdesid for there.

Also use sp_repltrans to get xdesid & xact_seqno and match the xdesid from fn_dblog results.
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
yes i had gone through all of those blogs, but unfortunately none of those work.. the DBCC OPENTRAN is still showing the same info.
Does a SQL Service restart Help in this case?

Maninder
www.dbanation.com
Neeraj Dwivedi
Neeraj Dwivedi
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1099 Visits: 1334
As you have mentioned that the recovery model is simple, so I believe yes. But I have never done that. But I have used sp_repldone and worked as expected. But before that I checked if the Log growth was really being caused by replication by running following command..

select log_reuse_wait,log_reuse_wait_desc from sys.databases

If there is something for replication then sp_repldone solves the issue.

Sorry I was not much help.
MannySingh
MannySingh
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 787
Yes it is the replication that is the issue.
even if i run sp_repldone, another transaction comes back, but i am not able to figure out any meaningful information from the fn_dblog like the AllocationUnit etc as they are all NULL... Or i cannot translate the LogRecord or Transaction SID to something meaningful.

Maninder
www.dbanation.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search