Restore history for databases is not a complete list in msdb - OLA Hallengren

  • I am using OLA Hallengren database backup and maintenance solutions to back up, reindex databases etc

    Occasionally I restore databases to test environment. But when I do a query of restore history FROM [msdb].[dbo].[restorehistory] table, I got fewer records than I expected. I wonder the restore history was deleted by some process.

    I did not setup that. so not sure what process in the Ola Hallengren solutions that did that step.

    I do see a job that is called sp_delete_backuphistory of OLA solutions, but that is for deleting backup history but not restore history.

    Any ideas would be appreciated.

     

    • This topic was modified 1 year, 9 months ago by  sqlfriend.
    • This topic was modified 1 year, 9 months ago by  sqlfriend.
  • Hi,

     

    I guess in procedure sp_delete_backuphistory is also deleting restore history.

    DELETE FROM msdb.dbo.restorehistory

    WHERE restore_history_id IN (SELECT restore_history_id

    FROM @restore_history_id)

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

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