We have 30-40 SQL server instances in different servers (2012 with AlwaysOn). Is there any kind of report that can be made which captures the daily backup status and sends a mail, perhaps, or at least can be appended in an Excel sheet manually and then sent later? Any help would be appreciated.
Sql-server – SQL Server backup status report
availability-groupsbackupsql serversql-server-2012
Related Question
- Sql-server – SQL Server 2012 enlarge database space
- Sql-server – How to remove Data Quality Services completely
- SQL Server Backup – Using Split Availability Groups
- Sql-server – SQL Server take an unencrypted full backup
- Sql-server – Trouble with differential backup – full backup not being recognized
- Sql-server – Can no longer connect to localdb after updating from Sql Server 2016 to 2019
Best Answer
There are various ways to build a report with that information. You could do this with PowerShell or TSQL using linked servers or SSIS.
There are sample scripts on the web and this forums site for pulling backup status for a server or given database. Just need to come up with method to pull it all together for a central report in your environment.
Update
It will depend on what you mean by
daily backup status
. I will also assume this is going to be a manual process, but for the most part I would generally follow the steps below, for starters:Use PowerShell:
Invoke-SqlCmd
orSystem.Data.SqlClient
)$reportdata | Export-Csv -path MyFile.csv -Delimiter "|"
)I wrote this function sometime back for an SSIS package to provide to a client as an example, but it should work in your case of just passing in the query to execute in order to get an Excel file. It works the same as if you went into Excel to the Data ribbon and selected "From text" to get external data:
Use T-SQL
This could go anywhere from just using Registered Servers in SSMS to get the results for all servers at one time; or from a single server that can talk to them all creating linked servers to each one.
To automate a T-SQL option only, would require a bit more if you want to email it, but you could dump all the data into a single table and then
BCP
it out to Excel possibly. I am not much for using BCP when I have PowerShell to get it straight into the format I want.