cancel
Showing results for 
Search instead for 
Did you mean: 

Rename (relocate) a database

former_member283840
Participant
0 Kudos

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


Accepted Solutions (1)

Accepted Solutions (1)

MarcinOzdzinski
Participant
0 Kudos

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

former_member283840
Participant
0 Kudos

Marcin;

Thanks for getting back to me.

So you have done this?  OK I have read all the documentation that I can but this is a nail biter for me.  It seems to me that for all that you have to do it can be real complicated.  Did you rename profiles and other files?

The link is very helpful.

Thanks,

Len.

MarcinOzdzinski
Participant
0 Kudos

Yes 4 times recently. Process is fully automatic - you are renaming ASCS DB and CI instances due to Rename system guide - all you have to do is provide new SID and users credentials. Only manual acttivity is to provide source db file with tablespaces names - it is described inside guide.

DB and sap instance files are renamed (basically installed again in SAP folders) automatically. At the end you will get completely renamed both SAP and DB instance.

Good luck.

MArcin

One good advice - materialize all virtual tables before rename start on source system - otherwise reserve few more days in worst scenario

former_member283840
Participant
0 Kudos

Marcin;

Thanks for the follow-up. I am looking to do this for 1 of our SAP databases. You comments and tips are very helpful.

Len.

Answers (1)

Answers (1)

former_member188883
Active Contributor
0 Kudos

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

former_member283840
Participant
0 Kudos

Deepak;

Thanks as I have already done all that.  I was looking for an answer from someone who has done this command with success.

Len.