Returns information about operations performed on databases in a Azure SQL Database server.
|ID of the operation. Not null.
|Denotes the type of resource on which the operation is performed. Not null. In the current release, this view tracks operations performed on SQL Database only, and the corresponding integer value is 0.
|Description of the resource type on which the operation is performed. In the current release, this view tracks operations performed on SQL Database only.
|Name of the SQL Database on which the operation is performed. Not null.
|For internal use only. Not null.
|Operation performed on a SQL Database, such as CREATE or ALTER.
|The state of the operation.
0 = Pending
1 = In progress
2 = Completed
3 = Failed
4 = Cancel in progress
5 = Cancelled
|PENDING = operation is waiting for resource or quota availability.
IN_PROGRESS = operation has started and is in progress.
COMPLETED = operation completed successfully.
FAILED = operation failed. See the error_desc column for details.
CANCEL_IN_PROGRESS = operation is in the process of being cancelled.
CANCELLED = operation stopped at the request of the user.
|Percentage of operation that has completed. Valid values are listed below. Not null.
0 = Operation not started
50 = Operation in progress. For restore operations, this will be a value between 1 to 99, indicating how far along the operation is in percent.
100 = Operation complete
|Code indicating the error that occurred during a failed operation. If the value is 0, it indicates that the operation completed successfully.
|Description of the error that occurred during a failed operation.
|Severity level of the error that occurred during a failed operation. For more information about error severities, see Database Engine Error Severities.
|Reserved for future use. Future compatibility is not guaranteed.
|Timestamp when the operation started.
|Timestamp when the record was last modified for a long running operation. When the operation has completed successfully, this field displays the timestamp when the operation completed.
This view is only available in the
master database to the server-level principal login.
To use this view, you must be connected to the
master database. Use the
sys.dm_operation_status view in the
master database of the SQL Database server to track the status of the following operations performed on a SQL Database:
Copy database. Database Copy creates a record in this view on both the source and target servers.
Change the performance level of a service tier
Change the service tier of a database, such as changing from Basic to Standard.
Setting up a Geo-Replication relationship
Terminating a Geo-Replication relationship
The information in this view is retained for approximately 1 hour. You can use the Azure Activity Log to view details of operations in the last 90 days. For retention more than 90 days, consider sending Activity Log entries to a Log Analytics workspace.
Show most recent geo-replication operations associated with database
WHERE major_resource_id = 'mydb'
ORDER BY start_time DESC;