sys.dm_operation_status (Azure SQL Database)

 

Updated: June 10, 2016

THIS TOPIC APPLIES TO: noSQL Server yesAzure SQL DatabaseyesAzure SQL Data Warehouse noParallel Data Warehouse

Returns information about operations performed on databases in a Azure SQL Database server.

Column NameData TypeDescription
session_activity_iduniqueidentifierID of the operation. Not null.
resource_typeintDenotes 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.
resource_type_descnvarchar(2048)Description of the resource type on which the operation is performed. In the current release, this view tracks operations performed on SQL Database only.
major_resource_idsql_variantName of the SQL Database on which the operation is performed. Not Null.
minor_resource_idsql_variantFor internal use only. Not null.
operationnvarchar(60)Operation performed on a SQL Database, such as CREATE or ALTER.
statetinyintThe state of the operation.

0 = Pending
1 = In progress
2 = Completed
3 = Failed
4 = Cancelled
state_descnvarchar(120)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.

CANCELLED = operation stopped at the request of the user.
percent_completeintPercentage of operation that has completed. Values range from 0 to 100. Not null.
error_codeintCode indicating the error that occurred during a failed operation. If the value is 0, it indicates that the operation completed successfully.
error_descnvarchar(2048)Description of the error that occurred during a failed operation.
error_severityintSeverity level of the error that occurred during a failed operation. For more information about error severities, see Database Engine Error Severities.
error_stateintReserved for future use. Future compatibility is not guaranteed.
start_timedatetimeTimestamp when the operation started.
last_modify_timedatetimeTimestamp when the record was last modified for a long running operation. In case of successfully completed operations, 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:

  • Create database

  • Copy database. Database Copy creates a record in this view on both the source and target servers.

  • Alter database

  • 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

  • Restore database

  • Delete database

Show most recent geo-replication operations associated with database ‘mydb’.

SELECT * FROM sys.dm_ operation_status   
   WHERE major_resource_id = ‘myddb’   
   ORDER BY start_time DESC;  

Geo-Replication Dynamic Management Views and Functions (Azure SQL Database)
sys.dm_geo_replication_link_status (Azure SQL Database)
sys.geo_replication_links (Azure SQL Database)
ALTER DATABASE (Azure SQL Database)

Community Additions

ADD
Show: