The cubrid spacedb utility is used to check how much space of database volumes is being used. It shows a brief description of all permanent data volumes in the database. Information returned by the cubrid spacedb utility includes the ID, name, purpose and total/free space of each volume. You can also check the total number of volumes and used/unused database pages.
cubrid spacedb options database_name
options : [{-o|--output-file=}file] [-S|--SA-mode|-C|--CS-mode] [--size-unit=PAGE|M|G|T|H] [-s|--summarize]
Storing output messages to a file (-o)
The following syntax shows how to store the result of checking the space information of testdb to a file named db_output.
cubrid spacedb -o db_output testdb
Executing in stand-alone mode (-S or --SA-mode)
The -S option is used to access a database in standalone, which means it works without processing server; it does not have an argument. If -S is not specified, the system recognizes that a database is running in client/server mode.
cubrid spacedb --SA-mode testdb
Executing in client/server mode (-C or --CS-mode)
The -C option is used to access a database in client/server mode, which means it works in client/server process respectively; it does not have an argument. If -C is not specified, the system recognize that a database is running in client/server mode by default.
cubrid spacedb --CS-mode testdb
Outputing in specified size unit (--size-unit)
The --size-unit option is used to specify the size unit of the space information of the database to be one of PAGE, M(MB), G(GB), T(TB), H(print-friendly). The default value is H. If you set the value to H, the unit is automatically determined as follows: M if 1 MB = DB size < 1024 MB, G if 1 GB = DB size < 1024 GB.
cubrid spacedb --size_unit=M testdb
cubrid spacedb --size_unit=H testdb
Outputs total pages, used pages, free pages by volume usage (-s or --summarize)
Aggregates total_pages, used_pages and free_pages by DATA, INDEX, GENERIC, TEMP and TEMP TEMP, and outputs it.
cubrid spacedb –s testdb