Launch week: the Season Pass & Fundamentals Week are 50% off — ends in 19d 14h 55mSee the sale

Production DBA

How to Restore a SQL Server Database into Azure SQL DB Managed Instances Redux

Anything Brent Can Do

There’s some things you can do with Managed Instances, and some ways you can look at data that you can’t do elsewhere.

For instance, you have the ability to start an restore ASYNC — that means if your session drops, the restore will continue headlessly in the background.

There’s nothing about this equation that requires you to be connected. You’re restoring to a cloud server from cloud storage. You’re a meaty third wheel.

The command looks something like this:

While it’s running, you can sorta-kinda check the status with this new DMV:

I say sorta-kinda because my restore of the Stack Overflow database hit 50% complete immediately… and then sat there.

Back like that

You can see all sorts of stuff in here:

  • Create database commands
  • Drop database commands
  • Restore database commands
  • Their status, including percent complete, success/failure
  • Any errors
  • Start time and last check-in from the process

What I need to look into more is how the session_activity_id ties into other DMVs.

Thanks for reading!

Free, 3× a week

Get my new posts by email

Three posts a week, plus a Monday roundup of the best database news from around the web.

5 comments

  1. I am trying to take a backup of my on prem database to Blob storage , I was able to do it successful couple of times about a month ago but now i am getting an error mentioned below. My database size is 310 GB. I was able to backup smaller database. Urgent. Please help.
    10 percent processed.
    20 percent processed.
    Msg 3202, Level 16, State 1, Line 1
    Write on “https://cloudallybackups.blob.core.windows.net/backup/polencapitaldatawarehouse_backup_2020_12_18_112405.bak” failed: 1117(The request could not be performed because of an I/O device error.)
    Msg 3013, Level 16, State 1, Line 1
    BACKUP DATABASE is terminating abnormally.

    Completion time: 2020-12-18T11:42:55.1618997-05:00

      1. I have a work around. I can take a back up on a disk and upload that back up on storage account. This takes more time. Just sharing issues here if someone might know or have encountered such error before.

Leave a comment

Your email address will not be published. Required fields are marked *