Run DB restore and backup at same time?

techresearch7777777 1,766 Reputation points
2021-03-06T00:44:45.983+00:00

Hello, say I have the following scenario:

1 - Perform a long running restore of a large DB (from a backup of another SQL Server as source) with brand new name (this DB doesn't yet exist on target SQL Server) i.e. starts at 9pm takes two hours to complete restore

2 - We have a scheduled nightly SQL Agent DB backup job starts at 10pm on this target server that the long restore is running so both restore and backup processes would overlap

Could this be potentially dangerous and cause DB corruption or any other things I should be concerned/aware of?

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,697 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 100.9K Reputation points MVP
    2021-03-06T10:27:06.947+00:00

    No, the operation as such cannot cause corruption. What could happen is that you overtax the I/O subsystem. But as long as the I/O subsystem is safe and sound it should not go clobbering any disks. However, you may have to accept that both operations are taking longer time than if they had not overlapped.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. CarrinWu-MSFT 6,851 Reputation points
    2021-03-08T05:45:15.143+00:00

    Hi @techresearch7777777 ,

    No, there will not cause corruption. But it will take a long time if you run backup and restore at the same time. Because backup and restore operations are I/O intensive, and backup and restore throughput depends on how well the underlying I/O subsystem is optimized to handle the I/O volume.
    When the backup operation is finished, you can use below T-SQL to verify the backup from disk:

    RESTORE VERIFYONLY FROM DISK = 'D:\AdventureWorks.bak';  
    GO  
    

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Olaf Helper 40,741 Reputation points
    2021-03-08T08:06:44.563+00:00

    See Concurrent Administrative Operations => Backup vs File operations (like restore), they can not run at the same time.

    0 comments No comments

  3. techresearch7777777 1,766 Reputation points
    2021-03-08T20:05:42.157+00:00

    Thanks everyone for the replies, much appreciated.

    0 comments No comments