The cubrid renamedb utility renames a database. The names of information volumes, log volumes and control files are also renamed to conform to the new database one.
The cubrid alterdbhost utility configures or changes the host name of the specified database. It changes the host name configuration in the databases.txt file.
cubrid renamedb options src_database_name dest_database_name
options : [{-E | --extended-volumn-path=}path ] [ {-i | --control-file=} file ] [-d | --delete-backup]
Saving the renamed extended volume to a new directory (-E or --extended-volume-path)
The following example shows how to rename an extended volume created in a specific directory path (e.g. /dbtemp/addvol/) with a -E option, and then moves the volume to a new directory. The -E option is used to specify a new directory path (e.g. /dbtemp/newaddvols/) where the renamed extended volume will be moved. If the -E option is not specified, the extended volume is only renamed in the existing path without being moved. If a directory path outside the disk partition of the existing database volume or an invalid one is specified, the rename operation is not executed. This option cannot be used together with the -i option.
cubrid renamedb -E /dbtemp/newaddvols/ testdb testdb_1
Specifying the input file where the directory information is stored (-i or --control-file)
The following example shows how to specify an input file in which directory information is stored to change all database name of volumes or files and assign different directory at once. To perform this work, the -i option is used. The -i option cannot be used together with the -E option.
cubrid renamedb -i rename_path testdb testdb_1
The followings are the syntax and example of a file that contains the name of each volume, the current directory path and the directory path where renamed volumes will be stored.
volid source_fullvolname dest_fullvolname
-5 /home1/user/testdb_vinf /home1/CUBRID/databases/testdb_1_vinf
-4 /home1/user/testdb_lginf /home1/CUBRID/databases/testdb_1_lginf
-3 /home1/user/testdb_bkvinf /home1/CUBRID/databases/testdb_1_bkvinf
-2 /home1/user/testdb_lgat /home1/CUBRID/databases/testdb_1_lgat
0 /home1/user/testdb /home1/CUBRID/databases/testdb_1
1 /home1/user/backup/testdb_x001/home1/CUBRID/databases/backup/testdb_1_x001
Deleting and renaming backup files simultaneously (-d or --delete-backup)
By using the -d option, the following example shows how to rename the testdb database and at once forcefully delete all backup volumes and backup information files that are in the same location as testdb. Note that you cannot use the backup files with the old names once the database is renamed. If the -d option is not specified, backup volumes and backup information files are not deleted.
cubrid renamedb -d testdb testdb_1