Protection Group Database Refresh Scripts
This folder contains an example script to take a Protection Group snapshot of a SQL Server database, whose files are split between two volumes (typically data & log volumes).Files:
- Protection Group Database Refresh.ps1
Scenario:
This example script shows steps to snapshot a FlashArray Protection Group that contains the data and log volumes of a SQL Server database. It will then clone those two volumes, from the Protection Group snapshot, and overlay another pre-existing set of volumes on a different, non-production SQL Server.
All references to a "target" refer to the non-production side.
Prerequisites:
- Two SQL Server instances with a single database, whose data file(s) are contained within 1 volume and log file(s) are contained within a 2nd volume.
- A Protection Group defined with the two volumes (data and log) as members
Usage Notes:
This simple example assumes there is only one database residing on two different volumes (data & log). If multiple databases are present, additional code must be added to offline/online all databases present on the affected volumes in the Protection Group. Also note that the Protection Group use may include other volumes without negative impact. Any extraneous volumes will simply not be utilized during the cloning step.
Disclaimer:
This example script is provided AS-IS and meant to be a building block to be adapted to fit an individual organization's infrastructure.
We encourage the modification and expansion of these scripts by the community. Although not necessary, please issue a Pull Request (PR) if you wish to request merging your modified code in to this repository.
The contents of the repository are intended as examples only and should be modified to work in your individual environments. No script examples should be used in a production environment without fully testing them in a development or lab environment. There are no expressed or implied warranties or liability for the use of these example scripts and templates presented by Pure Storage and/or their creators.