Skip to Content

Rename (relocate) a database

I have never used the 'relocate' command so I ask this question.

After reading all the information available I have to ask, does this work as expected or is this more involved than it looks? Once the system is tested it would be changed back to the old name.

I understand that making the change to the transport directory would be necessary plus new profiles, etc.

Example: T02 > Q03

Config file:

DB_NAME=T02, T03

DB_PATH=/db2/db2t02

INSTANCE=db202

NODENUM=0

Thanks,

Len Jesse


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on May 13, 2014 at 01:16 PM

    That's definitely not enough. You must also rename tablespaces , views etc. Schema is not able to be renamed in db2. But all those tasks you can do using SPM tool https://service.sap.com/sltoolset under "System rename" option - i've done it few times recently as it was only option for "redirect restore" with copyng production into test in our client environment.

    Just read System rename manual and reserve few days for this fun 😊

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 13, 2014 at 06:56 AM

    Hi Len,

    As per IBM documentation

    db2relocatedb - Relocate Database Command

    This command renames a database, or relocates a database or part of a database 9 (for example, the container and the log directory) as specified in the configuration file provided by the user. This tool makes the necessary changes 9 to the DB2 instance and database support files.

    Sample configuration file can be as mentioned in the link

    DB2 Universal Database

    You may test the command on a sandbox environment to identify the exact set of activities required to be performed to achieve the expected results.

    Hope this helps.

    Regards,

    Deepak Kori

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.