'Azure point in time restore - Query for checking progress
Is there a way to check the progress percent of azure point in time restored databases?
I started a restore of a 750 Gb database, and i do not know whether it has started the restore and the progress percent.
I checked in almost all the system views, but cant find any view that would help me.
Attaching screen shot of how i started the SQL Restore.
Solution 1:[1]
At this time, a detailed restore progress is not available on the portal. You can vote for this feature here and it may be considered for future implementation by Azure SQL Database team.
However you can run the following query on the Master database of the Azure SQL Database server to track the progress of a restore.
SELECT major_resource_id, percent_complete
FROM sys.dm_operation_status
WHERE operation LIKE '%DATABASE RESTORE%'
Solution 2:[2]
As of March 30th 2022 the column percent_column
in sys.dm_operation_status DMV has been enhanced to display the progress of Database Restore operation at a more granular level. percent_complete column in sys.dm_operation_status DMV will now show percent progress as a continuous value from 0 to 99 instead of 50 earlier.
Run the query below against the master
Azure database. Run SELECT * FROM sys.time_zone_info;
to find your timezone name and use it in the second AT TIME ZONE
if you care about seeing date and times in your local timezone.
SELECT
DatabaseName = major_resource_id
,RestoreState = state_desc
,PercentComplete = percent_complete
,StartTime = start_time AT TIME ZONE 'UTC' AT TIME ZONE 'Central Standard Time'
,LastModifyTime = last_modify_time AT TIME ZONE 'UTC' AT TIME ZONE 'Central Standard Time'
,ErrorCode = error_code
,ErrorDescription = error_desc
,ErrorSeverity = error_severity
,ErrorState = error_state
FROM
sys.dm_operation_status
WHERE
operation = N'DATABASE RESTORE'
ORDER BY
start_time DESC;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Kevin Martin Tech |