12.7. The db2relocatedb UtilityThe db2relocatedb utility renames a database and relocates a database or part of a database you specify in the configuration file. This tool makes the necessary changes to the DB2 instance and database files. You can alter the following properties of a database using the db2relocatedb utility:
The syntax for the db2relocatedb command is db2relocatedb f configuration_file_name The format of the configuration file is DB_NAME=oldName,newName DB_PATH=oldPath,newPath INSTANCE=oldInst,newInst NODENUM=nodeNumber LOG_DIR=oldDirPath,newDirPath CONT_PATH=oldContPath1,newContPath1 CONT_PATH=oldContPath2,newContPath2 ... If the sample database belongs to instance db2inst1 and was created under /data, to rename the sample database to sample1, edit a configuration file as follows and run the db2relocatedb command using this file: DB_NAME=SAMPLE,SAMPLE1 DB_PATH=/data INSTANCE=db2inst1 To move the sample database from the instance db2inst1 on path /data to instance db2inst2 on the same path, do the following:
If the sample database belongs to instance db2inst1, was created under /data, and has a SMS table space container /home/db2inst1/ts1 must be moved to /home/db2inst1/ts/ts1, do the following:
Refer to the file Command_and_SQL_Examples.pdf included with the CD-ROM accompanying this book for more examples on how to use db2relocatedb. |