Reporting on Database Backup jobs

  • 12 December 2022
  • 9 comments
  • 145 views

Userlevel 4
Badge +2

Since I had someone on another community asking me last week about checking database backups to pull some detailed information, I wanted to highlight a script I wrote 2.5 years ago when I was an SA at Veeam doing automation.

I do not say that to brag about myself or my work, but to raise the point that there is a treasure trove of knowledge and idea that can be pulled from the VeeamHUB PowerShell repository.

These scripts in particular will allow you to filter based on VM name and/or number of hours as a window, but neither is required.

Then for each restore point matching your defined VM name(s) within the specified 'Filter Hours' period, it will launch a restore session for each restore point. Details of the restore points, databases, and database files will be gathered from the restore session, and the arraylist of the results will be output.

If no filter is defined, all of the database restore points will be tested and details will be returned.

Your mileage may vary, but I run through about 240 restore points in a nested virtual environment in my home lab in approximately 10 minutes.
 

The script for MS SQL can be found here:  Run-SQLRestorePointReport.ps1 (GitHub)
The script for Oracle can be found here:  Run-OracleRestorePointReport.ps1 (GitHub)

To see both of these in a live-action demo, check them out here:
 



Hope this helps y’all out. Please feel free to use the code, steal it, critique it, and/or learn from it. :)


9 comments

Userlevel 7
Badge +20

Ooh more PowerShell code to use.  I remember this session from VeeamON.  Going to watch it again.  Thanks Joe.

Userlevel 7
Badge +17

Super scripts 👍🏼 I will watch your recording.

Userlevel 7
Badge +9

Thank you for sharing

Userlevel 7
Badge +6

Well thanks!  This will be yet another Veeam tab I have sitting open for a long while until I can find the time to go and watch the video!  😁

Userlevel 4
Badge +2

Thanks for the kind words y’all, it makes me glad I saved the videos.

All of my past presentations for Veeam and VMUG are here, covering PowerShell, APIs, Kubernetes, etc., if they help anyone out:
https://www.youtube.com/channel/UCLxItxKPzAA4MWz2jFwOWfA/

I even did an internal Veeam training that was like “PowerShell 101 for the Veeam SE”.  I’ll dig it out of my archive and upload it as well.

Userlevel 7
Badge +20

Thanks for the kind words y’all, it makes me glad I saved the videos.

All of my past presentations for Veeam and VMUG are here, covering PowerShell, APIs, Kubernetes, etc., if they help anyone out:
https://www.youtube.com/channel/UCLxItxKPzAA4MWz2jFwOWfA/

I even did an internal Veeam training that was like “PowerShell 101 for the Veeam SE”.  I’ll dig it out of my archive and upload it as well.

Subscribed to your channel.  Look forward to new content.

Userlevel 7
Badge +2

Very cool and useful script Thanks @JHoughes :-)

Userlevel 2
Badge

Thank you for sharing these useful scripts 👏🏻

Userlevel 7
Badge +17

Great share @JHoughes . BTW, I can attest to Joe’s PoSH-VBR scripting expertise as he helped a hanful a yrs ago on a simple script I was wanting. Good stuff Joe!

Cheers!

Comment