RESTORE VERIFYONLY

  • Hello,

    Can you explain me if I can run RESTORE VERIFYONLY together with maintenance plan that makes a backup (to have backup verified just after is created) and how I can implement that?

  • You could schedule a job to run after the maintenance plan (or add a step) that runs this for a backup and then parse the results.

    The maintenance plan should have a "verify" checkbox for the backup task. Look at that.

  • I know there there is "verify" checkbox, but how do I know that this is doing the same thing like RESTORE VERIFYONLY ?

    And how will I know that "verify" in maintenance plan, failed?

  • if you tick "verify backup integrity" it performs this:

    BACKUP DATABASE [admin] TO [adminFull] WITH NOFORMAT, NOINIT, NAME = N'admin_backup_20080312141909', SKIP, REWIND, NOUNLOAD, STATS = 10

    GO

    declare @backupSetId as int

    select @backupSetId = position from msdb..backupset where database_name=N'admin' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'admin' )

    if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''admin'' not found.', 16, 1) end

    RESTORE VERIFYONLY FROM [adminFull] WITH FILE = @backupSetId, NOUNLOAD, NOREWIND

    So that is what you should do. :w00t:

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • k.przewozniak (3/12/2008)


    I know there there is "verify" checkbox, but how do I know that this is doing the same thing like RESTORE VERIFYONLY ?

    And how will I know that "verify" in maintenance plan, failed?

    If you build the MP, you can script the sql for it in SSMS

    (see attached jpg)

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Thank you ALZDBA 🙂

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

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