Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Can not truncate log

Author  Topic 

sc415191
Starting Member

4 Posts

Posted - 2005-12-22 : 20:23:39
1. my database can not truncate log by using below command:
BACKUP LOG MyDataBase WITH NO_LOG
and after that I received result as below
->The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.

but I already disable all replicate why it's still print error message
->The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.

anyone can help?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-12-22 : 20:24:30
So did you run sp_repldone? You said you disabled replication, but that's not the same thing as running that system stored procedure.

Tara Kizer
aka tduggan
Go to Top of Page

sc415191
Starting Member

4 Posts

Posted - 2005-12-23 : 04:21:50
Yes I already run
->EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1
but still can not truncate T_T
Go to Top of Page

shamatirmal
Starting Member

1 Post

Posted - 2006-01-31 : 16:27:17
follow below:
1.Published the database in Transactional Replication

2.Issued the following command:
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1

3Truncate the log using the following command:
BACKUP LOG DatabaseName WITH truncate_only

4.Dropping the publication

and run shrink to get the free space

cheers



Go to Top of Page

tbones
Starting Member

2 Posts

Posted - 2006-02-07 : 11:29:23
I have a similar issue.

We have replication enabled.
On a nightly basis, we do:
Step 1
BACKUP DATABASE [XXX_portal] TO [XXX_Portal] WITH INIT , NOUNLOAD , NAME = N'xxx_portal backup', NOSKIP , STATS = 10, NOFORMAT

Step 2
backup log [xxx_portal] with truncate_only

Also, I do differentials to the xxx_portal backup every few hours.

I get the message:

Executed as user: space_balls\Yogurt. The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed. [SQLSTATE 01000] (Message 4215). The step succeeded.

Should I:
1) Allow the DB to be plublished
2) run 'EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1'
after the backup?

I can delay step two (Above) if necessary.
What impact will this have on the DB? Can I do this during the day? the log file is about 10 gig.

Thank you.



Go to Top of Page
   

- Advertisement -