azure-sql-database

Copy Database - Performance


We need to create a new copy of a database on a different server using the PowerShell command "New-AzSqlDatabaseCopy".

Will running this command impact the performance of the live database, especially if other jobs or queries are running simultaneously?

If there are potential performance issues, is there a way to set a timeout for the copy process? Specifically, can we cancel the copy job if it exceeds a certain time limit?


Solution

  • Yes, it has an impact on the transaction log processing and can leave the transaction log full as explained here, because the copy operation holds a lock on the transaction log of the database bien copied. Thus, it affects the performance of all logged operations and throughput on the database.

    It is recommended that you perform an point-in-time restore instead. If you still want to proceed with the copy operation, you can consider performing the copy operation during off-peak hours or scaling up the database temporarily only for the duration of the copy operation.

    The database copy is an asynchronous operation but the target database is created immediately after the request is accepted. If you need to cancel the copy operation while still in progress, drop the target database using the Remove-AzSqlDatabase cmdlet.