---
title: "Diagnostics: checkdb, diagdb, paramdump"
description: "Check database consistency with coradb checkdb, dump internal structures with coradb diagdb, and print the effective system parameters with coradb paramdump."
url: "https://www.coradb.ai/manual/admin/admin_diag.html"
markdown_url: "https://www.coradb.ai/manual/markdown/admin/admin_diag.md"
product: "CoraDB"
version: "1.0"
keywords: "coradb checkdb, coradb diagdb, coradb paramdump, database consistency check, index check, dump parameters"
---

# Diagnostics: checkdb, diagdb, paramdump

## checkdb

The **coradb checkdb** utility is used to check the consistency of a database. You can use **coradb checkdb** to identify data structures that are different from indexes by checking the internal physical consistency of the data and log volumes. If the **coradb checkdb** utility reveals any inconsistencies, you must try automatic repair by using the --**repair** option.

``` bash
coradb checkdb [options] database_name [table_name1 table_name2 ...]
```

- **coradb**: An integrated utility for CoraDB service and database management.
- **checkdb**: A utility that checks the data consistency of a specific database.
- *database_name*: The name of the database whose consistency status will be either checked or restored.
- *table_name1 table_name2*: List the table names for consistency check or recovery

The following shows \[options\] available with the **coradb checkdb** utility.

**-S, --SA-mode**

This 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.

``` bash
coradb checkdb -S testdb
```

**-C, --CS-mode**

This 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.

``` bash
coradb checkdb -C testdb
```

**-r, --repair**

This option is used to restore an issue if a consistency error occurs in a database.

``` bash
coradb checkdb -r testdb
```

**--check-prev-link**

This option is used to check if there are errors on previous links of an index.

``` bash
$ coradb checkdb --check-prev-link testdb 
```

**--repair-prev-link**

This option is used to restore if there are errors on previous links of an index.

``` bash
$ coradb checkdb --repair-prev-link testdb
```

**-i, --input-class-file=FILE**

You can specify tables to check the consistency or to restore, by specifying the **-i** *FILE* option or listing the table names after a database name. Both ways can be used together. If a target is not specified, entire database will be a target of consistency check or restoration.

``` bash
coradb checkdb testdb tbl1 tbl2
coradb checkdb -r testdb tbl1 tbl2
coradb checkdb -r -i table_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.

``` text
t1 t2 t3,t4 t5
t6, t7 t8   t9

     t10
```

**--check-file-tracker**

Check about all pages of all files in file-trackers.

**--check-heap**

Check about all heap-files.

**--check-catalog**

Check the consistency about catalog information.

**--check-btree**

Check the validity about all B-tree indexes.

**--check-class-name**

Check the identical between the hash table of a class name and the class information(oid) brought from a heap file.

**--check-btree-entries**

Check the consistency of all B-tree entries.

**--check-graph**

Checks the graph data of vertex and edge tables: the in-memory graph, the graph data on disk, and that both are in sync. The three checks can also be run one at a time:

| Option | Checks |
|---|---|
| **--check-graph-in-memory** | The consistency of the in-memory graph |
| **--check-graph-disk** | The consistency of the graph data on disk |
| **--check-graph-sync-disk-mem** | That the in-memory graph matches the data on disk |

**--check-level=LEVEL**

The intensity of the graph checks, 1 or 2; the default is the highest level.

**-I, --index-name=INDEX_NAME**

Check if the index specified with this option about checking table. If you use this option, there is no heap validation check. Only one table and one index are permitted when you use this option; if you don't input a table name or input two tables, an error occurs.


## diagdb

You can check various pieces of internal information on the database with the **coradb diagdb** utility. Information provided by **coradb diagdb** is helpful in diagnosing the current status of the database or figuring out a problem.

``` bash
coradb diagdb options database_name
```

- **coradb**: An integrated utility for the CoraDB service and database management.
- **diagdb**: A command that is used to check the current storage state of the database by Dumping the information contained in the binary file managed by CoraDB in text format. It normally executes only when the database is in a stopped state. You can check the whole database or the file table, file size, heap size, class name or disk bitmap selectively by using the provided option.
- *database_name*: The name of the database whose internal information is to be diagnosed.

The following shows \[options\] available with the **coradb diagdb** utility.

**-d, --dump-type=TYPE**

This option specifies the output range when you display the information of all files in the *testdb* database. If any option is not specified, the default value of -1 is used.

``` bash
coradb diagdb -d 1 testdb
```

The utility has 9 types of **-d** options as follows:

|      |                                      |
|------|--------------------------------------|
| Type | Description                          |
| -1   | Displays all database information.   |
| 1    | Displays file table information.     |
| 2    | Displays file capacity information.  |
| 3    | Displays heap capacity information.  |
| 4    | Displays index capacity information. |
| 5    | Displays class name information.     |
| 6    | Displays disk bitmap information.    |
| 7    | Displays catalog information.        |
| 8    | Displays log information.            |
| 9    | Displays heap information.           |

**-o, --output-file=FILE**

The **-o** option is used to store information of the parameters used in the server/client process of the database into a specified file. The file is created in the current directory. If the **-o** option is not specified, the message is displayed on a console screen.

``` bash
coradb diagdb -d8 -o logdump_output testdb
```

**--emergency**

Use **--emergency** option to suppress recovery. **This option is meant ONLY for debugging, if there are recovery issues. It is recommended to backup your database before using this option.**


## paramdump

The **coradb paramdump** utility outputs parameter information used in the server/client process.

``` bash
coradb paramdump [options] database_name
```

- **coradb**: An integrated utility for the CoraDB service and database management
- **paramdump**: A utility that outputs parameter information used in the server/client process
- *database_name*: The name of the database in which parameter information is to be displayed.

The following shows \[options\] available with the **coradb paramdump** utility.

**-o, --output-file=FILE**

The **-o** option is used to store information of the parameters used in the server/client process of the database into a specified file. The file is created in the current directory. If the **-o** option is not specified, the message is displayed on a console screen.

``` bash
coradb paramdump -o db_output testdb
```

**-b, --both**

The **-b** option is used to display parameter information used in server/client process on a console screen. If the **-b** option is not specified, only server-side information is displayed.

``` bash
coradb paramdump -b testdb
```

**-S, --SA-mode**

This option displays parameter information of the server process in standalone mode.

``` bash
coradb paramdump -S testdb
```

**-C, --CS-mode**

This option displays parameter information of the server process in client/server mode.

``` bash
coradb paramdump -C testdb
```
