move a tablespace (sms containers) to different location

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stefan.albert

    move a tablespace (sms containers) to different location

    Hi folks,
    we have 3 instances where a table space (good old SMS) lives in the
    wrong directory.
    Normally I simply would create a new one and do a INSERT ... SELECT
    for all tables (or a load ... from cursor). But we have different
    tables in the table space and I want to use the same "script" for all
    instances.
    So I had a look at db2relocate, which should do the trick. I have the
    following plan to do this:
    0) backup -- always good
    1) quiesce tablespace for table ONE.OF_THEM exclusive
    2) cp -p OLD_CONT_DIRs NEW_CONT_DIRs
    3) rename OLD_CONT_DIRs
    4) db2relocate -f reloc.cfg
    5) quiesce tablespace for table ONE.OF_THEM reset

    Does anybody have any experience with this? Or any further
    suggestions?
    Thanks in advance,
    Stefan
  • stefan.albert

    #2
    Re: move a tablespace (sms containers) to different location

    On Mar 18, 10:26 am, "stefan.alb ert" <stefan.alb...@ spb.dewrote:
    Hi folks,
    we have 3 instances where a table space (good old SMS) lives in the
    wrong directory.
    Normally I simply would create a new one and do a INSERT ... SELECT
    for all tables (or a load ... from cursor). But we have different
    tables in the table space and I want to use the same "script" for all
    instances.
    So I had a look at db2relocate, which should do the trick. I have the
    following plan to do this:
    0) backup -- always good
    1) quiesce tablespace for table ONE.OF_THEM exclusive
    2) cp -p OLD_CONT_DIRs NEW_CONT_DIRs
    3) rename OLD_CONT_DIRs
    4) db2relocate -f reloc.cfg
    5) quiesce tablespace for table ONE.OF_THEM reset
    >
    Does anybody have any experience with this? Or any further
    suggestions?
    Thanks in advance,
    Stefan
    Here my results :

    Step 2) failed - because DB2 holds a lock on the files.
    Step 1) db2stop (force)
    Step 5) db2start

    The file reloc.cfg defines the old and new locations.

    It worked fine for me.

    Comment

    Working...