1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| SELECT s.name AS SCHEMA_NAME, o.name AS OBJECT_NAME, o.type_desc AS OBJECT_TYPE,
ds.name AS STORAGE, dbf.physical_name AS FILENAME, ds.type_desc AS STORAGE_TYPE,
i.name AS index_name, i.index_id, i.type_desc AS index_type,
p.partition_id, p.partition_number as pnum, p.rows as partition_rows,
a.allocation_unit_id as alloc_unit_id, a.type_desc as page_type_desc, a.total_pages as pages,
internals.total_pages, internals.used_pages, internals.data_pages,
first_page, root_page, first_iam_page
FROM sys.objects AS o
INNER JOIN sys.schemas AS s
ON o.schema_id = s.schema_id
INNER JOIN sys.indexes AS i
ON o.object_id = i.object_id
INNER JOIN sys.partitions p
ON p.object_id = i.object_id
AND p.index_id = i.index_id
INNER JOIN sys.allocation_units a
ON a.container_id = p.partition_id
INNER JOIN sys.data_spaces ds
ON ds.data_space_id = a.data_space_id
LEFT OUTER JOIN sys.database_files dbf
ON dbf.data_space_id = ds.data_space_id
inner join sys.system_internals_allocation_units internals
on internals.container_id = a.container_id |
Partager