Server1 is the primary and Server2 is the standby.
1. Online backup of the database on Server1. This is a small database and it takes 2 minutes to backup.
-
=>db2 backup db ITIMDB online compress
2. Copy the backup image from Server 1 to Server 2
3. From Server2, generate a redirected restore script using the newly copied backup.
-
=>db2 restore db ITIMDB from /db2backups redirect generate script restore.ddl
4. Edit the script to restore the db using the ON and DBPATH ON paramaters set to the new filesystem
5. Stop HADR on the standby (Server2)
-
=>db2 deactivate db ITIMDB
-
=>db2 stop hadr on db ITIMDB
6. Drop the database on the standby (Server2)
-
=>db2 drop db ITIMDB
7. Restore the database by running the redirect restore script (restore.ddl) on Server2
-
=>db2 -tvf restore.ddl
8. Once the restore finishes, edit the HADR settings on Server2
-
=>db2 update db cfg for ITIMDB using HADR_LOCAL_HOST SERVER2 HADR_REMOTE_HOST SERVER1
9. Start HADR on the standby (Server2)
-
=>db2 start hadr on db ITIMDB as standby
10. Once they are in PEER state, Takeover the database on Server2 so the same steps can take place on Server1. Run this from Server2
-
=>db2 takeover HADR on db ITIMDB
11. Now take an online backup of the database on Server2
-
=>db2 backup db ITIMDB online compress
12. Copy the new backup from Server2 to Server1
13. From Server1, generate a redirected restore script using the fresh backup.
-
=>db2 restore db ITIMDB redirect generate script restore.ddl
14. Edit the script to restore the db using the ON and DBPATH ON paramaters set to the new filesystem.
15. Stop HADR on the standby (Server1)
-
=>db2 deactivate db ITIMDB
-
=>db2 stop hadr on db ITIMDB
16. Drop the database on the standby (Server1)
-
=>db2 drop db ITIMDB
17. Restore the database by running the redirect restore script (restore.ddl)
-
=>db2 -tvf restore.ddl
18. Once the restore finishes, edit the HADR settings
-
=>db2 update db cfg for ITIMDB using HADR_LOCAL_HOST server1 HADR_REMOTE_HOST server2
19. Start HADR on the standby (Server1)
-
=>db2 start hadr on db ITIMDB as standby
20. Once they are in PEER state, Takeover the database on Server1.
-
=>db2 takeover HADR on db ITIMDB