sys.dm_database_copies (Azure SQL Database)


Updated: June 10, 2016

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

Returns information about the database copy.

To return information about geo-replication links, use the sys.geo_replication_links or sys.dm_geo_replication_link_status views (available in SQL Database V12).

Column NameData TypeDescription
database_idintThe ID of the current database in the sys.databases view.
start_datedatetimeoffsetThe UTC time at a regional SQL Database datacenter when the database copying was initiated.
modify_datedatetimeoffsetThe 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 1 minute.

UTC time reflecting the last update of the percent_complete field.
percent_completerealThe 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.
error_codeintWhen greater than 0, the code indicating the error that has occurred while copying. Value equals 0 if no errors have occurred.
error_descnvarchar(4096)Description of the error that occurred while copying.
error_severityintReturns 16 if the database copy failed.
error_stateintReturns 1 if copy failed.
copy_guiduniqueidentifierUnique ID of the copy operation.
partner_serversysnameName of the SQL Database server where the copy is created.
partner_databasesysnameName of the database copy on the partner server.
replication_statetinyintThe state of continuous-copy replication for this database. Values are:

0=Pending. Creation of the database copy is scheduled but the necessary preparation steps are not yet completed or are temporarily blocked by the seeding quota.

1=Seeding. The copy database being seeded is not yet fully synchronized with the source database. In this state you cannot connect to the copy. To cancel the seeding operation in progress, the copy database must be dropped.
replication_state_descnvarchar(256)Description of replication_state, one of:


maximum_lagintReserved field.
is_continuous_copybit0 = Returns 0
is_target_rolebit0 =Source database

1 = Copy database
is_interlink_connectedbitReserved field.
is_offline_secondarybitReserved field.

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.

Community Additions