SQL Server - Create DR Plans
DR plans can be created and modified only on the standby DR group.
Open the DR group menu and open a detail of the standby DR group. Press “Create plan” button there:
Choose the name of the plan
Choose a type of the plan. There can be only 2 types of plan right now specified - Switchover and Failover
Press Create button
The creation of the Switchover plan lasts for some time. Once done, you can open details of the created DR plan. You can see, that there are already some DR Plan steps created. These are Plan steps care for migration of the Moving instance to the other DR group.
Create Stop Dbvisit job
Press the Add Group button and specify following:
Name of the Plan Group: Stop Dbvisit
Switch to Add after
choose Built-In Prechecks, so that the Stop Dbvisit job will start right after the Prechecks finish
Press Add Step button
During Plan step creation, fill in following:
Name of the Plan Step: Stop Dbvisit
Choose action in case of error: Stop on error
Specify timeout: 600
Choose region - choose primary one
Switch to “Run local script”
Choose an instance where the script is run: Control Center instance
Fill in the full path and name of the script: /home/opc/scripts/stop_dbvisit.sh
Specify user, under which the scripts were installed: opc
Confirm by pressing Add Step
Confirm the Plan group creation by pressing “Add” button.
After some short time, the plan group should be inserted after the Built-in prechecks Plan Group.
Change /etc/hosts file Plan Group
Add another plan group and fill in following:
Name of the Plan Group: Change etc hosts
Switch to Add after
choose Launch Compute Instances, so that the Stop Dbvisit job will start right after the Launch Compute Instances plan group
Press Add Step button
During Plan step creation, fill in following:
Name of the Plan Step: Change etc hosts
Choose action in case of error: Stop on error
Specify timeout: 600
Choose region - choose primary one
Switch to “Run local script”
Choose an instance where the script is run: Control Center instance
Fill in the full path and name of the script: /home/opc/scripts/change_hosts.sh 158 157 - this script will change the /etc/hosts file and replace the 158 IP address with 157
Specify user, under which the scripts were installed: opc
Confirm by pressing Add Step
Confirm the Plan group creation by pressing “Add” button.
Create Start Dbvisit job
Press the Add Group button and specify following:
Name of the Plan Group: Start Dbvisit
Switch to Add after
choose Change etc hosts, so that the Stop Dbvisit job will start right after the “Change etc hosts” plan group
Press Add Step button
During Plan step creation, fill in following:
Name of the Plan Step: Start Dbvisit
Choose action in case of error: Stop on error
Specify timeout: 600
Choose region - choose primary one
Switch to “Run local script”
Choose an instance where the script is run: Control Center instance
Fill in the full path and name of the script: /home/opc/scripts/start_dbvisit.sh
Specify user, under which the scripts were installed: opc
Confirm by pressing Add Step
Confirm the Plan group creation by pressing “Add” button.
Add Database Switchover Job to Switchover Plan
Now we need to add the database switchover job to the DR Plan.
Press Add group to do that.
Fill in following:
Step Name: Switchover
Choose a Region where the step will be executed
Choose “Run local script” option
Select Control Center machine as a target of the script
In the Script Parameters fill in following: /home/opc/scripts/switchover.sh <CONFIGURATION NAME>
Choose user that executes the script: opc
Press Add Step to create the step
Confirm the Step Group creation by Pressing Add button.