Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2013
    Posts
    3

    Unanswered: Issue while db2relocatedb using for movement of containers

    I want to relocate tablespaces containers to a separate volume, i am using following procedure but unfortunately getting some error.

    Method db2relocatedb

    Configuration File

    $ cat relocatedb.cfg
    DB_NAME=FUNDAMO
    DB_PATH=/proddb
    INSTANCE=db2inst1
    STORAGE_PATH=/proddb/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005/C0000000.USR,/syslogs/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005/C0000000.USR


    Error
    ====
    $ db2relocatedb -f relocatedb.cfg

    DBT1006N The file/device "/syslogs/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005/C0000000.USR/db2inst1" could not be opened.


    Following is the releven information.

    $ db2 list active databases

    Active Databases

    Database name = FUNDAMO
    Applications connected currently = 0
    Database path = /proddb/db2inst1/NODE0000/SQL00001/



    $ db2 list tablespace containers for 5

    Tablespace Containers for Tablespace 5

    Container ID = 0
    Name = /proddb/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005/C0000000.USR
    Type = File



    Tablespace ID = 5
    Name = ALFPF
    Type = Database managed space
    Contents = All permanent data. Regular table space.
    State = 0x4000
    Detailed explanation:
    Offline


    Regards

    Syed Abul Farhan
    Database Administrator
    IBM Pakistan

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Should be:
    Code:
    STORAGE_PATH=/proddb/FUNDAMO,/syslogs/FUNDAMO
    and the instance owner must have appropriate permissions on /syslogs/FUNDAMO in OS of course.
    Regards,
    Mark.

  3. #3
    Join Date
    Sep 2013
    Posts
    3
    HI Mark

    Followng Error is reported afte making recommanded changes.
    Its seems that db2 goes to move all database talespace to newstorae path. while my requirment is to move specific tablespace on new storage path, please advise.

    NOTE:
    A bit change in my tesing, now i am using a new UAT server for this activity. following i have also attached new configration file.

    $ db2relocatedb -f relocatedb.cfg
    DBT1006N The file/device "/test/FUNTST/db2inst1/NODE0000/FUNTST/T0000000/C0000000.CAT" could not be opened.

    Configration File

    DB_NAME=FUNTST
    DB_PATH=/test
    INSTANCE=db2inst1
    STORAGE_PATH=/opt/FUNTST,/test/FUNTST

    $ db2 list tablespace containers for 4

    Tablespace Containers for Tablespace 4

    Container ID = 0
    Name = /opt/FUNTST/db2inst1/NODE0000/FUNTST/T0000004/C0000000.USR
    Type = File

  4. #4
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Abul,

    it seems that your tablespace uses automatic storage.
    You can check it by this query:
    Code:
    select TBSP_USING_AUTO_STORAGE from sysibmadm.snaptbsp where tbsp_id=5
    If so, you are not able to relocate this particular tablespace apart from other automatic storage tablespaces.
    If you want to relocate just this tablespace, don't use db2relocatedb.
    Just move all containers manually from:
    /proddb/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005
    to:
    /syslogs/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005
    and create a symlink:
    Code:
    ln -sf /syslogs/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005 /proddb/FUNDAMO/db2inst1/NODE0000/FUNDAMO/T0000005
    Regards,
    Mark.

  5. #5
    Join Date
    Sep 2013
    Posts
    3
    HI Mark

    I have checked the provided query on all tablespaces its values shows "1" that mean Automatic Storage is enable against them.
    The symbolic link is a good solution for temporary basis, is their any other way can i fix the solution on perminent basis because i am now going to deploy my database on production.

    I have also read alternate solution for it i.e. is Restore redirect. but unfortunatly it was not working. If you steps about it please post.

    thanks

    Farhan

  6. #6
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Quote Originally Posted by Abul Farhan View Post
    The symbolic link is a good solution for temporary basis, is their any other way can i fix the solution on perminent basis
    Farhan, another way is much more complex.
    If you want to have freedom to relocate the containers of a tablespace, you have to have it not using automatic storage.
    There is no easy way to convert an automatic storage tablespace to nonautomatic. You have to create a new tablespace, recreate and reload all your tables from the old one to achieve the goal. Manually or "semi-manually" using the ADMIN_MOVE_TABLE procedure.
    Regards,
    Mark.

Posting Permissions

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