July 17, 2007 at 2:11 am
From what I've read sp_repldone kills off all the publications/subscriptions so it's kind of an emergency measure. May come to this anyway as the logfile is growing at a rate of knots.
When I've fixed the problem I will post the resuults on here.
Thanks to all who responded.
Dave
July 18, 2007 at 2:19 pm
You can try:
sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1
That's what I've done, but to solve a slightly differnt problem. I wonder why you have the problem to start with ?? Once it's resolved, I would think you should be able to do normal scheduled shrinks of the log file without jumping through these hoops.
July 19, 2007 at 5:36 am
What does it do if you only drop the subscribers and don't touch the publications? My understanding is that log file truncations are held up when subscribers have not received their updates and not the fact that you may even have old transactional publications defined.
August 4, 2011 at 4:16 pm
Here is the solution/script I used to solve this problem:
-- When you cannot trunctate the log on a database that was involved in replication and was
-- restored to another server where it is not necessary for it to be in a replication environment
-- such as in a DEV or QA environment.
-- The key to this is setting the parameters to ignore the Distributor
-- because the Distributor is not setup on this server
exec sp_replicationdboption 'SafariStaging_Baseline','publish',true, @ignore_distributor = 1
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1
EXEC sp_replicationdboption 'SafariStaging_Baseline','publish',false, @ignore_distributor = 1
-- run to verify no pending transactions need replicated
dbcc opentran
-- truncate the txn log
backup log SafariStaging_Baseline with truncate_only
-- shrink the log if necessary
use <Database you are shrinking the log on>
GO
dbcc shrinkfile('Log file logical name', #) -- # size in MB you want the log to be sized to
August 4, 2011 at 4:32 pm
Please note: 4 year old thread.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply