DB2 Commands: db2relocatedb

You may also like...

8 Responses

  1. Abul Farhan says:

    Need Help,

    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
    $ 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:

  2. Abul Farhan says:

    $ db2relocatedb -f relocatedb.cfg

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

    • Ember Crooks says:

      Is the database currently using AST for the tablespace in question? It looks to me as though it is expecting storage paths, and you are providing container paths.

      • syef@pkibm.com says:

        I am not clear about AST for tablespaces pleasegive me moredetails about AST.

        While it is fact i am providing containers path because in documentation i found the same.
        MY key object to relocate tablespace to balance Filesystem I/O. some of critical tablespace i want to move on seprate filesystem.
        Please Advise.
        Also let me know i will storage path then how i will create stoareg path. before executing db2relocatedb.

        • Ember Crooks says:

          I would recommend posing the question on one of the forums – db2-l or dba.stackexchange.com or developerWorks forums. I’ve never seen this particular error before.

  3. Kovthe says:

    Hi Ember,

    My db2relocatedb command ran successfully. The database which I relocated was primary database in hadr setup. After relocating, when i check the hadr status, it’s up and working, but when i list the db directory, its displays just the new db name. My question is, when the db sample got relocated, and it did not had a catalog entry, how the activate and db2pd command on db sample(old name) worked. Below are the steps I peformed

    [db2inst1@labserver ~]$ db2 deactivate db sample
    DB20000I The DEACTIVATE DATABASE command completed successfully.
    [db2inst1@labserver ~]$ db2relocatedb -f relocatedb.cfg
    Files and control structures were changed successfully.
    Database was catalogued successfully.
    DBT1000I The tool completed successfully.
    [db2inst1@labserver ~]$ db2 activate db sample
    DB20000I The ACTIVATE DATABASE command completed successfully.
    [db2inst1@labserver ~]$ db2pd -db sample -hadr

    Database Partition 0 — Database SAMPLE — Active — Up 0 days 00:00:12 — Date 2014-11-24-

    HADR Information:
    Role State SyncMode HeartBeatsMissed LogGapRunAvg (bytes)
    Primary Peer Sync 0 0

    ConnectStatus ConnectTime Timeout
    Connected Mon Nov 24 12:11:08 2014 (1416811268) 120

    LocalHost LocalService
    labserver DB2_db2inst1_1

    RemoteHost RemoteService RemoteInstance
    labserver DB2_db2inst4_1 db2inst4

    PrimaryFile PrimaryPg PrimaryLSN
    S0000088.LOG 0 0x0000000018E70010

    StandByFile StandByPg StandByLSN
    S0000088.LOG 0 0x0000000018E70010
    [db2inst1@labserver ~]$ db2 list db directory

    System Database Directory

    Number of entries in the directory = 1

    Database 1 entry:

    Database alias = TESTDB
    Database name = TESTDB
    Local database directory = /home/db2inst1
    Database release level = d.00
    Comment =
    Directory entry type = Indirect
    Catalog database partition number = 0
    Alternate server hostname =
    Alternate server port number =

    My relocatedb cfg is


    SAMPLE database was also defined in /home/db2inst1

    • Ember Crooks says:

      Unfortunately, I don’t have an answer for you on that one. Though I’d love to hear it when you do find one. You might consider asking IBM support. I usually find sev 4 pmrs frustrating, but can sometimes get the answer I need out of them.

Leave a Reply

Your email address will not be published. Required fields are marked *