Database growth rate (aggregated)
Job details
Name: | Database growth rate (aggregated) | |
Platform: | Sqlserver | |
Category: | Capacity | |
Description: | Collects size of all database files (including transaction log files) to visualize the growth rate for all databases. | |
Long description: | ||
Version: | 1.21 | |
Default schedule: | 10 5 5 * | |
Requires engine install: | Yes | |
Compatibility tag: | .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2000′ & hasengine=‘YES’ & eng_inst_priv = 0 & (engine_edition = ‘Microsoft SQL Server’ | engine_edition = ‘Azure SQL Managed Instance’)] |
Parameters
Name | Default value | Description |
---|---|---|
min histr interval | 360 | The minimum number of minutes before a new history record will be collected in the history table. |
Job Summary
- Purpose: The purpose of this job is to collect and visualize the growth rate of database files, including transaction log files, for all databases within a system. This includes monitoring the size and count of both data files and transaction logs, and storing historical data to track growth over time.
- Why: This job is important because monitoring database growth helps in managing storage and capacity planning effectively. By understanding growth trends, administrators can anticipate when to scale resources and prevent potential outages or performance issues associated with insufficient storage space. It also aids in maintaining budget expectations for infrastructure needs.
- Manual checking: You can check this manually in the database by issuing the following SQL commands:
SELECT dbid, name, filename, ROUND((size/1024.0)*8, 1) AS size FROM master..sysaltfiles ORDER BY 1
Dependencies and SQL Implementation Details
The job has specific dependencies on SQL Server system tables and custom tables created for tracking historical data. Below is detailed information about these dependencies and their importance:
- Dependencies:
- “master.dbo.sysaltfiles”: Critical for retrieving the size and count of database files.
- “database_growth_rate_aggr”: Internal dependency, indicating the job relies on its own prior executions.
- “dbw_db_size_histr_aggr”: Stores historical growth data.
- SQL Implementation:
- The SQL code provided creates a procedure that captures the current state of the database files and logs, checks if a new record needs to be inserted into the historical table based on a predefined interval, and updates the task execution details.
Reporting and Visualization
The job provides a visualization report on the database’s growth rate which can be crucial for presentations and audits:
- Report Template: “Database growth rate (aggregated)”
- Displays data related to the sizes of data files and transaction logs, as well as a total combined size, across different points in time.
- Utilizes charts to visually represent the growth over these periods, making it easier to recognize trends.
- Includes tabular data showing each file’s current size and location, enhancing file-level visibility.
Upgrade Considerations
- Upgrade Path: The job includes an upgrade script meant to adjust the existing stored procedure to possibly accommodate changes in monitoring or historical data collection strategies. This ensures the job’s effectiveness and compatibility with newer database configurations or changing business requirements.
System Requirements and Compatibility
- Compatibility: This task is crafted to operate with instances running on SQL Server (version 2000 and above), including Microsoft SQL Server editions and Azure SQL Managed Instances. This broad compatibility ensures that it can be deployed in diverse environments, addressing a wide range of performance and capacity monitoring needs.
Installation and Maintenance
- Installation: The job is designed for express and forced installations, emphasizing ease of setup and ensuring it is consistently deployed across different systems without manual intervention.
- Maintenance: Regular updates and checks of the underlying SQL procedures and the historical data table structure are recommended to maintain accuracy and performance of the growth monitoring.
The outlined structure and detailed analysis of the DBWatch job underscore its importance in proactive database capacity management and operational integrity.