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:

image-20240116-151423.png

 

  1. Choose the name of the plan

  2. Choose a type of the plan. There can be only 2 types of plan right now specified - Switchover and Failover

  3. Press Create button

image-20240116-151532.png

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:

  1. Name of the Plan Group: Stop Dbvisit

  2. Switch to Add after

  3. choose Built-In Prechecks, so that the Stop Dbvisit job will start right after the Prechecks finish

  4. Press Add Step button

During Plan step creation, fill in following:

  1. Name of the Plan Step: Stop Dbvisit

  2. Choose action in case of error: Stop on error

  3. Specify timeout: 600

  4. Choose region - choose primary one

  5. Switch to “Run local script”

  6. Choose an instance where the script is run: Control Center instance

  7. Fill in the full path and name of the script: /home/opc/scripts/stop_dbvisit.sh

  8. Specify user, under which the scripts were installed: opc

  9. 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:

  1. Name of the Plan Group: Change etc hosts

  2. Switch to Add after

  3. choose Launch Compute Instances, so that the Stop Dbvisit job will start right after the Launch Compute Instances plan group

  4. Press Add Step button

 

During Plan step creation, fill in following:

  1. Name of the Plan Step: Change etc hosts

  2. Choose action in case of error: Stop on error

  3. Specify timeout: 600

  4. Choose region - choose primary one

  5. Switch to “Run local script”

  6. Choose an instance where the script is run: Control Center instance

  7. 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

  8. Specify user, under which the scripts were installed: opc

  9. 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:

  1. Name of the Plan Group: Start Dbvisit

  2. Switch to Add after

  3. choose Change etc hosts, so that the Stop Dbvisit job will start right after the “Change etc hosts” plan group

  4. Press Add Step button

During Plan step creation, fill in following:

  1. Name of the Plan Step: Start Dbvisit

  2. Choose action in case of error: Stop on error

  3. Specify timeout: 600

  4. Choose region - choose primary one

  5. Switch to “Run local script”

  6. Choose an instance where the script is run: Control Center instance

  7. Fill in the full path and name of the script: /home/opc/scripts/start_dbvisit.sh

  8. Specify user, under which the scripts were installed: opc

  9. 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:

  1. Step Name: Switchover

  2. Choose a Region where the step will be executed

  3. Choose “Run local script” option

  4. Select Control Center machine as a target of the script

  5. In the Script Parameters fill in following: /home/opc/scripts/switchover.sh <CONFIGURATION NAME>

  6. Choose user that executes the script: opc

  7. Press Add Step to create the step

  8. Confirm the Step Group creation by Pressing Add button.