Skip to content

Latest commit

 

History

History
67 lines (56 loc) · 4.94 KB

sys-dm-database-copies-azure-sql-database.md

File metadata and controls

67 lines (56 loc) · 4.94 KB
titledescriptionauthorms.authorms.datems.servicems.topicf1_keywordshelpviewer_keywordsdev_langsmonikerRange
sys.dm_database_copies (Azure SQL Database)
sys.dm_database_copies (Azure SQL Database)
rwestMSFT
randolphwest
03/30/2022
azure-sql-database
reference
dm_database_copies_TSQL
sys.dm_database_copies
dm_database_copies
sys.dm_database_copies_TSQL
dm_database_copies
sys.dm_database_copies
TSQL
=azuresqldb-current

sys.dm_database_copies (Azure SQL Database)

[!INCLUDEAzure SQL Database]

Returns information about ongoing database copy operations for a database in Azure SQL Database.

To return information about geo-replication links, use the sys.geo_replication_links or sys.dm_geo_replication_link_status views.

Column NameData TypeDescription
database_idintThe ID of the current database in the sys.databases view.
start_datedatetimeoffsetThe UTC time at a regional [!INCLUDEssSDS] datacenter when the database copying was initiated.
modify_datedatetimeoffsetThe UTC time at regional [!INCLUDEssSDS] 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. [!INCLUDEssSDS] 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:

PENDING

SEEDING
maximum_lagintReserved field.
is_continuous_copybit0 = Returns 0
is_target_rolebit0 =Source database

1 = Copy database
is_interlink_connectedbitReserved field.
is_offline_secondarybitReserved field.

Permissions

This view is only available in the master database on the logical server to the server-level principal login.

Remarks

You can use the sys.dm_database_copies view in the master database of the source or target logical server in Azure SQL Database. When the database copy completes successfully and the new database becomes ONLINE, the row in the sys.dm_database_copies view is removed automatically.

Next steps

Learn more about related concepts in the following articles:

close