Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Azure Database Copy status

Copying a database in the Azure Portal is never ending.

Usually, when I copy a 250GB database, it completes in just under an hour.

Today, when I copy, it never seems to finish, it has been over two to three hours now.

copy database progress

And in the server activity logs, the last entry just says an update occured

enter image description here

Any idea on how to see more progress, percent complete, or any other way to see what might be locking it? Nothing of use can be seen in the activty log json.

like image 988
Stefan Zvonar Avatar asked Jan 04 '23 04:01

Stefan Zvonar


1 Answers

You can use SYS.DM_OPERATION_STATUS to track many operations including copy in SQLAZURE..

Documentation states

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:

Below are the operattions that can be tracked

  • 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

You can also try sys.dm_database_copies in master database for info about copy status ..This has percent_complete field and below is what documentation has to say about this

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.

Note:
This view has info only during the duration of copy operation..

like image 149
TheGameiswar Avatar answered Jan 18 '23 18:01

TheGameiswar