Rename database DB2
Is common practice to require a replica of a database on another different environment, and also require that the new database has a new name. For example, to update a pre-production database, backing up SAP homogeneous or simply to change the name of the database for any need.
The utility “db2relocatedb” is used to perform the following functions:
- Rename database name
- Change log directory
- Change db_path
- Change location of storage properties for containers/directories
In this article we explain the first function, although its implementation is really simple.
Just create a configuration file (chg_config.txt) with the following values:
In each propertie, first the old value and a comma followed by the new value. If it have no change, just the current value.
Then, with the instance off (db2stop) run the db2relocatedb:
db2relocatedb -f chg_config.cfg
It’s simple ….