Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367

    Unanswered: change location of tablespaces and active logs for HADR pair

    I need to upgrade DB2 and change the filesystems (relocate tablespaces, active logs). This is an HADR pair. I've never done this for an HADR setup before.

    What I'm planning to do is:

    - Deactivate db / stop hadr on primary and standby and rollforward db on standby. (db's are in peer state prior to stopping hadr)
    - Take offline db backup from primary and standby
    - Restore each db (leaving standby in rollforward pending) and redefine tablespaces / active log dir. The manual mentions:

    "The following RESTORE DATABASE command options should be avoided when setting up the standby database: TABLESPACE, INTO, REDIRECT, and WITHOUT ROLLING FORWARD."

    My restore command won't use any of these options.

    - Start HADR on primary/standby.


    Questions:
    When deactivate db / stop hadr command is issued on primary, does db2 make sure all log records have been replayed on standby prior to stopping it (SYNC mode)?

    Is it ok to restore backup from primary on primary and backup from standby on standby and start HADR or should I restore primary, take a new backup (containing new location of tbs/active logs) and use it to reinitialize standby?
    Last edited by db2girl; 10-19-12 at 15:01.

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    I created a test db and tried my steps. It worked, but I don't know if this is safe to do for the real db. All applications will be shutdown prior to this change, but I think it's better to use the backup from primary to re-initialize HADR. What do you think?


    Here's what I tried:

    PRIMARY:
    db2 deactivate db test
    db2 stop hadr on db test


    STANDBY:
    db2 deactivate db test
    db2 stop hadr on db test
    db2 rollforward db test to end of logs and stop
    db2 backup db test
    db2 drop db test
    db2 restore db test on /xxx/db2/data newlogpath /xxx/db2/log/active/db2inst1/TEST/NODE0000
    db2 start hadr on db test as standby


    PRIMARY:
    db2 backup db test
    db2 drop db test
    db2 restore db test on /xxx/db2/data newlogpath /xxx/db2/log/active/db2inst1/TEST/NODE0000 without rolling forward
    db2 start hadr on db test as primary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •