Activity: Performing a PITR for an Azure SQL Database with PowerShell
Consider the following scenario: Mike is a new DBA, so his trainer is aware that there might be some misses at his end. Therefore, his trainer wants to configure PITR on the databases that Mike is working on. In this section, we will perform a PITR using PowerShell by following these steps:
- Press Windows key + R to open the Run dialog box. In the Run dialog box, type
powershell ise
to open a new PowerShell editor window. - In PowerShell, click File from the top menu and then select New to create a new PowerShell script file:
Figure 5.40: Creating a new PowerShell script
- In the new PowerShell script file, copy and paste in the code from the following step.
- Define the PowerShell script parameters. The parameters are self-explanatory:
param( Â Â Â Â Â Â Â Â Â Â Â Â [Parameter(Mandatory=$true)] Â Â Â Â Â Â Â Â Â Â ...