From 795dd0cb43206a6103c8db4aa97a4b1135b2da9f Mon Sep 17 00:00:00 2001 From: Eitan Blumin Date: Tue, 21 Sep 2021 21:38:09 +0300 Subject: [PATCH 01/11] revamped ssrs reports (POC) --- ...ize_page_allocation_compact_v2_SQL2012.sql | 94 + ssrs-custom-reports/FileAllocationReports.sln | 30 +- ...ion Map - Detailed (SQL2012 and newer).rdl | 0 ...ion Map - Overview (SQL2012 and newer).rdl | 0 ...age Allocation Map (SQL2012 and newer).rdl | 1218 ++++++++++++ .../FileAllocationReports_SQL2012.rptproj} | 6 +- ...Allocation Summary (SQL2012 and newer).rdl | 1669 ++++++++++++++++ .../TEMPLATE.rdl | 632 +++++++ ...Log Allocation Map (SQL2008 and newer).rdl | 0 ... Allocation Map (SQL2016SP2 and newer).rdl | 0 ...ion Map - Detailed (SQL2019 and newer).rdl | 819 ++++---- ...ion Map - Overview (SQL2019 and newer).rdl | 0 ... Allocation Map (SQL2016SP2 and newer).rdl | 1260 ++++++++++++ .../FileAllocationReports_SQL2016.rptproj | 59 + ...ocation Summary (SQL2016SP2 and newer).rdl | 1684 +++++++++++++++++ ... Allocation Map (SQL2016SP2 and newer).rdl | 1057 +++++++++++ 16 files changed, 8158 insertions(+), 370 deletions(-) create mode 100644 sql-queries/visualize_page_allocation_compact_v2_SQL2012.sql rename ssrs-custom-reports/{ => FileAllocationReports_SQL2012}/Data File Allocation Map - Detailed (SQL2012 and newer).rdl (100%) rename ssrs-custom-reports/{ => FileAllocationReports_SQL2012}/Data File Allocation Map - Overview (SQL2012 and newer).rdl (100%) create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl rename ssrs-custom-reports/{FileAllocationMap.rptproj => FileAllocationReports_SQL2012/FileAllocationReports_SQL2012.rptproj} (94%) create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2012/TEMPLATE.rdl rename ssrs-custom-reports/{ => FileAllocationReports_SQL2012}/Transaction Log Allocation Map (SQL2008 and newer).rdl (100%) rename ssrs-custom-reports/{ => FileAllocationReports_SQL2012}/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl (100%) rename ssrs-custom-reports/{ => FileAllocationReports_SQL2016}/Data File Allocation Map - Detailed (SQL2019 and newer).rdl (80%) rename ssrs-custom-reports/{ => FileAllocationReports_SQL2016}/Data File Allocation Map - Overview (SQL2019 and newer).rdl (100%) create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2016/FileAllocationReports_SQL2016.rptproj create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2016/Object Allocation Summary (SQL2016SP2 and newer).rdl create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2016/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl diff --git a/sql-queries/visualize_page_allocation_compact_v2_SQL2012.sql b/sql-queries/visualize_page_allocation_compact_v2_SQL2012.sql new file mode 100644 index 0000000..9b56da9 --- /dev/null +++ b/sql-queries/visualize_page_allocation_compact_v2_SQL2012.sql @@ -0,0 +1,94 @@ +DECLARE @DatabaseName sysname = DB_NAME(), @ObjectName sysname = '[CyberProfiles].[Profile]', @ObjectType sysname = 'Table' + +SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + databse_name = DB_NAME() +, file_name +, page_identifier = CONCAT(file_id,':',pt.from_page_id) +, check_file_total_size = file_total_size +, check_file_total_used_space = file_total_used_space +, check_file_total_unused_pages = file_total_unused_pages +, agg_file_total_reserved_pages = file_total_reserved_pages +, agg_file_total_consecutive_unused_pages = SUM(pt.consecutive_unused_pages) OVER (PARTITION BY file_id) +, pt.* +, pages_in_range = pt.to_page_id - pt.from_page_id + 1 +FROM +( +SELECT + databse_name = DB_NAME() +, file_id +, file_name +, file_total_size +, file_total_used_space +, file_total_unused_pages = file_total_size - file_total_reserved_pages + 1 +, file_total_reserved_pages +, prev_used_page +, from_used_page_id = allocated_page_page_id +, to_page_id = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) +, consecutive_unused_pages = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) - allocated_page_page_id +, next_used_page_id = LEAD(allocated_page_page_id,1,file_total_size-1) OVER(PARTITION BY file_id ORDER BY allocated_page_page_id ASC) +FROM +( +SELECT + database_id = DB_ID() +, f.file_id +, f.file_name +, f.file_total_used_space +, f.file_total_size +, file_total_reserved_pages = COUNT(*) OVER() + 9 +, p.allocated_page_page_id +, prev_used_page = LAG(p.allocated_page_page_id,1,0) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +, next_used_page = LEAD(p.allocated_page_page_id,1,f.file_total_size - 1) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),default,default,default,'DETAILED') AS p +INNER JOIN ( + SELECT file_id, file_name = [name], size AS file_total_size + , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') + FROM sys.database_files AS f + WHERE type = 0 +) AS f +ON f.file_id = p.allocated_page_file_id +) AS sub1 +WHERE sub1.next_used_page <> sub1.allocated_page_page_id + 1 +) AS sub2 +CROSS APPLY +( + SELECT usage = 'EMPTY' + , from_page_id = from_used_page_id + 1 + , to_page_id = sub2.to_page_id + , consecutive_unused_pages = sub2.consecutive_unused_pages + UNION ALL + SELECT + usage = 'USED' + , 0 + , sub2.from_used_page_id + , 0 + WHERE prev_used_page = 0 + UNION ALL + SELECT + usage = 'USED' + , sub2.to_page_id + 1 + , sub2.next_used_page_id + , 0 + WHERE next_used_page_id < file_total_size-1 +) AS pt \ No newline at end of file diff --git a/ssrs-custom-reports/FileAllocationReports.sln b/ssrs-custom-reports/FileAllocationReports.sln index 11b2e3f..94534e5 100644 --- a/ssrs-custom-reports/FileAllocationReports.sln +++ b/ssrs-custom-reports/FileAllocationReports.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31205.134 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F14B399A-7131-4C87-9E4B-1186C45EF12D}") = "FileAllocationMap", "FileAllocationMap.rptproj", "{5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}" +Project("{F14B399A-7131-4C87-9E4B-1186C45EF12D}") = "FileAllocationReports_SQL2012", "FileAllocationReports_SQL2012\FileAllocationReports_SQL2012.rptproj", "{09684BC2-84EA-4385-A982-68B94F575ECA}" +EndProject +Project("{F14B399A-7131-4C87-9E4B-1186C45EF12D}") = "FileAllocationReports_SQL2016", "FileAllocationReports_SQL2016\FileAllocationReports_SQL2016.rptproj", "{A1955D58-3E91-47BC-8A03-202A6496F7C0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +14,24 @@ Global Release|Default = Release|Default EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Debug|Default.ActiveCfg = Debug - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Debug|Default.Build.0 = Debug - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Debug|Default.Deploy.0 = Debug - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.DebugLocal|Default.ActiveCfg = DebugLocal - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.DebugLocal|Default.Build.0 = DebugLocal - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Release|Default.ActiveCfg = Release - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Release|Default.Build.0 = Release - {5FEAC3FA-942F-4E7E-979D-AB5EDC1455ED}.Release|Default.Deploy.0 = Release + {09684BC2-84EA-4385-A982-68B94F575ECA}.Debug|Default.ActiveCfg = Debug + {09684BC2-84EA-4385-A982-68B94F575ECA}.Debug|Default.Build.0 = Debug + {09684BC2-84EA-4385-A982-68B94F575ECA}.Debug|Default.Deploy.0 = Debug + {09684BC2-84EA-4385-A982-68B94F575ECA}.DebugLocal|Default.ActiveCfg = DebugLocal + {09684BC2-84EA-4385-A982-68B94F575ECA}.DebugLocal|Default.Build.0 = DebugLocal + {09684BC2-84EA-4385-A982-68B94F575ECA}.DebugLocal|Default.Deploy.0 = DebugLocal + {09684BC2-84EA-4385-A982-68B94F575ECA}.Release|Default.ActiveCfg = Release + {09684BC2-84EA-4385-A982-68B94F575ECA}.Release|Default.Build.0 = Release + {09684BC2-84EA-4385-A982-68B94F575ECA}.Release|Default.Deploy.0 = Release + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Debug|Default.ActiveCfg = Debug + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Debug|Default.Build.0 = Debug + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Debug|Default.Deploy.0 = Debug + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.DebugLocal|Default.ActiveCfg = DebugLocal + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.DebugLocal|Default.Build.0 = DebugLocal + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.DebugLocal|Default.Deploy.0 = DebugLocal + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Release|Default.ActiveCfg = Release + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Release|Default.Build.0 = Release + {A1955D58-3E91-47BC-8A03-202A6496F7C0}.Release|Default.Deploy.0 = Release EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ssrs-custom-reports/Data File Allocation Map - Detailed (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl similarity index 100% rename from ssrs-custom-reports/Data File Allocation Map - Detailed (SQL2012 and newer).rdl rename to ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl diff --git a/ssrs-custom-reports/Data File Allocation Map - Overview (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl similarity index 100% rename from ssrs-custom-reports/Data File Allocation Map - Overview (SQL2012 and newer).rdl rename to ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl new file mode 100644 index 0000000..801ccc8 --- /dev/null +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl @@ -0,0 +1,1218 @@ + + + Segoe UI + Eitan Blumin + 0 + + + + SQL + Data Source=(local) + true + + Integrated + 8c777e46-8c80-4a4b-92f8-ac2dcdbd8064 + + + + + + LocalServer + SELECT DB_NAME() AS DBName, CAST(ServerProperty('ServerName') AS nvarchar(1000)) AS ServerName + + + + DBName + System.String + + + ServerName + System.String + + + + + + LocalServer + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!DatabaseName.Value + + + --DECLARE @DatabaseName sysname = DB_NAME(), @ObjectName sysname = '[CyberProfiles].[Profile]', @ObjectType sysname = 'Table' + +SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + file_name +, page_identifier = CONCAT(file_id,':',pt.from_page_id) +, check_file_total_size = file_total_size +, check_file_total_used_space = file_total_used_space +, check_file_total_unused_pages = file_total_unused_pages +, agg_file_total_reserved_pages = file_total_reserved_pages +, agg_file_total_consecutive_unused_pages = SUM(pt.consecutive_unused_pages) OVER (PARTITION BY file_id) +, pt.* +, pages_in_range = pt.to_page_id - pt.from_page_id + 1 +FROM +( +SELECT + databse_name = DB_NAME() +, file_id +, file_name +, file_total_size +, file_total_used_space +, file_total_unused_pages = file_total_size - file_total_reserved_pages + 1 +, file_total_reserved_pages +, prev_used_page +, from_used_page_id = allocated_page_page_id +, to_page_id = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) +, consecutive_unused_pages = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) - allocated_page_page_id +, next_used_page_id = LEAD(allocated_page_page_id,1,file_total_size-1) OVER(PARTITION BY file_id ORDER BY allocated_page_page_id ASC) +FROM +( +SELECT + database_id = DB_ID() +, f.file_id +, f.file_name +, f.file_total_used_space +, f.file_total_size +, file_total_reserved_pages = COUNT(*) OVER() + 9 +, p.allocated_page_page_id +, prev_used_page = LAG(p.allocated_page_page_id,1,0) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +, next_used_page = LEAD(p.allocated_page_page_id,1,f.file_total_size - 1) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),default,default,default,'DETAILED') AS p +INNER JOIN ( + SELECT file_id, file_name = [name], size AS file_total_size + , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') + FROM sys.database_files AS f + WHERE type = 0 +) AS f +ON f.file_id = p.allocated_page_file_id +) AS sub1 +WHERE sub1.next_used_page <> sub1.allocated_page_page_id + 1 +) AS sub2 +CROSS APPLY +( + SELECT usage = 'EMPTY' + , from_page_id = from_used_page_id + 1 + , to_page_id = sub2.to_page_id + , consecutive_unused_pages = sub2.consecutive_unused_pages + UNION ALL + SELECT + usage = 'USED' + , 0 + , sub2.from_used_page_id + , 0 + WHERE prev_used_page = 0 + UNION ALL + SELECT + usage = 'USED' + , sub2.to_page_id + 1 + , sub2.next_used_page_id + , 0 + WHERE next_used_page_id < file_total_size-1 +) AS pt + + + + file_name + System.String + + + page_identifier + System.String + + + check_file_total_size + System.Int32 + + + check_file_total_used_space + System.Int32 + + + check_file_total_unused_pages + System.Int32 + + + agg_file_total_reserved_pages + System.Int32 + + + agg_file_total_consecutive_unused_pages + System.Int32 + + + usage + System.String + + + from_page_id + System.Int32 + + + to_page_id + System.Int32 + + + consecutive_unused_pages + System.Int32 + + + pages_in_range + System.Int32 + + + + + + + + + + true + true + + + + + =Parameters!ErrorText.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!from_page_id.Value + + + + + =Fields!from_page_id.Value + + + + + + + + + + + + =Fields!usage.Value + + + + + =Fields!usage.Value + + + + + + + + + + + + + =Sum(Fields!pages_in_range.Value) * 8 + + + + true + true + + ="from page: " + Fields!from_page_id.Value + vbCrLf ++ "to page: " + Fields!to_page_id.Value + vbCrLf ++ "usage: " + Fields!usage.Value + + + + + Data File Allocation Map - Detailed (SQL2012 and newer) + + + =Fields!file_name.Value + + + =Fields!from_page_id.Value + + + =Fields!to_page_id.Value + + + + + + + + + 8pt + #,0 + #5c5c5c + + + Page Offset + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Page Utilization + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + Consecutive Data Page Utilization + + TopLeft + + + SemiTransparent + + + + + No Data Available + + + PageAllocation + 0.6cm + 0.00005cm + 13cm + 29.35143cm + 1 + Detailed Page Utilization + + + White + None + + + + 5.35433in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.51153cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.01389in + 0.44745in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.01389in + 0.00005cm + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!index_id.Value + =Fields!object_id.Value + + + + + =Fields!index_name.Value + + + + + + + + + + + + =Fields!page_type_desc.Value + + + + + =Fields!page_type_desc.Value + + + + + + + + + + + + + =CDec(Sum(Fields!used_bytes.Value)) / 1024 + + + + true + true + + ="Schema: " & First(Fields!schema_name.Value) & vbCrLf & ", Object: " & First(Fields!object_name.Value) & vbCrLf & ", Index: " & First(Fields!index_name.Value) & vbCrLf & ", Size: " & (CDec(Sum(Fields!used_bytes.Value)) / 1024) & " KB" + + + 8pt + #,0 + #5c5c5c + + + + + + 1 + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Size (KB) + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + Size per index + + TopLeft + + + SemiTransparent + + + + + No Data Available + + + PageAllocation + 0.6cm + 0.00005cm + 5in + 29.35143cm + 1 + Page Utilization by Object + + + White + None + + + + + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + + + 0.6cm + + + + + true + true + + + + + schema name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + object name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + index name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + page type + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + used bytes + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + free bytes + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!schema_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!object_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!index_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!page_type_desc.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!used_bytes.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!free_bytes.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + PageAllocation + 13.8cm + 1.2cm + 20.60382cm + 2 + + true + DetailsToggle + + + + + + + true + true + + + + + Details + + + 2pt + 2pt + 2pt + 2pt + + + + 5.90551in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0cm + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0cm + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0cm + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.51153cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.01389in + 0.44745in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.01389in + 0.00005cm + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 2.64207in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47626cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44743in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + - - - Version 1.0 (SQL 2019 and newer) - - - - - - - true - true - - - - - =First(Fields!ServerName.Value, "DBLocal") - - - - - - - ServerName - 0.38833in - 1.11459in - 0.19444in - 2.39583in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.38833in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!DBName.Value, "DBLocal") - - - - - - - 0.58277in - 1.11459in - 0.19444in - 2.39583in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.58277in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.38833in - 8.18117in - 0.19444in - 3.37451in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Year(Now()) - - - - - - - Textbox2 - 11.36776in - 0.1875in - 0.44743in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 11.36776in - 0.44743in - 0.1875in - 11.36359in - 7 - - - 2pt - 2pt - 2pt - 2pt - - @@ -856,11 +564,9 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in FileAllocation - 15.87411cm - 0.00001cm - 13cm + 13.9cm + 15cm 30cm - 8 Detailed Page Utilization FileAllocation - 3.17411cm + 1.2cm 5in 30cm - 9 + 1 Page Utilization by Object - - true - true - - - - - back to overview - - - - - - - ExecutionTime - - - - - Data File Allocation Map - Overview (SQL2019 and newer) - - - - - 0.58277in - 8.18117in - 0.19444in - 3.37451in - 11 - - - 2pt - 2pt - 2pt - 2pt - - - 11.55526in + 11.37795in + + + Version 1.0 (SQL 2019 and newer) + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.38833in + 1.11459in + 0.19444in + 2.39583in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.38833in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.58277in + 1.11459in + 0.19444in + 2.39583in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.58277in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.38833in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + back to overview + + + + + + + ExecutionTime + + + + + Data File Allocation Map - Overview (SQL2019 and newer) + + + + + 0.58277in + 8.18117in + 0.19444in + 3.37451in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47625cm + true + true + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 0.00002cm + 0.1875in + 0.44743in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44744in + 0.1875in + 11.36359in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.7cm 21cm 2cm @@ -1863,6 +1885,18 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in + + String + true + true + ServerName + + + String + true + true + DatabaseName + String File Name: @@ -1883,33 +1917,102 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in Top N largets objects: - true + + + String + true + true + ObjectTypeName + + + String + true + true + ObjectName + + + Boolean + true + true + Filtered + + + String + true + true + ErrorText + + + String + true + + + "Tahoma" + + + true + FontName 4 - 2 + 4 - 0 + 2 0 FileName - 1 - 0 + 0 + 1 FromPageId + + 1 + 1 + ToPageId + 2 + 1 + TopN + + + 0 0 - ToPageId + ServerName - 3 + 1 0 - TopN + DatabaseName + + + 0 + 2 + ObjectTypeName + + + 1 + 2 + ObjectName + + + 2 + 2 + Filtered + + + 0 + 3 + ErrorText + + + 1 + 3 + FontName diff --git a/ssrs-custom-reports/Data File Allocation Map - Overview (SQL2019 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl similarity index 100% rename from ssrs-custom-reports/Data File Allocation Map - Overview (SQL2019 and newer).rdl rename to ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl new file mode 100644 index 0000000..cd6d88b --- /dev/null +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl @@ -0,0 +1,1260 @@ + + + Segoe UI + Eitan Blumin + 0 + + + + SQL + Data Source=(local) + true + + Integrated + 8c777e46-8c80-4a4b-92f8-ac2dcdbd8064 + + + + + + LocalServer + SELECT DB_NAME() AS DBName, CAST(ServerProperty('ServerName') AS nvarchar(1000)) AS ServerName + + + + DBName + System.String + + + ServerName + System.String + + + + + + LocalServer + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!DatabaseName.Value + + + --DECLARE @DatabaseName sysname = DB_NAME(), @ObjectName sysname = '[CyberProfiles].[Profile]', @ObjectType sysname = 'Table' + +SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + file_name +, page_identifier = CONCAT(file_id,':',pt.from_page_id) +, check_file_total_size = file_total_size +, check_file_total_used_space = file_total_used_space +, check_file_total_unused_pages = file_total_unused_pages +, agg_file_total_reserved_pages = file_total_reserved_pages +, agg_file_total_consecutive_unused_pages = SUM(pt.consecutive_unused_pages) OVER (PARTITION BY file_id) +, pt.* +, pages_in_range = pt.to_page_id - pt.from_page_id + 1 +FROM +( +SELECT + databse_name = DB_NAME() +, file_id +, file_name +, file_total_size +, file_total_used_space +, file_total_unused_pages = file_total_size - file_total_reserved_pages + 1 +, file_total_reserved_pages +, prev_used_page +, from_used_page_id = allocated_page_page_id +, to_page_id = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) +, consecutive_unused_pages = ISNULL(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page) - allocated_page_page_id +, next_used_page_id = LEAD(allocated_page_page_id,1,file_total_size-1) OVER(PARTITION BY file_id ORDER BY allocated_page_page_id ASC) +FROM +( +SELECT + database_id = DB_ID() +, f.file_id +, f.file_name +, f.file_total_used_space +, f.file_total_size +, file_total_reserved_pages = COUNT(*) OVER() + 9 +, p.allocated_page_page_id +, prev_used_page = LAG(p.allocated_page_page_id,1,0) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +, next_used_page = LEAD(p.allocated_page_page_id,1,f.file_total_size - 1) OVER (PARTITION BY f.file_id ORDER BY p.allocated_page_page_id ASC) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),default,default,default,'DETAILED') AS p +INNER JOIN ( + SELECT file_id, file_name = [name], size AS file_total_size + , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') + FROM sys.database_files AS f + WHERE type = 0 +) AS f +ON f.file_id = p.allocated_page_file_id +) AS sub1 +WHERE sub1.next_used_page <> sub1.allocated_page_page_id + 1 +) AS sub2 +CROSS APPLY +( + SELECT usage = 'EMPTY' + , from_page_id = from_used_page_id + 1 + , to_page_id = sub2.to_page_id + , consecutive_unused_pages = sub2.consecutive_unused_pages + UNION ALL + SELECT + usage = 'USED' + , 0 + , sub2.from_used_page_id + , 0 + WHERE prev_used_page = 0 + UNION ALL + SELECT + usage = 'USED' + , sub2.to_page_id + 1 + , sub2.next_used_page_id + , 0 + WHERE next_used_page_id < file_total_size-1 +) AS pt + + + + file_name + System.String + + + page_identifier + System.String + + + check_file_total_size + System.Int32 + + + check_file_total_used_space + System.Int32 + + + check_file_total_unused_pages + System.Int32 + + + agg_file_total_reserved_pages + System.Int32 + + + agg_file_total_consecutive_unused_pages + System.Int32 + + + usage + System.String + + + from_page_id + System.Int32 + + + to_page_id + System.Int32 + + + consecutive_unused_pages + System.Int32 + + + pages_in_range + System.Int32 + + + + + + + + + + true + true + + + + + =Parameters!ErrorText.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!from_page_id.Value + + + + + =Fields!from_page_id.Value + + + + + + + + + + + + =Fields!file_name.Value + + + + + =Fields!file_name.Value + + + + + + + + + + + + + =Sum(Fields!pages_in_range.Value) * 8 + + + + true + true + + =Fields!usage.Value & " " & (Fields!pages_in_range.Value * 8) & " KB" & vbCrLf & "from page: " & Fields!from_page_id.Value & vbCrLf & "to page: " & Fields!to_page_id.Value + + + + + Data File Allocation Map - Detailed (SQL2019 and newer) + + + =Fields!file_name.Value + + + =Fields!from_page_id.Value + + + =Fields!to_page_id.Value + + + =Parameters!DatabaseName.Value + + + + + + + + + + + 8pt + #,0 + #5c5c5c + + + Page Offset + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Page Utilization + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + Consecutive Data Page Utilization + + TopLeft + + + SemiTransparent + + + + + No Data Available + + + PageAllocation + 0.6cm + 0.00005cm + 13cm + 29.35143cm + 1 + Detailed Page Utilization + + + White + None + + + + 5.35433in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.51153cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.01389in + 0.44745in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.01389in + 0.00005cm + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!index_id.Value + =Fields!object_id.Value + + + + + =Fields!index_name.Value + + + + + + + + + + + + =Fields!page_type_desc.Value + + + + + =Fields!page_type_desc.Value + + + + + + + + + + + + + =CDec(Sum(Fields!used_bytes.Value)) / 1024 + + + + true + true + + ="Schema: " & First(Fields!schema_name.Value) & vbCrLf & ", Object: " & First(Fields!object_name.Value) & vbCrLf & ", Index: " & First(Fields!index_name.Value) & vbCrLf & ", Size: " & (CDec(Sum(Fields!used_bytes.Value)) / 1024) & " KB" + + + 8pt + #,0 + #5c5c5c + + + + + + 1 + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Size (KB) + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + Size per index + + TopLeft + + + SemiTransparent + + + + + No Data Available + + + PageAllocation + 0.6cm + 0.00005cm + 5in + 29.35143cm + 1 + Page Utilization by Object + + + White + None + + + + + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + 3.43397cm + + + + + 0.6cm + + + + + true + true + + + + + schema name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + object name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + index name + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + page type + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + used bytes + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + free bytes + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!schema_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!object_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!index_name.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!page_type_desc.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!used_bytes.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!free_bytes.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + PageAllocation + 13.8cm + 1.2cm + 20.60382cm + 2 + + true + DetailsToggle + + + + + + + true + true + + + + + Details + + + 2pt + 2pt + 2pt + 2pt + + + + 5.90551in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.51153cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.01389in + 0.44745in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.01389in + 0.00005cm + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + + + + Version 1.0 (SQL 2016 SP2 and newer) + + + + + + + true + true + + + + + =First(Fields!ServerName.Value, "DBLocal") + + + + + + + ServerName + 0.38833in + 1.11458in + 0.19444in + 2.39583in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.38833in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!DBName.Value, "DBLocal") + + + + + + + 0.58277in + 1.12847in + 0.19444in + 2.38194in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.58277in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.35141cm + + + + + 14.45182cm + + + + + + + + + + + + =Fields!vlf_begin_offset.Value + + + + + =Fields!vlf_begin_offset.Value + + + + + + + + + + + + =Fields!vlf_status_desc.Value + + + + + =Fields!vlf_status_desc.Value + + + + + + + + + + + + + =Sum(Fields!vlf_size_mb.Value) + + + + true + true + + =Fields!vlf_status_desc.Value & ": " & Fields!vlf_size_mb.Value & " MB," & vbCrLf & " Offset: " & Fields!vlf_begin_offset.Value + + + 8pt + #,0 + #5c5c5c + + + VLF Offset + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Size (MB) + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + SemiTransparent + + + + + No Data Available + + + TranLogAllocation + 1.2cm + 13.25182cm + 29.35141cm + + + White + None + + + + + + + 2.83104cm + + + 6.08541cm + + + + + 0.6cm + + + + + true + true + + + + + File: + + + + + + + Textbox19 + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!file_name.Value + + + + + + + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!vlf_status_desc.Value + + + + : + + + + + + + Textbox19 + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!vlf_size_mb.Value) + + + + + + + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + =Fields!vlf_status_desc.Value + + + + + + TranLogAllocation + 1.2cm + 8.91645cm + 1 + =First(Fields!file_name.Value, "TranLogAllocation") + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + =Fields!file_id.Value + =Fields!file_name.Value + + + + + + TranLogAllocation + 2.04467cm + 14.45182cm + 29.35141cm + 5 + + + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.38833in + 8.79525in + 0.19444in + 2.76042in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 6.52235in + 0.1875in + 0.34326in + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 6.52235in + 0.34326in + 0.1875in + 11.21241in + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + 6.70985in + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.35137cm + + + + + 15cm + + + + + + + + + + + + =Fields!PageGroup.Value + + + + + =Fields!PageGroup.Value + + + + + + + + + + + + + + + + + + + + + + + =Sum(Fields!free_kb.Value) + + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + True + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + =Fields!file_name.Value + + TopLeft + + + Pastel + + + + + No Data Available + + + DataAllocationDataset + 15cm + 29.35137cm + + + White + None + + + + true + + + + + + + + + + + + + + + + + + + + + =Fields!file_id.Value + + + + + + DataAllocationDataset + 0.6cm + 0.00003cm + 15cm + 29.35137cm + 1 + + + + + + 6.14173in + + + + Version 2.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47626cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44743in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + - - - Version 2.0 (SQL 2012 and newer) - - - - - - - true - true - - - - - =First(Fields!ServerName.Value, "DBLocal") - - - - - - - ServerName - 0.40222in - 1.11458in - 0.19444in - 2.39583in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.40222in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!DBName.Value, "DBLocal") - - - - - - - 0.59666in - 1.12847in - 0.19444in - 2.38194in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.59666in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - @@ -703,7 +526,7 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") Black - SemiTransparent + Pastel - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.40222in - 8.79525in - 0.19444in - 2.76042in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Year(Now()) - - - - - - - Textbox2 - 6.40943in - 0.1875in - 0.34326in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 6.40943in - 0.34326in - 0.1875in - 11.46776in - 8 - - - 2pt - 2pt - 2pt - 2pt - - - 7.01389in + 5.59055in + + + Version 2.0 (SQL 2012 and newer) + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.40222in + 1.11458in + 0.19444in + 2.39583in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.40222in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.59666in + 1.11458in + 0.19444in + 2.39583in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.59666in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.40222in + 8.79525in + 0.19444in + 2.76042in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47625cm + true + true + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 0.00001cm + 0.1875in + 0.34326in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.34326in + 0.1875in + 11.46776in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.7cm 21cm 2cm @@ -1112,10 +1132,36 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") + + + String + true + true + ServerName + + + String + true + true + DatabaseName + + 4 2 + + + 0 + 0 + ServerName + + + 1 + 0 + DatabaseName + + Cm diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl index 801ccc8..f44b235 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl @@ -594,7 +594,7 @@ CROSS APPLY TopLeft - SemiTransparent + Pastel - - - Version 1.0 (SQL 2019 and newer) - - - - - - - true - true - - - - - =First(Fields!ServerName.Value, "DBLocal") - - - - - - - ServerName - 0.38833in - 1.11458in - 0.19444in - 2.39583in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.38833in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!DBName.Value, "DBLocal") - - - - - - - 0.58277in - 1.12847in - 0.19444in - 2.38194in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.58277in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - @@ -703,7 +526,7 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") Black - SemiTransparent + Pastel - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.38833in - 8.79525in - 0.19444in - 2.76042in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Year(Now()) - - - - - - - Textbox2 - 6.39554in - 0.1875in - 0.34326in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 6.39554in - 0.34326in - 0.1875in - 11.46776in - 8 - - - 2pt - 2pt - 2pt - 2pt - - - 7in + 5.59055in + + + Version 1.0 (SQL 2019 and newer) + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.38833in + 1.11458in + 0.19444in + 2.39583in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.38833in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.58277in + 1.11458in + 0.19444in + 2.39583in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.58277in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.38833in + 8.79525in + 0.19444in + 2.76042in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47625cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.34326in + 0.1875in + 11.46776in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.34326in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.7cm 21cm 2cm @@ -1112,10 +1131,36 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") + + + String + true + true + ServerName + + + String + true + true + DatabaseName + + 4 2 + + + 0 + 0 + ServerName + + + 1 + 0 + DatabaseName + + Cm diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl index cd6d88b..c6519b0 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl @@ -601,7 +601,7 @@ CROSS APPLY TopLeft - SemiTransparent + Pastel - - - Version 1.0 (SQL 2016 SP2 and newer) - - - - - - - true - true - - - - - =First(Fields!ServerName.Value, "DBLocal") - - - - - - - ServerName - 0.38833in - 1.11458in - 0.19444in - 2.39583in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.38833in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!DBName.Value, "DBLocal") - - - - - - - 0.58277in - 1.12847in - 0.19444in - 2.38194in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.58277in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - @@ -628,7 +451,7 @@ FROM sys.dm_db_log_info(DB_ID()) Black - SemiTransparent + Pastel - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.38833in - 8.79525in - 0.19444in - 2.76042in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Year(Now()) - - - - - - - Textbox2 - 6.52235in - 0.1875in - 0.34326in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 6.52235in - 0.34326in - 0.1875in - 11.21241in - 8 - - - 2pt - 2pt - 2pt - 2pt - - - 6.70985in + 5.68969in + + + Version 1.0 (SQL 2016 SP2 and newer) + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.38833in + 1.11458in + 0.19444in + 2.39583in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.38833in + 0.00001cm + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.58277in + 1.11458in + 0.19444in + 2.39583in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.58277in + 0.00001cm + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.38833in + 8.79525in + 0.19444in + 2.76042in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47625cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.34326in + 0.1875in + 11.21241in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 0.00001cm + 0.1875in + 0.34326in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.7cm 21cm 2cm @@ -1046,10 +1069,34 @@ FROM sys.dm_db_log_info(DB_ID()) + + + String + true + true + ServerName + + + String + DatabaseName + + 4 2 + + + 0 + 0 + ServerName + + + 1 + 0 + DatabaseName + + Cm From 2fb08e1acdaa2c3de9bee9b5da19aa43af32ec52 Mon Sep 17 00:00:00 2001 From: Eitan Blumin Date: Tue, 21 Sep 2021 23:00:41 +0300 Subject: [PATCH 04/11] Added zoomable report for SQL2019 --- ...e_allocation_detailed_zoomable_SQL2019.sql | 60 + ...ion Map - Detailed (SQL2012 and newer).rdl | 2 + ...ion Map - Detailed (SQL2019 and newer).rdl | 11 + ...ion Map - Zoomable (SQL2019 and newer).rdl | 1390 +++++++++++++++++ .../FileAllocationReports_SQL2016.rptproj | 1 + 5 files changed, 1464 insertions(+) create mode 100644 sql-queries/visualize_page_allocation_detailed_zoomable_SQL2019.sql create mode 100644 ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Zoomable (SQL2019 and newer).rdl diff --git a/sql-queries/visualize_page_allocation_detailed_zoomable_SQL2019.sql b/sql-queries/visualize_page_allocation_detailed_zoomable_SQL2019.sql new file mode 100644 index 0000000..4207647 --- /dev/null +++ b/sql-queries/visualize_page_allocation_detailed_zoomable_SQL2019.sql @@ -0,0 +1,60 @@ +DECLARE @DatabaseName sysname = DB_NAME(), @ObjectName sysname = '[CyberProfiles].[Profile]', @ObjectType sysname = 'Table', @MaxItems int = 128 +DECLARE @FileId int = NULL, @FromPage bigint = 0, @ToPage bigint = NULL + +SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE IF @ObjectType <> 'Database' +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + f.file_name +, f.file_id +, p.PageGroup +, from_page_id = MIN(p.page_id) +, to_page_id = MAX(p.page_id) +, page_count = COUNT(p.page_id) +, free_kb = SUM(p.free_bytes) / 1024 +, used_kb = SUM(p.used_bytes) / 1024 +FROM +( +SELECT p.allocated_page_file_id +, page_id = p.allocated_page_page_id +, p.page_type +, page_type_desc = ISNULL(p.page_type_desc, 'EMPTY') +, free_bytes = CASE WHEN ISNULL(p.page_type_desc, 'EMPTY') = 'EMPTY' THEN 8192 ELSE ISNULL((100 - p.page_free_space_percent) / 100.0 * 8192, 0) END +, used_bytes = CASE WHEN ISNULL(p.page_type_desc, 'EMPTY') = 'EMPTY' THEN 0 ELSE ISNULL(p.page_free_space_percent / 100.0 * 8192, 8192) END +, PageGroup = NTILE(@MaxItems) OVER(ORDER BY p.allocated_page_page_id) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),@TableId,@IndexId,default,'DETAILED') AS p +WHERE (@FileId IS NULL OR p.allocated_page_file_id = @FileId) +AND (@FromPage IS NULL OR p.allocated_page_page_id >= @FromPage) +AND (@ToPage IS NULL OR p.allocated_page_page_id <= @ToPage) +) AS p +INNER JOIN +( + SELECT file_id, file_name = [name], size AS file_total_size + , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') + FROM sys.database_files AS f + WHERE type = 0 +) AS f +ON f.file_id = p.allocated_page_file_id +GROUP BY + f.file_name +, f.file_id +, p.PageGroup \ No newline at end of file diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl index 5cfd182..b08c97e 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl @@ -1924,12 +1924,14 @@ WHERE p.allocated_page_page_id BETWEEN @FromPageId AND @ToPageId Integer + true 128 Max Items + true String diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl index 05199b5..b942649 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl @@ -1954,6 +1954,12 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in true FontName + + Integer + true + MaxItems + true + @@ -2015,6 +2021,11 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in 3 FontName + + 2 + 3 + MaxItems + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Zoomable (SQL2019 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Zoomable (SQL2019 and newer).rdl new file mode 100644 index 0000000..651d5f7 --- /dev/null +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Zoomable (SQL2019 and newer).rdl @@ -0,0 +1,1390 @@ + + + Segoe UI + Eitan Blumin + 0 + + + + SQL + Data Source=(local) + true + + Integrated + 8c777e46-8c80-4a4b-92f8-ac2dcdbd8064 + + + + + + LocalServer + SELECT DB_NAME() AS DBName, CAST(ServerProperty('ServerName') AS nvarchar(1000)) AS ServerName + + + + DBName + System.String + + + ServerName + System.String + + + + + + LocalServer + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!MaxItems.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!FromPageId.Value + + + =Parameters!ToPageId.Value + + + =Parameters!FileName.Value + + + SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE IF @ObjectType <> 'Database' +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + f.file_name +, f.file_id +, p.PageGroup +, from_page_id = MIN(p.page_id) +, to_page_id = MAX(p.page_id) +, page_count = COUNT(p.page_id) +, free_kb = SUM(ISNULL(pinfo.free_bytes, 8 * 1024)) / 1024 +, used_kb = SUM(ISNULL(pinfo.free_bytes_offset, 0)) / 1024 +FROM +( +SELECT p.allocated_page_file_id +, page_id = p.allocated_page_page_id +, p.page_type +, page_type_desc = ISNULL(p.page_type_desc, 'EMPTY') +, free_bytes = CASE WHEN ISNULL(p.page_type_desc, 'EMPTY') = 'EMPTY' THEN 8192 ELSE ISNULL((100 - p.page_free_space_percent) / 100.0 * 8192, 0) END +, used_bytes = CASE WHEN ISNULL(p.page_type_desc, 'EMPTY') = 'EMPTY' THEN 0 ELSE ISNULL(p.page_free_space_percent / 100.0 * 8192, 8192) END +, PageGroup = NTILE(@MaxItems) OVER(ORDER BY p.allocated_page_page_id) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),@TableId,@IndexId,default,'DETAILED') AS p +WHERE (@FromPage IS NULL OR p.allocated_page_page_id >= @FromPage) +AND (@ToPage IS NULL OR p.allocated_page_page_id <= @ToPage) +) AS p +INNER JOIN +( + SELECT file_id, file_name = [name], size AS file_total_size + , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') + FROM sys.database_files AS f + WHERE type = 0 + AND (@FileName IS NULL OR f.name = @FileName) +) AS f +ON f.file_id = p.allocated_page_file_id +OUTER APPLY sys.dm_db_page_info(DB_ID(@DatabaseName), f.file_id, p.page_id, 'DETAILED') AS pinfo +GROUP BY + f.file_name +, f.file_id +, p.PageGroup + + + + file_name + System.String + + + file_id + System.Int32 + + + PageGroup + System.Int64 + + + from_page_id + System.Int32 + + + to_page_id + System.Int32 + + + page_count + System.Int32 + + + free_kb + System.Int32 + + + used_kb + System.Int32 + + + + + + + + + + true + true + + + + + =Parameters!ErrorText.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.35137cm + + + + + 15cm + + + + + + + + + + + + =Fields!PageGroup.Value + + + + + =Fields!PageGroup.Value + + + + + + + + + + + + + + + + + + + + + + + =Sum(Fields!free_kb.Value) + + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + True + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + =Fields!file_name.Value + + TopLeft + + + Pastel + + + + + No Data Available + + + DataAllocationDataset + 15cm + 29.35137cm + + + White + None + + + + true + + + + + + + + + + + + + + + + + + + + + =Fields!file_id.Value + + + + + + DataAllocationDataset + 0.6cm + 0.00003cm + 15cm + 29.35137cm + 1 + + + + + + 6.14173in + + + + Version 2.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47626cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44743in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + - - - Version 2.0 (SQL 2012 and newer) - - - - - - - true - true - - - - - =First(Fields!ServerName.Value, "DBLocal") - - - - - - - ServerName - 0.40222in - 1.11459in - 0.19444in - 2.39583in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.40222in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =First(Fields!DBName.Value, "DBLocal") - - - - - - - 0.59666in - 1.11459in - 0.19444in - 2.39583in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.59666in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.40222in - 8.18117in - 0.19444in - 3.37451in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Year(Now()) - - - - - - - Textbox2 - 11.38165in - 0.1875in - 0.44743in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 11.38165in - 0.44743in - 0.1875in - 11.36359in - 7 - - - 2pt - 2pt - 2pt - 2pt - - @@ -853,11 +609,10 @@ WHERE p.allocated_page_page_id BETWEEN @FromPageId AND @ToPageId FileAllocation - 15.90938cm - 0.00001cm - 13cm + 14.81722cm + 0.00004cm + 8.89896cm 30cm - 8 Detailed Page Utilization FileAllocation - 3.20938cm + 1.23528cm 5in 30cm - 9 + 1 Page Utilization by Object - + true + true true - back to overview + [<<] + + + + + + + + + + Data File Allocation Map - Detailed (SQL2012 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!FromPageId.Value-1-(Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!FromPageId.Value-1 + + + =Parameters!TopN.Value + + + + + + + 13.93528cm + 0.00003cm + 0.88194cm + 2.83102cm + 3 + + =IIF(Parameters!FromPageId.Value > 8, False, True) + + Shift Interval Left + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + [>>] + @@ -1817,25 +1653,58 @@ WHERE p.allocated_page_page_id BETWEEN @FromPageId AND @ToPageId - ExecutionTime - Data File Allocation Map - Overview (SQL2012 and newer) + Data File Allocation Map - Detailed (SQL2012 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!ToPageId.Value + 1 + + + =Parameters!ToPageId.Value + 1 + (Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!TopN.Value + + - 0.59666in - 8.18117in - 0.19444in - 3.37451in - 11 + 13.93528cm + 27.16902cm + 0.88194cm + 2.83102cm + 4 + + =(IIF(IsNothing(Parameters!ToPageId.Value), First(Fields!total_page_count.Value, "FileAllocation"), Parameters!ToPageId.Value) >= First(Fields!total_page_count.Value, "FileAllocation")) + + Shift Interval Right + Middle 2pt 2pt 2pt @@ -1843,11 +1712,395 @@ WHERE p.allocated_page_page_id BETWEEN @FromPageId AND @ToPageId - 11.56915in + 9.33708in + + + + + + ServerName + 0.40222in + 1.1146in + 0.19444in + 2.39583in + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.40222in + 0.00002cm + 0.19444in + 1.11458in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.59666in + 1.1146in + 0.19444in + 2.39583in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.59666in + 0.00002cm + 0.19444in + 1.11458in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Data File Allocation Map + + + + Version 2.0 (SQL 2012 and newer) + + + + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.40222in + 8.18118in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + back to overview + + + + + + + ExecutionTime + + + + + Data File Allocation Map - Overview (SQL2012 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + + + + + 0.59666in + 8.18118in + 0.19444in + 3.37451in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47625cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44744in + 0.1875in + 11.36359in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Year(Now()) + + + + + + + Textbox2 + 0.00002cm + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 29.7cm 21cm 2cm diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl index 74d78f9..efb7d01 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl @@ -15,113 +15,130 @@ - + LocalServer - SELECT - databse_name = DB_NAME() -, file_name -, page_identifier = CONCAT(file_id,':',pt.from_page_id) -, check_file_total_size = file_total_size -, check_file_total_used_space = file_total_used_space -, check_file_total_unused_pages = file_total_unused_pages -, agg_file_total_reserved_pages = file_total_reserved_pages -, agg_file_total_consecutive_unused_pages = SUM(pt.consecutive_unused_pages) OVER (PARTITION BY file_id) -, pt.* -, pages_in_range = pt.to_page_id - pt.from_page_id + 1 + SELECT DB_NAME() AS DBName, CAST(ServerProperty('ServerName') AS nvarchar(1000)) AS ServerName + + + + DBName + System.String + + + ServerName + System.String + + + + + + LocalServer + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!MaxItems.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!FromPageId.Value + + + =Parameters!ToPageId.Value + + + =Parameters!FileName.Value + + + SET NOCOUNT ON; +DECLARE @IndexId int = NULL, @TableId int = NULL; + +IF @ObjectType = 'Index' +BEGIN + SELECT @TableId = object_id + FROM sys.indexes + WHERE name = @ObjectName + + IF @@ROWCOUNT <> 1 RAISERROR(N'Unable to determine table to which index "%s" belongs', 16, 1, @ObjectName); + + SET @IndexId = INDEXPROPERTY(@TableId, @ObjectName, 'IndexID'); +END +ELSE IF @ObjectType = 'Table' +BEGIN + SET @TableId = OBJECT_ID(@ObjectName); +END +ELSE IF @ObjectType <> 'Database' +BEGIN + RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); +END + +SELECT + f.file_name +, f.file_id +, f.file_total_size +, p.PageGroup +, from_page_id = MIN(p.page_id) +, to_page_id = MAX(p.page_id) +, page_count = COUNT(p.page_id) +, total_page_count = MAX(p.total_page_count) +, free_kb = SUM(ISNULL(p.free_bytes, 8192)) / 1024 +, used_kb = SUM(ISNULL(p.used_bytes, 0)) / 1024 FROM ( -SELECT - databse_name = DB_NAME() -, file_id -, file_name -, file_total_size -, file_total_used_space -, file_total_unused_pages = file_total_size - file_total_reserved_pages + 1 -, file_total_reserved_pages -, prev_used_page -, from_used_page_id = allocated_page_page_id -, to_page_id = COALESCE(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page, file_total_size-1) -, consecutive_unused_pages = COALESCE(NULLIF(next_used_page,file_total_size-1) - 1, next_used_page, file_total_size-1) - allocated_page_page_id -, next_used_page_id = LEAD(allocated_page_page_id,1,file_total_size-1) OVER(PARTITION BY file_id ORDER BY allocated_page_page_id ASC) +SELECT * +, PageGroup = NTILE(@MaxItems) OVER(ORDER BY p.page_id) FROM ( -SELECT - p.allocated_page_file_id -, file_total_reserved_pages = COUNT(*) OVER() + 9 -, p.allocated_page_page_id -, prev_used_page = LAG(p.allocated_page_page_id,1,0) OVER (PARTITION BY p.allocated_page_file_id ORDER BY p.allocated_page_page_id ASC) -, next_used_page = LEAD(p.allocated_page_page_id,1, NULL) OVER (PARTITION BY p.allocated_page_file_id ORDER BY p.allocated_page_page_id ASC) -FROM sys.dm_db_database_page_allocations(DB_ID(),default,default,default,'DETAILED') AS p -) AS sub1 -INNER JOIN +SELECT allocated_page_file_id +, page_id = allocated_page_page_id +, page_type +, page_type_desc = ISNULL(page_type_desc, 'EMPTY') +, free_bytes = CASE WHEN ISNULL(page_type_desc, 'EMPTY') = 'EMPTY' THEN 8192 ELSE ISNULL((100 - page_free_space_percent) / 100.0 * 8192, 0) END +, used_bytes = CASE WHEN ISNULL(page_type_desc, 'EMPTY') = 'EMPTY' THEN 0 ELSE ISNULL(page_free_space_percent / 100.0 * 8192, 8192) END +, total_page_count = MAX(allocated_page_page_id) OVER (PARTITION BY allocated_page_file_id) +FROM sys.dm_db_database_page_allocations(DB_ID(@DatabaseName),@TableId,@IndexId,default,'DETAILED') +) AS p +WHERE (@FromPageId IS NULL OR p.page_id >= @FromPageId) +AND (@ToPageId IS NULL OR p.page_id <= @ToPageId) +) AS p +INNER JOIN ( - SELECT database_id, file_id, file_name = [name], size AS file_total_size + SELECT file_id, file_name = [name], size AS file_total_size , file_total_used_space = FILEPROPERTY([name], 'SpaceUsed') - FROM sys.master_files AS f - WHERE database_id = DB_ID() AND type = 0 + FROM sys.database_files AS f + WHERE type = 0 + AND (@FileName IS NULL OR f.name = @FileName) ) AS f -ON f.file_id = sub1.allocated_page_file_id -WHERE ISNULL(sub1.next_used_page, f.file_total_size - 1) <> sub1.allocated_page_page_id + 1 -) AS sub2 -CROSS APPLY -( - SELECT usage = 'EMPTY' - , from_page_id = from_used_page_id + 1 - , to_page_id = sub2.to_page_id - , consecutive_unused_pages = sub2.consecutive_unused_pages - UNION ALL - SELECT - usage = 'USED' - , 0 - , sub2.from_used_page_id - , 0 - WHERE prev_used_page = 0 - UNION ALL - SELECT - usage = 'USED' - , sub2.to_page_id + 1 - , sub2.next_used_page_id - , 0 - WHERE next_used_page_id < file_total_size-1 -) AS pt +ON f.file_id = p.allocated_page_file_id +GROUP BY + f.file_name +, f.file_id +, f.file_total_size +, p.PageGroup - - databse_name - System.String - - - page_identifier - System.String - file_name System.String - - check_file_total_size - System.Int32 - - - check_file_total_used_space - System.Int32 - - - check_file_total_unused_pages + + file_id System.Int32 - - agg_file_total_reserved_pages + + file_total_size System.Int32 - - agg_file_total_consecutive_unused_pages - System.Int32 - - - usage - System.String + + PageGroup + System.Int64 from_page_id @@ -131,29 +148,21 @@ CROSS APPLY to_page_id System.Int32 - - consecutive_unused_pages + + page_count System.Int32 - - pages_in_range + + total_page_count System.Int32 - - - - - LocalServer - SELECT DB_NAME() AS DBName, CAST(ServerProperty('ServerName') AS nvarchar(1000)) AS ServerName - - - - DBName - System.String + + free_kb + System.Decimal - - ServerName - System.String + + used_kb + System.Decimal @@ -162,85 +171,124 @@ CROSS APPLY + + true + true + + + + + =Parameters!ErrorText.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + - 30cm + 29.35137cm - 14.2cm + 15.9525cm - + - + - =Fields!from_page_id.Value + =Fields!PageGroup.Value - =Fields!from_page_id.Value + =Fields!PageGroup.Value - + - - - =Fields!usage.Value - - - - - =Fields!usage.Value - - - + + + + - + - =Sum(Fields!pages_in_range.Value) / 128.0 + =Sum(Fields!used_kb.Value) 8pt - #,0 #5c5c5c @@ -319,6 +445,7 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") + True - Size (MB) + + TopLeft + + Pastel - FileAllocation - 1.2cm - 13cm - 30cm + DataAllocationDataset + 1.05833cm + 0.00003cm + 14.89417cm + 29.35137cm - - - - - 2.83104cm - - - 6.08541cm - - - - - 0.6cm - - - - - true - true - - - - - File: - - - - - - - Textbox19 - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!file_name.Value - - - - - - - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!usage.Value - - - - - - - Textbox19 - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!pages_in_range.Value) / 128.0 - - - - - - - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - After - - - - - =Fields!usage.Value - - - - - - FileAllocation - 1.2cm - 8.91645cm + + true + true + true + + + + + [>>] + + + + + + + + + + + Data File Allocation Map - Overview (SQL2012 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!ToPageId.Value + 1 + + + =Parameters!ToPageId.Value + 1 + (Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + + + + + 26.52035cm + 0.84666cm + 2.83102cm 1 - =First(Fields!file_name.Value, "FileAllocation") + + =(IIF(IsNothing(Parameters!ToPageId.Value), First(Fields!total_page_count.Value, "DataAllocationDataset"), Parameters!ToPageId.Value) >= First(Fields!total_page_count.Value, "DataAllocationDataset")) + + Shift Interval Right + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + [<<] + + + + + + + + + + + Data File Allocation Map - Overview (SQL2012 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!FromPageId.Value-1-(Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!FromPageId.Value-1 + + + + + + + 0.00003cm + 0.88194cm + 2.83102cm + 2 + + =IIF(Parameters!FromPageId.Value > 8, False, True) + + Shift Interval Left + Middle + 2pt + 2pt + 2pt + 2pt - + true - - - @@ -781,31 +870,176 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") - + - =Fields!file_name.Value + =Fields!file_id.Value - FileAllocation - 14.2cm - 30cm + DataAllocationDataset + 0.6cm + 0.00003cm + 15.9525cm + 29.35137cm + 1 + + true + true + + + + + From Page: + + + + + + + Textbox19 + 20.78014cm + 0.6cm + 1.94438cm + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FromPageId.Value + + + + + + + Textbox29 + 22.72452cm + 0.6cm + 2.5cm + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + To Page: + + + + + + + Textbox24 + 25.22452cm + 0.6cm + 1.62688cm + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ToPageId.Value + + + + + + + Textbox30 + 26.8514cm + 0.6cm + 2.5cm + 5 + + + Middle + 2pt + 2pt + 2pt + 2pt + + - 5.59055in + 6.51673in - Version 2.0 (SQL 2012 and newer) + Version 1.0 @@ -833,8 +1067,8 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") textbox1 - 0.37444in - 11.81102in + 0.41611in + 11.55568in - 0.59666in - 1.11458in + 0.61055in + 1.11459in 0.19444in - 2.39583in + 6.99714in 3 - - - - - - - 0.47625cm - true - true - - + true true - =Year(Now()) + =Parameters!ObjectTypeName.Value + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + @@ -1052,10 +1310,119 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") - Textbox2 - 0.00001cm - 0.1875in - 0.34326in + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 @@ -1066,6 +1433,18 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") 2pt + + + + + + + 0.47627cm + true + true + true true @@ -1100,9 +1479,42 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") Textbox2 - 0.34326in + 0cm + 0.44743in 0.1875in - 11.46776in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.44743in 1 - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 29.35137cm - - - - - 15cm - - - - - - - - - - - - =Fields!PageGroup.Value - - - - - =Fields!PageGroup.Value - - - - - - - - - - - - - - - - - - - - - - - =Sum(Fields!free_kb.Value) - - - - - 8pt - #5c5c5c - - - - - - - False - - - - - - - - - - - - - - True - - 0.5 - - NaN - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - False - - - - - - - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - - - - - - - - - - - - - - - 0.5 - - NaN - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - - - - - - - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - - - - - TopLeft - - - - - Black - Black - - - - - =Fields!file_name.Value - - TopLeft - - - Pastel - - - - - No Data Available - - - DataAllocationDataset - 15cm - 29.35137cm - - - White - None - - - - true - - - - - - - - - - - - - - - - - - - - - =Fields!file_id.Value - - - - - - DataAllocationDataset - 0.6cm - 0.00003cm - 15cm - 29.35137cm - 1 - - - - - - 6.14173in - - - - Version 2.0 - - - - - - - true - true - - - - - =Parameters!ServerName.Value - - - - - - - ServerName - 0.41611in - 1.11459in - 0.19444in - 6.99714in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.41611in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DatabaseName.Value - - - - - - - 0.61055in - 1.11459in - 0.19444in - 6.99714in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.61055in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.41611in - 8.18117in - 0.19444in - 3.37451in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ObjectTypeName.Value - - - - - - - 0.80499in - 1.11459in - 0.19444in - 6.99714in - 6 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Object Type: - - - - - - - Textbox19 - 0.80499in - 0.19444in - 1.11458in - 7 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ObjectName.Value - - - - - - - 0.99943in - 1.1146in - 0.19444in - 6.99714in - 8 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Object Name: - - - - - - - Textbox19 - 0.99943in - 0.00003cm - 0.19444in - 1.11458in - 9 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Filtered.Value, "(Filtered)", "") - - - - - - - ExecutionTime - 0.61055in - 8.18117in - 0.19444in - 3.37451in - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 0.47626cm - true - true - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 0.44743in - 0.1875in - 11.10825in - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="© " & Year(Now()) - - - - - - - Textbox2 - 0.1875in - 0.44743in - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 2cm - 2cm - 2cm - 2cm - 0.13cm - FileAllocation - 13.9cm + 14.78194cm 15cm 30cm Detailed Page Utilization @@ -1507,11 +1553,168 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in + + true + true + true + + + + + [<<] + + + + + + + + + + + Data File Allocation Map - Detailed (SQL2019 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!FromPageId.Value-1-(Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!FromPageId.Value-1 + + + =Parameters!TopN.Value + + + + + + + 13.9cm + 0.88194cm + 2.83102cm + 3 + + =IIF(Parameters!FromPageId.Value > 8, False, True) + + Shift Interval Left + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + [>>] + + + + + + + + + + + Data File Allocation Map - Detailed (SQL2019 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!ToPageId.Value + 1 + + + =Parameters!ToPageId.Value + 1 + (Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!TopN.Value + + + + + + + 13.9cm + 27.169cm + 0.84666cm + 2.83102cm + 4 + + =(IIF(IsNothing(Parameters!ToPageId.Value), First(Fields!total_page_count.Value, "FileAllocation"), Parameters!ToPageId.Value) >= First(Fields!total_page_count.Value, "FileAllocation")) + + Shift Interval Right + + + Middle + 2pt + 2pt + 2pt + 2pt + + - 11.37795in + 11.72517in @@ -1755,6 +1958,26 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in Data File Allocation Map - Overview (SQL2019 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + @@ -1806,7 +2029,6 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in Textbox2 - 0.00002cm 0.1875in 0.44743in + + + + + 2pt + 2pt + 2pt + 2pt + + - 30cm + 29.35137cm - 14.2cm + 15.9525cm - + - + - =Fields!from_page_id.Value + =Fields!PageGroup.Value - =Fields!from_page_id.Value + =Fields!PageGroup.Value - + - - - =Fields!usage.Value - - - - - =Fields!usage.Value - - - + + + + - + - =Sum(Fields!pages_in_range.Value) / 128.0 + =Sum(Fields!used_kb.Value) 8pt - #,0 #5c5c5c @@ -319,6 +446,7 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") + True - Size (MB) + + TopLeft + + Pastel - FileAllocation - 1.2cm - 13cm - 30cm + DataAllocationDataset + 0.9525cm + 15cm + 29.35137cm - - - - - 2.83104cm - - - 6.08541cm - - - - - 0.6cm - - - - - true - true - - - - - File: - - - - - - - Textbox19 - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!file_name.Value - - - - - - - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!usage.Value - - - - - - - Textbox19 - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!pages_in_range.Value) / 128.0 - - - - - - - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - After - - - - - =Fields!usage.Value - - - - - - FileAllocation - 1.2cm - 8.91645cm + + true + true + true + + + + + [<<] + + + + + + + + + + + Data File Allocation Map - Overview (SQL2019 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!FromPageId.Value-1-(Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + =Parameters!FromPageId.Value-1 + + + + + + + 0cm + 0.88194cm + 2.83102cm 1 - =First(Fields!file_name.Value, "FileAllocation") + + =IIF(Parameters!FromPageId.Value > 8, False, True) + + Shift Interval Left + Middle + 2pt + 2pt + 2pt + 2pt - + + + true + true + true + + + + + [>>] + + + + + + + + + + + Data File Allocation Map - Overview (SQL2019 and newer) + + + =Parameters!ServerName.Value + + + =Parameters!DatabaseName.Value + + + =Parameters!ObjectTypeName.Value + + + =Parameters!ObjectName.Value + + + =Parameters!Filtered.Value + + + =Parameters!FileName.Value + + + =Parameters!ToPageId.Value + 1 + + + =Parameters!ToPageId.Value + 1 + (Parameters!ToPageId.Value-Parameters!FromPageId.Value) + + + + + + + 0.03528cm + 26.52035cm + 0.84666cm + 2.83102cm + 2 + + =(IIF(IsNothing(Parameters!ToPageId.Value), First(Fields!total_page_count.Value, "DataAllocationDataset"), Parameters!ToPageId.Value) >= First(Fields!total_page_count.Value, "DataAllocationDataset")) + + Shift Interval Right + + + Middle + 2pt + 2pt + 2pt + 2pt + + true - - - @@ -781,31 +871,176 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") - + - =Fields!file_name.Value + =Fields!file_id.Value - FileAllocation - 14.2cm - 30cm + DataAllocationDataset + 0.6cm + 0.00003cm + 15.9525cm + 29.35137cm + 1 + + true + true + + + + + From Page: + + + + + + + Textbox19 + 20.78014cm + 0.6cm + 1.94438cm + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FromPageId.Value + + + + + + + Textbox29 + 22.72452cm + 0.6cm + 2.5cm + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + To Page: + + + + + + + Textbox24 + 25.22452cm + 0.6cm + 1.62688cm + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ToPageId.Value + + + + + + + Textbox30 + 26.8514cm + 0.6cm + 2.5cm + 5 + + + Middle + 2pt + 2pt + 2pt + 2pt + + - 5.59055in + 6.51673in - Version 1.0 (SQL 2019 and newer) + Version 2.0 @@ -833,8 +1068,8 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") textbox1 - 0.37444in - 11.81102in + 0.41611in + 11.55568in - 0.58277in - 1.11458in + 0.61055in + 1.11459in 0.19444in - 2.39583in + 6.99714in 3 + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + - 0.47625cm + 0.47627cm true true @@ -1067,9 +1480,10 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") Textbox2 - 0.34326in + 0cm + 0.44743in 0.1875in - 11.46776in + 11.10825in @@ -1087,7 +1501,7 @@ Format(Sum(Fields!pages_in_range.Value) / 128.0, "#,0 MB"), "") - =Year(Now()) + ="© " & Year(Now()) - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 29.35137cm - - - - - 15cm - - - - - - - - - - - - =Fields!PageGroup.Value - - - - - =Fields!PageGroup.Value - - - - - - - - - - - - - - - - - - - - - - - =Sum(Fields!free_kb.Value) - - - - - 8pt - #5c5c5c - - - - - - - False - - - - - - - - - - - - - - True - - 0.5 - - NaN - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - False - - - - - - - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - - - - - - - - - - - - - - - 0.5 - - NaN - NaN - NaN - - - - 8pt - #5c5c5c - - - - - - - - - - - - - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - - - - - TopLeft - - - - - Black - Black - - - - - =Fields!file_name.Value - - TopLeft - - - Pastel - - - - - No Data Available - - - DataAllocationDataset - 15cm - 29.35137cm - - - White - None - - - - true - - - - - - - - - - - - - - - - - - - - - =Fields!file_id.Value - - - - - - DataAllocationDataset - 0.6cm - 0.00003cm - 15cm - 29.35137cm - 1 - - - - - - 6.14173in - - - - Version 2.0 - - - - - - - true - true - - - - - =Parameters!ServerName.Value - - - - - - - ServerName - 0.41611in - 1.11459in - 0.19444in - 6.99714in - 1 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Server Name: - - - - - - - Textbox19 - 0.41611in - 0.19444in - 1.11458in - 2 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DatabaseName.Value - - - - - - - 0.61055in - 1.11459in - 0.19444in - 6.99714in - 3 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Database Name: - - - - - - - Textbox19 - 0.61055in - 0.19444in - 1.11458in - 4 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - ExecutionTime - 0.41611in - 8.18117in - 0.19444in - 3.37451in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ObjectTypeName.Value - - - - - - - 0.80499in - 1.11459in - 0.19444in - 6.99714in - 6 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Object Type: - - - - - - - Textbox19 - 0.80499in - 0.19444in - 1.11458in - 7 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ObjectName.Value - - - - - - - 0.99943in - 1.1146in - 0.19444in - 6.99714in - 8 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Object Name: - - - - - - - Textbox19 - 0.99943in - 0.00003cm - 0.19444in - 1.11458in - 9 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Filtered.Value, "(Filtered)", "") - - - - - - - ExecutionTime - 0.61055in - 8.18117in - 0.19444in - 3.37451in - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 0.47626cm - true - true - - - true - true - - - - - Madeira Data Solutions - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - https://github.com/MadeiraData/mssql-data-allocation-report - - - - - - - - - - Textbox2 - 0.44743in - 0.1875in - 11.10825in - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="© " & Year(Now()) - - - - - - - Textbox2 - 0.1875in - 0.44743in - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 2cm - 2cm - 2cm - 2cm - 0.13cm - - Version 2.0 (SQL 2012 and newer) + Version 1.0 (SQL 2012 and newer) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl index efb7d01..1f89053 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Overview (SQL2012 and newer).rdl @@ -1057,7 +1057,7 @@ GROUP BY - Version 1.0 + Version 1.0 (SQL 2012 and newer) @@ -1479,7 +1479,6 @@ GROUP BY Textbox2 - 0cm 0.44743in 0.1875in 11.10825in diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl index f44b235..d88c92e 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl @@ -652,7 +652,7 @@ CROSS APPLY - Version 1.0 + Version 1.0 (SQL 2012 and newer) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl index f47eeff..c58a63a 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl @@ -195,7 +195,6 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id Textbox24 - 0cm 0.6cm 29.3514cm - Version 1.0 + Version 1.0 (SQL 2012 and newer) @@ -1109,7 +1108,6 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id textbox1 - 0cm 0.41611in 11.55568in - Version 2.0 (SQL 2008 and newer) + Version 1.0 (SQL 2008 and newer) @@ -647,7 +647,7 @@ INNER JOIN sys.database_files AS df ON df.file_id = li.FileID Black - SemiTransparent + Pastel - Version 1.0 (SQL 2019 and newer) + Version 2.0 (SQL 2019 and newer) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl index 6144c31..0e31472 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Overview (SQL2019 and newer).rdl @@ -754,7 +754,6 @@ GROUP BY - 0cm 0.88194cm 2.83102cm 1 @@ -1058,7 +1057,7 @@ GROUP BY - Version 2.0 + Version 2.0 (SQL 2019 and newer) @@ -1480,7 +1479,6 @@ GROUP BY Textbox2 - 0cm 0.44743in 0.1875in 11.10825in diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl index c6519b0..6284866 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl @@ -659,7 +659,7 @@ CROSS APPLY - Version 1.0 + Version 2.0 (SQL 2016SP2 and newer) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Object Allocation Summary (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Object Allocation Summary (SQL2016SP2 and newer).rdl index 66fdce1..23d3b08 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Object Allocation Summary (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Object Allocation Summary (SQL2016SP2 and newer).rdl @@ -1098,7 +1098,7 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id - Version 1.0 + Version 2.0 (SQL 2016SP2 and newer) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl index 4592c6e..c99797a 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Transaction Log Allocation Map (SQL2016SP2 and newer).rdl @@ -724,6 +724,7 @@ FROM sys.dm_db_log_info(DB_ID()) TranLogAllocation + 0cm 14.45182cm 29.35141cm - Version 1.0 (SQL 2016 SP2 and newer) + Version 2.0 (SQL 2016SP2 and newer) From aa310a2520e20b9821770307be13f6fc6bef7e61 Mon Sep 17 00:00:00 2001 From: Eitan Blumin Date: Fri, 24 Sep 2021 14:58:46 +0300 Subject: [PATCH 07/11] category label fix --- .../Data File Allocation Map - Detailed (SQL2012 and newer).rdl | 2 +- .../Data File Allocation Map - Detailed (SQL2019 and newer).rdl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl index 5f8c0e2..e5c5551 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data File Allocation Map - Detailed (SQL2012 and newer).rdl @@ -646,7 +646,7 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in =Sum(Fields!used_bytes.Value) - + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl index d319aad..ec555b3 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data File Allocation Map - Detailed (SQL2019 and newer).rdl @@ -646,7 +646,7 @@ LEFT JOIN sys.indexes AS ix ON p.object_id = ix.object_id AND p.index_id = ix.in =Sum(Fields!used_bytes.Value) - + From 19aeee82bfc4b6423885cd34ed426a808e88234c Mon Sep 17 00:00:00 2001 From: Eitan Blumin Date: Fri, 24 Sep 2021 14:59:03 +0300 Subject: [PATCH 08/11] Renamed report --- ...ata Page Consecutive Allocation Map (SQL2012 and newer).rdl} | 0 .../FileAllocationReports_SQL2012.rptproj | 2 +- ... Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl} | 2 +- .../FileAllocationReports_SQL2016.rptproj | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename ssrs-custom-reports/FileAllocationReports_SQL2012/{Data Page Allocation Map (SQL2012 and newer).rdl => Data Page Consecutive Allocation Map (SQL2012 and newer).rdl} (100%) rename ssrs-custom-reports/FileAllocationReports_SQL2016/{Data Page Allocation Map (SQL2016SP2 and newer).rdl => Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl} (99%) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl similarity index 100% rename from ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Allocation Map (SQL2012 and newer).rdl rename to ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/FileAllocationReports_SQL2012.rptproj b/ssrs-custom-reports/FileAllocationReports_SQL2012/FileAllocationReports_SQL2012.rptproj index df911e2..22c7cb4 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/FileAllocationReports_SQL2012.rptproj +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/FileAllocationReports_SQL2012.rptproj @@ -51,7 +51,7 @@ - + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl similarity index 99% rename from ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl rename to ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl index 6284866..4f6147f 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Allocation Map (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl @@ -240,7 +240,7 @@ CROSS APPLY =Fields!from_page_id.Value - + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/FileAllocationReports_SQL2016.rptproj b/ssrs-custom-reports/FileAllocationReports_SQL2016/FileAllocationReports_SQL2016.rptproj index 2b0a81e..bbc048b 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/FileAllocationReports_SQL2016.rptproj +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/FileAllocationReports_SQL2016.rptproj @@ -51,7 +51,7 @@ - + From fbfd012b8df0fe12b9e8aad2f0f5a691249f513f Mon Sep 17 00:00:00 2001 From: Eitan Blumin Date: Fri, 24 Sep 2021 15:32:19 +0300 Subject: [PATCH 09/11] Label and tooltip fixes, added support for Database level report --- ...ive Allocation Map (SQL2012 and newer).rdl | 60 ++- ...Allocation Summary (SQL2012 and newer).rdl | 54 ++- ... Allocation Map (SQL2016SP2 and newer).rdl | 415 +++++++++++++++++- 3 files changed, 487 insertions(+), 42 deletions(-) diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl index d88c92e..3a32262 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Data Page Consecutive Allocation Map (SQL2012 and newer).rdl @@ -64,7 +64,7 @@ ELSE IF @ObjectType = 'Table' BEGIN SET @TableId = OBJECT_ID(@ObjectName); END -ELSE +ELSE IF ISNULL(@ObjectType,'') <> 'Database' BEGIN RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); END @@ -276,9 +276,7 @@ CROSS APPLY true true - ="from page: " + Fields!from_page_id.Value + vbCrLf -+ "to page: " + Fields!to_page_id.Value + vbCrLf -+ "usage: " + Fields!usage.Value + ="from page: " & Fields!from_page_id.Value & vbCrLf & "to page: " & Fields!to_page_id.Value & vbCrLf & "usage: " & Fields!usage.Value @@ -1142,17 +1140,17 @@ CROSS APPLY - + String true true - ObjectTypeName + ServerName - + String true true - ObjectName + DatabaseName String @@ -1160,17 +1158,23 @@ CROSS APPLY true ErrorText - - Boolean + + String true true - Filtered + ObjectTypeName - + String true true - ServerName + ObjectName + + + Boolean + true + true + Filtered String @@ -1183,12 +1187,6 @@ CROSS APPLY true FontName - - String - true - true - DatabaseName - @@ -1198,18 +1196,38 @@ CROSS APPLY 0 0 - ObjectTypeName + ServerName 1 0 - ObjectName + DatabaseName 2 0 ErrorText + + 0 + 1 + ObjectTypeName + + + 1 + 1 + ObjectName + + + 2 + 1 + Filtered + + + 3 + 1 + FontName + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl index c58a63a..bb8c4c0 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2012/Object Allocation Summary (SQL2012 and newer).rdl @@ -1588,17 +1588,17 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id - + String true true - ObjectTypeName + ServerName - + String true true - ObjectName + DatabaseName String @@ -1606,17 +1606,23 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id true ErrorText - - Boolean + + String true true - Filtered + ObjectTypeName - + String true true - ServerName + ObjectName + + + Boolean + true + true + Filtered String @@ -1629,12 +1635,6 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id true FontName - - String - true - true - DatabaseName - @@ -1644,18 +1644,38 @@ ORDER BY t.file_id, t.object_id, t.index_id, t.partition_id 0 0 - ObjectTypeName + ServerName 1 0 - ObjectName + DatabaseName 2 0 ErrorText + + 0 + 1 + ObjectTypeName + + + 1 + 1 + ObjectName + + + 2 + 1 + Filtered + + + 3 + 1 + FontName + diff --git a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl index 4f6147f..b5e21fe 100644 --- a/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl +++ b/ssrs-custom-reports/FileAllocationReports_SQL2016/Data Page Consecutive Allocation Map (SQL2016SP2 and newer).rdl @@ -64,7 +64,7 @@ ELSE IF @ObjectType = 'Table' BEGIN SET @TableId = OBJECT_ID(@ObjectName); END -ELSE +ELSE IF ISNULL(@ObjectType,'') <> 'Database' BEGIN RAISERROR(N'Object Type "%s" is not supported', 16, 1, @ObjectType); END @@ -312,8 +312,7 @@ CROSS APPLY - Shape - TreeMap + Stacked + + + + + + + =Fields!from_page_id.Value + + + + + =Fields!from_page_id.Value + + + + + + + + + + + + =Fields!file_name.Value + + + + + =Fields!file_name.Value + + + + + + + + + + + + + =Sum(Fields!pages_in_range.Value) * 8 + + + + true + true + + =Fields!usage.Value & " " & (Fields!pages_in_range.Value * 8) & " KB" & Microsoft.VisualBasic.Constants.vbCrLf & "from page: " & Fields!from_page_id.Value & Microsoft.VisualBasic.Constants.vbCrLf & "to page: " & Fields!to_page_id.Value + + + + + Data File Allocation Map - Detailed (SQL2019 and newer) + + + =Fields!file_name.Value + + + =Fields!from_page_id.Value + + + =Fields!to_page_id.Value + + + =Parameters!DatabaseName.Value + + + + + + + + + + + 8pt + #,0 + #5c5c5c + + + Page Offset + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + False + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + 8pt + #5c5c5c + + + Page Utilization + + + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + 8pt + #5c5c5c + + + + + + + + + + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + TopLeft + + + + + Black + Black + + + + + Consecutive Data Page Utilization + + TopLeft + + + Pastel + + + + + No Data Available + + + PageAllocation + 13.6cm + 0.00005cm + 13cm + 29.35143cm + 2 + Detailed Page Utilization + + + White + None + + - 5.35433in + 10.47244in + + + + + 2pt + 2pt + 2pt + 2pt + + + + 2.64207in + + + + Version 1.0 + + + + + + + true + true + + + + + =Parameters!ServerName.Value + + + + + + + ServerName + 0.41611in + 1.11459in + 0.19444in + 6.99714in + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Server Name: + + + + + + + Textbox19 + 0.41611in + 0.19444in + 1.11458in + 2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DatabaseName.Value + + + + + + + 0.61055in + 1.11459in + 0.19444in + 6.99714in + 3 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Database Name: + + + + + + + Textbox19 + 0.61055in + 0.19444in + 1.11458in + 4 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + ExecutionTime + 0.41611in + 8.18117in + 0.19444in + 3.37451in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectTypeName.Value + + + + + + + 0.80499in + 1.11459in + 0.19444in + 6.99714in + 6 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Type: + + + + + + + Textbox19 + 0.80499in + 0.19444in + 1.11458in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ObjectName.Value + + + + + + + 0.99943in + 1.1146in + 0.19444in + 6.99714in + 8 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Object Name: + + + + + + + Textbox19 + 0.99943in + 0.00003cm + 0.19444in + 1.11458in + 9 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Filtered.Value, "(Filtered)", "") + + + + + + + ExecutionTime + 0.61055in + 8.18117in + 0.19444in + 3.37451in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.47626cm + true + true + + + true + true + + + + + Madeira Data Solutions + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + https://github.com/MadeiraData/mssql-data-allocation-report + + + + + + + + + + Textbox2 + 0.44743in + 0.1875in + 11.10825in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="© " & Year(Now()) + + + + + + + Textbox2 + 0.1875in + 0.44743in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm +