Export (0) Print
Expand All

sys.dm_database_copies (Windows Azure SQL Database)

SQL Server 2014

Returns information about the database copy.

Applies to: Azure SQL Database.

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

Column Name

Data Type

Description

database_id

int

The ID of the current database in the sys.databases view.

start_date

datetimeoffset

The UTC time at a regional SQL Database datacenter when the database copying was initiated.

modify_date

datetimeoffset

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.

Note Note

On a Geo-Replication primary database, modify_date is the UTC time at which the database is transactionally consistent. On a continuous-copy replica database, after seeding completes, this value is the timestamp of the last applied replication operation.

percent_complete

real

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.

error_code

int

When greater than 0, the code indicating the error that has occurred while copying. Value equals 0 if no errors have occurred.

error_desc

nvarchar(4096)

Description of the error that occurred while copying.

error_severity

int

Returns 16 if the database copy failed.

error_state

int

Returns 1 if copy failed.

copy_guid

uniqueidentifier

Unique ID of the copy.

partner_server

sysname

Name of the linked SQL Database server.

partner_database

sysname

Name of the linked database on the linked SQL Database server.

replication_state

tinyint

The state of continuous-copy replication for this database, one of:

Value

Description

0

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

1

Seeding. The replication target is being seeded and is in a transactionally inconsistent state. Until seeding completes, you cannot connect to the active secondary database and planned termination is disallowed. The only way to cancel the seeding operation is invoking a forced termination on the primary database.

2

Catching up. The active secondary database is currently catching up to the primary database and is in a transactionally consistent state.

4

Terminated. The replication relationship has been terminated..

replication_state_desc

nvarchar(256)

Description of replication_state, one of:

PENDING

SEEDING

CATCH_UP

TERMINATED

maximum_lag

int

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

is_continuous_copy

bit

0 = This is a Database Copy operation, not a continuous copy relationship.

1= This is a continuous copy relationship.

is_target_role

bit

0 =Source/Primary database

1 = Target/Secondary database

is_interlink_connected

bit

0 = Disconnected. The continuous copy interlink is disconnected.

1 = Connected. The continuous copy interlink is connected.

is_offline_secondary

bit

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.

Community Additions

ADD
Show:
© 2014 Microsoft