sys.dm_database_copies (Azure SQL Database)
Applies To: SQL Server 2014, SQL Server 2016 Preview
Returns information about the database copy.
Applies to: Azure SQL Database, Azure SQL Data Warehouse Public Preview.
Columns that are particularly relevant for Geo-Replication: database_id, start_date, modify_date, percentage_complete, partner_server, partner_database, replication_state, replication_state_desc, maximum_lag, is_continuous_copy, is_target_role, is_interlink_connected.
The ID of the current database in the sys.databases view.
The UTC time at a regional SQL Database datacenter when the database copying was initiated.
The UTC time at regional SQL Database datacenter when the database copying has completed. The new database is transactionally consistent with the primary database as of this time. The completion information is updated every 5 minutes.
The percentage of bytes that have been copied. Values range from 0 to 100. SQL Database may automatically recover from some errors, such as failover, and restart the database copy. In this case, percent_complete would restart from 0.
When greater than 0, the code indicating the error that has occurred while copying. Value equals 0 if no errors have occurred.
Description of the error that occurred while copying.
Returns 16 if the database copy failed.
Returns 1 if copy failed.
Unique ID of the copy.
Name of the linked SQL Database server.
Name of the linked database on the linked SQL Database server.
The state of continuous-copy replication for this database, one of:
Description of replication_state, one of:
The maximum_lag column returns a value of -1 indicating that the maximum lag value is not set. The value for this column cannot be set or changed
0 = This is a Database Copy operation, not a continuous copy relationship.
1= This is a continuous copy relationship.
0 =Source/Primary database
1 = Target/Secondary database
0 = Disconnected. The continuous copy interlink is disconnected.
1 = Connected. The continuous copy interlink is connected.
0 = Active Geo-Replication relationship
1 = Standard Geo-Replication relationship
This view is only available in the master database to the server-level principal login.
You can use the sys.dm_database_copies view in the master database of the source or target SQL Database server. When the database copy completes successfully and the new database becomes ONLINE, the row in the sys.dm_database_copies view is removed automatically.