We are going to run a load simulation test in prod and need to plan in the event of a rollback. Right now the plan is to run a backup before the test start on the primary db and turn off the secondary db. If there are no issues we just restart the secondary db and let the logs apply. But if we need to rollback we were looking at either restoring the primary using the backup OR take a backup of the secondary db and use this to restore the primary. The issue with the later is that we wouldn't want the secondary db to have logs applied from the primary db once we db2start the secondary.
My question is are there any gotchas I need to plan for when restoring an HADR? Can I just restore the primary and db2start the secondary db server and I'm done? or do I need to restore both servers using my backup file from the Primary? Can I use the secondary server as a backup db?
You can try the following:
1. Takeover hard on standby
2. Deactivate db on both and move the archived logs on primary to use them later
3. Restore db on the primary after testing, remove all logs from active & archive paths with the same & greater numbers as your saved logs at step 2
4. Move the logs saved at step 2 back
5. On primary: Start hard as standby
6. On standby: start hadr as primary
Based on your description sounds like you want to make your changes on primary, but not sure if you want them applied on standby yet. If that is the case, I think what you are wanting to do is something like:
1. Deactivate DB on standby server.
2. Stop HADR on Primary
3. Perform your changes on Primary
4. Verify your changes
Do wish to proceed with your changes?
5. Start HADR on primary
6. Activate DB on your standby
5. Perform HARD takeover on standby
6. Perform Restore on old Primary and bring up as standby in HADR config
7. Once in Peer mode can takeover on original Primary or leave as is.