Restore Information SQL DB

  • One of the User have started a Restoration of DB & left home..

    When we check we see that the DB is in restoring state..

    can any query help to identify how much percent is complete or how much percent left for complete restoration

    ************************************
    Every Dog has a Tail !!!!! :-D

  • SELECT

    convert(NVARCHAR(60), db_name(database_id)) AS [database]

    ,CASE command

    WHEN 'BACKUP DATABASE'

    THEN 'DB'

    WHEN 'RESTORE DATABASE'

    THEN 'RESTORE'

    ELSE 'LOG BACKUP'

    END AS [type]

    ,command

    ,start_time AS [started]

    ,dateadd(mi, estimated_completion_time / 60000, getdate()) AS [finishing]

    ,datediff(mi, start_time, (dateadd(mi, estimated_completion_time / 60000, getdate()))) - wait_time / 60000 AS [mins left]

    ,datediff(mi, start_time, (dateadd(mi, estimated_completion_time / 60000, getdate()))) AS [total wait mins (est)]

    ,convert(VARCHAR(5), cast((percent_complete) AS DECIMAL(4, 1))) AS [% complete]

    ,getdate() AS [current time]

    FROM

    sys.dm_exec_requests

    WHERE

    command IN (

    'BACKUP DATABASE'

    ,'BACKUP LOG'

    ,'RESTORE DATABASE'

    )

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Thank you hansi..

    Please check my new post.. need some more scripts on urgent basis... if u can help 🙂

    ************************************
    Every Dog has a Tail !!!!! :-D

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

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