Scale Azure SQL database error - cannot scale down, stuck at 1% then timeout

Trystan Wilcock 0 Reputation points
2023-04-05T13:30:07.8533333+00:00

I have an Azure database that is using 25MB. Its max storage is 10GB. I am trying to reduce this to 1GB but the operation keeps failing. It is a Serverless General Purpose vCore database. Under Notifications it always comes up as an ongoing operation but is always stuck at 1%. The error message is the following: Scale database error Failed to scale from General Purpose - Serverless: Standard-series (Gen5), 1 vCore, 10 GB storage, zone redundant disabled to General Purpose - Serverless: Standard-series (Gen5), 1 vCore, 1 GB storage, zone redundant disabled for database: sqldb-locumpro-staging-001. Error code: . Error message: The operation timed out and automatically rolled back. Please retry the operation.

Azure SQL Database
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Morillo 33,426 Reputation points MVP
    2023-04-05T14:37:49.1733333+00:00

    Try to shrink the database before scaling down.

    
    DBCC SHRINKDATABASE (N'db1')
    DBCC SHRINKFILE (log, 0)
    

    If you have reduced the size already, try to move it to another region or subscription and then move it back to the original.


  2. Rahul Randive 9,176 Reputation points Microsoft Employee
    2023-04-06T00:49:59.6166667+00:00

    Thanks for your question. I found a community document that has details about the error "Scale database error Failed to scale from General Purpose - Serverless" you mentioned. Could you please have a look to see if your database has any of the mentioned features. https://techcommunity.microsoft.com/t5/azure-database-support-blog/learning-from-expertise-8-why-cannot-move-sql-database-from/ba-p/3054270 Thank you!

    0 comments No comments

  3. Oury Ba-MSFT 18,021 Reputation points Microsoft Employee
    2023-04-07T20:21:44.8533333+00:00

    @Trystan Wilcock Same situation could happen with any database in SQL DB. It’s possible that the underlying file size grew (which occurs automatically) due to data growth, and then data got deleted, but the file size didn’t shrink (which doesn’t occur automatically).  In this situation, the larger file size can conflict with the lower max database size and prevent reducing the database max size. This article describes how to assess and reduce file size to unblock decreasing the data max size: Azure SQL Database file space management - Azure SQL Database | Microsoft Learn If that does not help. I would suggest to kindly open a support ticket so we can further investigate and troubleshoot. Please comment below and let me know the result. We will be more than happy to assit you further. Regards, Oury