Scripts to create and configure a dedicated DBA maintenance database with Ola Hallengren's maintenance solution.
Creates the _dba database with SIMPLE recovery model, restricted user access, and sets database scoped configuration for MAXDOP and query optimizer settings.
PowerShell script to install Ola Hallengren's SQL Server Maintenance Solution.
Template calls to Ola Hallengren's maintenance solution procedures for full backups, transaction log backups, and index optimization with specific parameters.
Configures Ola Hallengren backup procedures specifically for AlwaysOn Availability Group environments, handling AG and non-AG databases separately with copy-only backups for replicas.
Stored procedure to identify and rebuild fragmented heaps across all online user databases, with support for AlwaysOn and database mirroring scenarios.
Purges backup history, SQL Agent job history, and maintenance plan logs from msdb older than one month to keep the system database manageable.
Sets up SQL Agent jobs for CommandLog Cleanup (daily) and Index/Statistics Maintenance with rebuild_heaps integration using Ola Hallengren procedures.
Queries the _dba CommandLog table to display errors from Ola Hallengren maintenance procedures executed in the past day with error severity information.
Reads the _dba CommandLog for maintenance operations within a specified time period and database, showing object names and performance metrics.