Shrink Log

  • Hi All,

    we have a database which is getting replicated data from other database.

    Its mdf file size is 100MB and ldf file size is 18GB.

    we are trying to shrink that database by taking the log backups, but we are not able to shrink it.

    When I tried to shrink the log usinf=g truncate_only option, got the beow 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.

    To shrink the log file what should I need to do?

    I have checked the Log reader agent and it is running.

    Thank You.

    Regards,
    Raghavender Chavva

  • Based on the error message, your database is configured as a publisher for replication. It won't let you truncate the log because replication keeps track of log entries and "knows" that they have not yet been pushed to the subscriber, and thus are still needed. Have you checked that replication and the associated jobs are running correctly ?

    You could try running this in the database and see if it shows open transactions: DBCC OPENTRAN

  • homebrew01 (9/6/2010)


    Based on the error message, your database is configured as a publisher for replication. It won't let you truncate the log because replication keeps track of log entries and "knows" that they have not yet been pushed to the subscriber, and thus are still needed. Have you checked that replication and the associated jobs are running correctly ?

    You could try running this in the database and see if it shows open transactions: DBCC OPENTRAN

    its not containing any old transactions and it's not a publisher, it's a subscriber.

    Thank You.

    Regards,
    Raghavender Chavva

  • seems like your replication is out of sync?

    Are you getting any more detail/error in replication monitor or in distribution database using below query:-

    select * from MSrepl_errors order by time desc.

    You can try to configure the subscriber again with proper downtime.

    ----------
    Ashish

  • Raghavender (9/7/2010)


    homebrew01 (9/6/2010)

    its not containing any old transactions and it's not a publisher, it's a subscriber.

    Perhaps it was initially set as a publisher, and the publication was not completely removed ? If you search the message, you will find many results, and perhaps one matches your situation ?

    There are some different things that can be done to remove the publication information. Are you sure it's not meant to be a publisher ?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply