The cubrid checkdb utility is used to check the consistency of a database. You can use cubrid checkdb to identify data structures that are different from indexes by checking the internal physical consistency of the data and log volumes. If the cubrid checkdb utility reveals any inconsistencies, you must try automatic repair by using the --repair option.
cubrid checkdb options database_name [class_name1 class_name2 ...]
options : [-S|--SA-mode | -C|--CS-mode] [-r | --repair] | [-i table_list.txt|--input-class-file]
Checking the database consistency in standalone 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 checkdb -S testdb
Checking the database consistency 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 checkdb -C testdb
Restoring in case of a database consistency problem (-r or --repair)
The -r option is used to restore an issue if a consistency error occurs in a database.
cubrid checkdb -r testdb
Specifying a table in which consistency is checked or restored (-i, --input-class-file or table name)
You can specify a table in which consistency is check or restored by specifying the -i table_list.txt option or listing the table names after a database name. In this way, you can limit the target to be restored and both ways can be used. If a specific target is not specified, entire database will be a target of consistency check or restoration.
cubrid checkdb testdb tbl1 tbl2
cubrid checkdb -r testdb tbl1 tbl2
cubrid checkdb -r -i tbl_list.txt testdb tbl1 tbl2
Empty string, tab, carriage return and comma are separators among table names in the table list file specified by -i option. The following example shows the table list file; from t1 to t10, it is recognized as a table for consistency check or restoration.
t1 t2 t3,t4 t5
t6, t7 t8 t9