Azure SQL 数据库抛出错误 1132“弹性池已达到其存储限制”错误,即使它未满

Dav*_*tto 3 sql-server t-sql azure-sql-database

我正在尝试在弹性池内的 Azure SQL 数据库中执行以下(示例)批处理:

drop table if exists [dbo].[InsertTest];
create table [dbo].[InsertTest] (
    [id] uniqueidentifier,
    [filler] nvarchar(max)
);

insert into [dbo].[InsertTest] ([id], [filler])
select top 1000 newid(), replicate('X', 2048)
from [sys].[objects] as [T1]
    cross join [sys].[objects] as [T2];

/* drop table if exists [dbo].[InsertTest]; */
Run Code Online (Sandbox Code Playgroud)

但该insert语句失败并显示错误消息:

Msg 1132, Level 16, State 1, Line 1
The elastic pool has reached its storage limit. The storage used for the elastic pool cannot exceed (51200) MBs.
Run Code Online (Sandbox Code Playgroud)

我试图通过运行查询来查看空间是否不足

select
    [type_desc]         as [file_type],
    [size] / 128        as [size_in_MB],
    [max_size] / 128    as [max_size_in_MB]
from [sys].[database_files];
Run Code Online (Sandbox Code Playgroud)

但似乎我还有空间。

文件类型 大小_in_MB max_size_in_MB
320 256000
日志 584 1048576
文件流 0 0

我该怎么办?我错过了什么吗?

Ste*_*o64 5

错误消息指的是弹性池,因此问题可能与当前数据库以外的另一个数据库有关。您可以使用以下 DMV 查询与 Master 数据库检索有关弹性池的信息

SELECT TOP 5 avg_storage_percent / 100.0 * elastic_pool_storage_limit_mb AS ElasticPoolDataSpaceUsedInMB, * 
FROM sys.elastic_pool_resource_stats
Run Code Online (Sandbox Code Playgroud)