CUBRID stores information on the locations of all existing databases in the databases.txt file. This file is called the "database location file." A database location file is used when CUBRID executes utilities for creating, renaming, deleting or replicating databases; it is also used when CUBRID runs each database. By default, this file is located in the databases directory under the installation directory. The directory is located through the environment variable CUBRID_DATABASES.
db_name db_directory server_host logfile_directory
The format of each line of a database location file is the same as defined by the above syntax; it contains information on the database name, database path, server host and the path to the log files. The following example shows how to check the contents of a database location file.
% more databases.txt
dist_testdb /home1/user/CUBRID/bin d85007 /home1/user/CUBRID/bin
dist_demodb /home1/user/CUBRID/bin d85007 /home1/user/CUBRID/bin
testdb /home1/user/CUBRID/databases/testdb d85007 /home1/user/CUBRID/databases/testdb
demodb /home1/user/CUBRID/databases/demodb d85007 /home1/user/CUBRID/databases/demodb
By default, the database location file is stored in the databases directory under the installation directory. You can change the default directory by modifying the value of the CUBRID_DATABASES environment variable. The path to the database location file must be valid so that the cubrid utility for database management can access the file properly. You must enter the directory path correctly and check if you have write permission on the file. The following example shows how to check the value configured in the CUBRID_DATABASES environment variable.
% set | grep CUBRID_DATABASES
An error occurs if an invalid directory path is set in the CUBRID_DATABASES environment variable. If the directory path is valid but the database location file does not exist, a new location information file is created. If the CUBRID_DATABASES environment variable has not been configured at all, CUBRID retrieves the location information file in the current working directory.