This morning I received an email stating my website was not working. I'm getting an error when ever I try to write to my database. The Error is:
The database [NAME] has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions.
My database is only 16MB with a 2GB limit! I ran this query on the database after doing some research.
SELECT DATABASEPROPERTYEX ('DatabaseName','Edition')
SELECT DATABASEPROPERTYEX('DatabaseName','MaxSizeInBytes')
SELECT (SUM(reserved_page_count) * 8192)
FROM sys.dm_db_partition_stats
Results were
Basic
2147483648
15777792
Obviously my database is much smaller than the max size. Is there any other problem that may cause this to happen?
I am going to try to delete and restore the database in the mean time.
Thanks!
UPDATE
Once I restored the database, it started working again.
3条答案
按热度按时间tvokkenx1#
Just encountered similar problem (same exception message) with Azure DB last night - we have a 50 GB quota for elastic DB pool in Azure and total size of pool DB's is around 4 GB now. So i was expecting that all databases can grow as long as they reach total pool quota.
Turns out though that Azure actually handles quotas not based on what you have set in service plan for DB or elastic pool, but based on the quota property stored in DB instead: https://blogs.msdn.microsoft.com/sqlcat/2016/09/13/real-world-azure-sql-db-unexpected-database-maximum-size-limit/
Specifically, when a database with a size quota explicitly lowered from the default is scaled up to a higher service objective, its size quota remains unchanged. For an administrator expecting the maximum size quota for the new service objective to be in effect after the scaling operation completes, this may be an unpleasant surprise.
vltsax252#
Is it sql db V12? If SQLDB v12, you can query sys.database_files to see the actual size of the database files. I would suggest upgrading to V12 as it brings lot of features that aren't there in earlier version of SQL offering.
pdkcd3nj3#
I encountered a similar issue while importing a database from Azure storage into an Azure SQL server instance. While importing from Azure please make sure to set the below configuration based on your db size. Hope this helps someone.