Restore Scripts

  • Hi,

    I'm looking for a script that will tell me who did the restore and how long it took. I've got a script which gives me file details but not what I'm looking for.

    Thanks

  • TST1 (7/4/2011)


    Hi,

    I'm looking for a script that will tell me who did the restore and how long it took. I've got a script which gives me file details but not what I'm looking for.

    Thanks

    This should get you started

    SELECTrestore_date AS DateRestored

    , destination_database_name AS DBNameRestored

    , user_name AS Culprit

    , Restore_Type

    , CASE replace

    WHEN 1 THEN 'Replaced'

    WHEN 0 THEN 'NotReplaced'

    END AS Replaced

    , CASE recovery

    WHEN 1 THEN 'Recovered'

    WHEN 0 THEN 'NotRecovered'

    END AS Recovered

    from msdb..restorehistory

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

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

  • Thanks, exactly what I wanted.

  • you're welcome!

    I'm not entirely sure it's possible to find how long the restore took, if i find it I'll let you know

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

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

Viewing 4 posts - 1 through 3 (of 3 total)

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