In this tutorial you will learn how to quickly create the demodb CUBRID demo database which comes with every installation of CUBRID. This assumes that you do not have demodb database already installed, which is usually automatically installed during CUBRID installation. If you have it installed, follow Getting started with demodb guide.
Note: For Ubuntu demodb can be installed using sudo apt-get cubrid-demodb (Installing CUBRID on Ubuntu)
The demodb database files are included in CUBRID binaries. Therefore when you install CUBRID, the demodb files can be found in /demo directory inside the directly where you installed CUBRID. To find where CUBRID has been installed type $CUBRID in the command line. This will give you the directory where CUBRID files reside.
In the /demo directory you will find two files:
Before creating any database, you need to decide in which directory you would like to keep its files. In this tutorial let's assume we want to keep files for this database in our user's home directory in "CUBRID_databases" directory.
cd ~ mkdir CUBRID_databases cd CUBRID_databases mkdir demodb cd demodb
Now run the following command when you are in /demodb directory to create the demodb database.
cubrid createdb --db-volume-size=100M --log-volume-size=100M demodb
This will create the demodb database and allocate 100 megabytes of disk space (DB Volume) for it. For this demo database 100M is enough. For other databases you create, you can adjust these values. See Creating Database manual page.
Now load both demodb_schema and demodb_objects files into the newly created demodb database.
cubrid loaddb -u dba -s $CUBRID/demo/demodb_schema -d $CUBRID/demo/demodb_objects demodb
This will load all the demodb database's data into CUBRID Server. dba will become the owner of this database with a blank password.
Congratulations! Now CUBRID demodb database has been loaded and ready to be explored!
At this moment you may want to continue to Getting started with demodb tutorial.