Truncate MSDB log shipping tables?

  • Hi,

    I have a couple of servers in a log shipping solution that were reporting errors for databases that no longer exist, even though all of the related jobs were deleted at source and destination. My boss asked me to take everything out of log shipping and set up a regular full local backup of databases which are then copied to the destination server where they sit awaiting manual restore should the worst happen.

    My Boss's Boss has since discovered the current situation and he is less than happy and I'm stuck between the two! I have to re-instate LS AND get rid of the errors. The trouble is that if I set up one database to LS the old errors re-appear and spam the world with alerts.

    Is it advisable to truncate all of the tables relating to LS in the MSDB to start with a clean sheet? Obviously MSDB would be backed up first.

    A.

  • what steps are you taking to prune history?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I have a maintenance plan that deletes backup histories

  • Adrian Smith-294236 (9/1/2011)


    I have a maintenance plan that deletes backup histories

    That wont cleanup the LS agent histories. The following stored procedure is used to cleanup agent history based on the retention period

    sp_cleanup_log_shipping_history

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks for this - it worked to an extent; however I still have lots of histories with agentIds that don't exist in the primary/secondary tables

  • have you tried clearing them anyway

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I'm tempted but I wanted confirmation that I won't be causing any irreparable damage before I do it - hence the original question. I know; I'm a wuss! 🙂

  • if the agents don't exist they must have been removed. I personally would attempt to clean them up using the stored procedure.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Many thanks Perry - I got brave & trashed the lot and I'm in the process of setting up LS for > 40 databases now - seems OK so far.

Viewing 9 posts - 1 through 8 (of 8 total)

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