突然我的数据库 .mdf 文件大小增加到超过 250GB,但我的总表数据大小计数仅为 4GB。我做了数据收缩,但没有结果。然后我做了下面的查询:
SELECT sch.[name], obj.[name], ISNULL(obj.[type_desc], N'TOTAL:') AS [type_desc],
COUNT(*) AS [ReservedPages],
(COUNT(*) * 8) / 1024.0 / 1024.0 AS [ReservedGB]
FROM sys.dm_db_database_page_allocations(DB_ID(), NULL, NULL, NULL, DEFAULT) pa
INNER JOIN sys.all_objects obj
ON obj.[object_id] = pa.[object_id]
INNER JOIN sys.schemas sch
ON sch.[schema_id] = obj.[schema_id]
GROUP BY GROUPING SETS ((sch.[name], obj.[name], obj.[type_desc]), ())
ORDER BY [ReservedPages] DESC;
它显示了这个结果:
我有一个服务经纪人。
任何建议删除或如何最小化 queue_message 表大小?
SELECT COUNT(*) FROM sys.conversation_endpoints;
从这里开始计数为 7,Dan 的答案中的查询返回 4 activation_procedure 和 4 返回 NULL。
dbo_Attendances_ee941a6a-d4e9-484c-b3d6-4922604ec585_Receiver
有 361840332 行,is_retention_enabled
0,激活过程 - NULLdbo_Attendances_ee941a6a-d4e9-484c-b3d6-4922604ec585_Sender
有 0 行is_retention_enabled
0 和激活过程[dbo].[dbo_Attendances_ee941a6a-d4e9-484c-b3d6-4922604ec585_QueueActivationSender]