IBM Support

LI73168: DB2RELOCATEDB DOES NOT CHANGE DATABASE NAME IN AUTOMATIC STORAGE PATHS WHEN INSTANCE NAME IS ALSO CHANGED

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using db2relocatedb to change instance name and database
    name, the path of containers of tablespaces that use automatic
    storage
    will not get the database name changed as expected from
    old_storage_path/old_instance_name/NODExxxx/old_database_name/ta
    blespace_dir/container
    to
    new_storage_path/new_instance_name/NODExxxx/new_database_name/ta
    blespace_dir/container. Temporary SMS tablespaces will show the
    right
    expected path as they will get recreated on connection to the
    database.
    
    Example:
    We have the following tablespaces and containers:
    SYSCATSPACE (DMS):
    /db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P/T0000000/C0000000
    .CAT
    /db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P/T0000000/C0000001
    .CAT
    /db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P/T0000000/C0000002
    .CAT
    /db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P/T0000003/C0000000
    .TMP
    /db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P/T0000003/C0000001
    .TMP
    /db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P/T0000003/C0000002
    .TMP
    /db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P/T0000003/C0000003
    .TMP
    
    The relocation file (db2relocatedb.conf)contains the following
    entries:
    DB_NAME=O6P,O5T
    INSTANCE=db2o6p,db2o5t
    DB_PATH=/db2/O6P,/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1,/db2/O5T/sapdata1/sapdat
    a1
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2,/db2/O5T/sapdata1/sapdat
    a2
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3,/db2/O5T/sapdata1/sapdat
    a3
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4,/db2/O5T/sapdata1/sapdat
    a4
    
    The procedure before running db2relocatedb is to move all the
    database files and contents
    to the target directories.
    The target directories/files in this case should be
    
    SYSCATSPACE (DMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000000/C0000000
    .CAT
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000000/C0000001
    .CAT
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000000/C0000002
    .CAT
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    
    but if we run db2relocatedb -f db2relocatedb.conf
    we will get the error:
    
    DBT1006N  The file/device
    "/db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000000/C000000
    0.CAT" could not be opened.
    Due to the fact that we are not changing the database name after
    NODE0000 (as expected) and we are looking for the wrong file.
    
    If we just move the directories from STORAGE_PATH (old) to
    STORAGE_PATH (new) but without changing anything else:
    /db2/O6P/sapdata1/sapdata<n>/db2o6p
    to
    /db2/O5T/sapdata1/sapdata<n>/db2o5t
    
    After running db2relocatedb -f db2relocatedb.conf and connecting
    to the database O6P we will have:
    SYSCATSPACE (DMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000000/C0000000
    .CAT
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O6P/T0000000/C0000001
    .CAT
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O6P/T0000000/C0000002
    .CAT
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O6P/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    
    The SMS containers show the right path. This is due to the fact
    that temporary SMS tablespaces are picking up the new
    STORAGE_PATH and
    get recreated on
    new_storage_path/new_instance_name/NODExxxx/new_database_name/ta
    blespace_dir/container, but this is an effect of connecting
    to the new database, db2relocatedb tool did not change the
    database name as expected so we would have:
    
    after running db2relocatedb:
    These files exist:
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O6P/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O6P/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O6P/T0000003/C0000003
    .TMP
    
    after connecting to the database O5T
    The above files do not exist and got replaced with:
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    

Local fix

  • Run db2relocatedb tool first with STORAGE_PATH set to the whole
    path of the containers and then with STORAGE_PATH set to the new
    storage path but without changing instance name or database
    name.
    
    Example:
    db2relocatedb.conf1:
    
    DB_NAME=O6P,O5T
    INSTANCE=db2o6p,db2o5t
    DB_PATH=/db2/O6P,/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata4 /db2o5t/NODE0000/O5T
    
    db2relocatedb.conf2
    DB_NAME=O5T
    INSTANCE=db2o5t
    DB_PATH=/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1,/db2/O5T/sapdata1/sapdat
    a1
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2,/db2/O5T/sapdata1/sapdat
    a2
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3,/db2/O5T/sapdata1/sapdat
    a3
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4,/db2/O5T/sapdata1/sapdat
    a4
    
    (this is not changing instance name or database name as it has
    already been done it just changes the storage path for the
    database which will affect temporary SMS tablespaces)
    
    Run:
    db2relocatedb -f db2relocatedb.conf1
    db2relocatedb -f db2relocatedb.conf2
    

Problem summary

  • User Affected: ALL
    Problem Description:
    DB2RELOCATEDB DOES NOT CHANGE DATABASE NAME IN AUTOMATIC STORAGE
    PATHS WHEN INSTANCE NAME IS ALSO CHANGED
    Problem Summary:
    ERROR DESCRIPTION:
    When using db2relocatedb to change instance name and database
    name, the path of containers of tablespaces that use automatic
    storage
    will not get the database name changed as expected from
    old_storage_path/old_instance_name/NODExxxx/old_database_name/ta
    blespace_dir/container
    to
    new_storage_path/new_instance_name/NODExxxx/new_database_name/ta
    blespace_dir/container. Temporary SMS tablespaces will show the
    right
    expected path as they will get recreated on connection to the
    database.
    
    Example:
    We have the following tablespaces and containers:
    SYSCATSPACE (DMS):
    /db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P/T0000000/C0000000
    .CAT
    /db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P/T0000000/C0000001
    .CAT
    /db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P/T0000000/C0000002
    .CAT
    /db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P/T0000003/C0000000
    .TMP
    /db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P/T0000003/C0000001
    .TMP
    /db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P/T0000003/C0000002
    .TMP
    /db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P/T0000003/C0000003
    .TMP
    
    The relocation file (db2relocatedb.conf)contains the following
    entries:
    DB_NAME=O6P,O5T
    INSTANCE=db2o6p,db2o5t
    DB_PATH=/db2/O6P,/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1,/db2/O5T/sapdata1/sapdat
    a1
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2,/db2/O5T/sapdata1/sapdat
    a2
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3,/db2/O5T/sapdata1/sapdat
    a3
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4,/db2/O5T/sapdata1/sapdat
    a4
    
    The procedure before running db2relocatedb is to move all the
    database files and contents
    to the target directories.
    The target directories/files in this case should be
    
    SYSCATSPACE (DMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000000/C0000000
    .CAT
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000000/C0000001
    .CAT
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000000/C0000002
    .CAT
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    
    but if we run db2relocatedb -f db2relocatedb.conf
    we will get the error:
    
    DBT1006N  The file/device
    "/db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000000/C000000
    0.CAT" could not be opened.
    Due to the fact that we are not changing the database name after
    NODE0000 (as expected) and we are looking for the wrong file.
    
    If we just move the directories from STORAGE_PATH (old) to
    STORAGE_PATH (new) but without changing anything else:
    /db2/O6P/sapdata1/sapdata<n>/db2o6p
    to
    /db2/O5T/sapdata1/sapdata<n>/db2o5t
    
    After running db2relocatedb -f db2relocatedb.conf and connecting
    to the database O6P we will have:
    SYSCATSPACE (DMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000000/C0000000
    .CAT
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O6P/T0000000/C0000001
    .CAT
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O6P/T0000000/C0000002
    .CAT
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O6P/T0000000/C0000003
    .CAT
    
    PSAPTEMP16 (SMS):
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    
    The SMS containers show the right path. This is due to the fact
    that temporary SMS tablespaces are picking up the new
    STORAGE_PATH and
    get recreated on
    new_storage_path/new_instance_name/NODExxxx/new_database_name/ta
    blespace_dir/container, but this is an effect of connecting
    to the new database, db2relocatedb tool did not change the
    database name as expected so we would have:
    
    after running db2relocatedb:
    These files exist:
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O6P/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O6P/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O6P/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O6P/T0000003/C0000003
    .TMP
    
    after connecting to the database O5T
    The above files do not exist and got replaced with:
    /db2/O5T/sapdata1/sapdata4/db2o5t/NODE0000/O5T/T0000003/C0000000
    .TMP
    /db2/O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T/T0000003/C0000001
    .TMP
    /db2/O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T/T0000003/C0000002
    .TMP
    /db2/O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T/T0000003/C0000003
    .TMP
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, FixPak 2
    

Temporary fix

  • LOCAL FIX:
    Run db2relocatedb tool first with STORAGE_PATH set to the whole
    path of the containers and then with STORAGE_PATH set to the new
    storage path but without changing instance name or database
    name.
    
    Example:
    db2relocatedb.conf1:
    
    DB_NAME=O6P,O5T
    INSTANCE=db2o6p,db2o5t
    DB_PATH=/db2/O6P,/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata1/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata2/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata3/db2o5t/NODE0000/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4/db2o6p/NODE0000/O6P,/db2
    /O5T/sapdata1/sapdata4 /db2o5t/NODE0000/O5T
    
    db2relocatedb.conf2
    DB_NAME=O5T
    INSTANCE=db2o5t
    DB_PATH=/db2/O5T
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata1,/db2/O5T/sapdata1/sapdat
    a1
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata2,/db2/O5T/sapdata1/sapdat
    a2
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata3,/db2/O5T/sapdata1/sapdat
    a3
    STORAGE_PATH=/db2/O6P/sapdata1/sapdata4,/db2/O5T/sapdata1/sapdat
    a4
    
    (this is not changing instance name or database name as it has
    already been done it just changes the storage path for the
    database which will affect temporary SMS tablespaces)
    
    Run:
    db2relocatedb -f db2relocatedb.conf1
    db2relocatedb -f db2relocatedb.conf2
    

Comments

APAR Information

  • APAR number

    LI73168

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-02-21

  • Closed date

    2008-08-28

  • Last modified date

    2008-08-28

  • APAR is sysrouted FROM one or more of the following:

    LI71969

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
28 August 2008