## Checking Database Structures

### Purpose

In a database structure check, the database system checks if the database structures are consistent (such as the consistency of the B* trees, see Logical Access Structures), but it does not check the semantics of the data model. You cannot, therefore, find any logical errors with a database structure check.

We recommend that you check the database structure once a week. To avoid disrupting operation, you can perform the database structure check on a database copy.

You should perform an unscheduled database structure check if you receive one of the following error messages: -9053: Data page corrupted, -9023: Illegal entrypos, -9003: Illegal entrylength, -9006: Illegal keylength, -9041: Index not accessible

### Process Flow

To start the database structure check, use the Database Manager database tool or CCMS in SAP systems.

Database Manager GUI, Checking Database Structures

● Database Administration in CCMS,

Scheduling a Database Structure Check

○ Tables/Views/Synonyms (checking a single table)

You choose one of the following functions:

Functions for Checking Database Structures

Function | Description

Checking all data in the ONLINE operational state

In the ONLINE operational state, the database system checks the structural consistency of all the tables, indexes LONG columns etc. in the cache and the data area.

Whenever the database system reads data pages from the data area, it calculates a checksum that has to match the checksum saved on the page.

The database system does a complete run through all B* trees and page chains. It checks whether all the pages of the B* trees and page chains can be accessed and whether the administration structures (for example the separators on the B* tree index level) on the pages are intact.

It also checks the length and ascending order of the keys.

Checking all the data and cleaning up the converter in the ADMIN operational state

In the ADMIN operational state, the database system initially performs the same checks as in the ONLINE operational state.

Then the database system cleans the converter based on the results of the checks: It deletes all the pages that it didn’t read during the check, that is, those that no longer exist in the dataset.

Checking a selected table in the ONLINE operational state | In the ONLINE operational state, you can also examine an individual table. The database system performs the same checks as during the check of the entire dataset in the ONLINE operational state. You can also check all LONG values and the database catalog for individual tables.

### Result

The database system lists all the commands used in the database structure check in the log files DBM.UTL and DBM.PRT; errors and return codes are also logged there.

Return code 0 means that the database system found no errors during the database structure check. If the database structure check returns any other error code, proceed as described in the section Fixing Errors in the Data Structure.

### Example

Example: Error in the Data Structure

See also:

Troubleshooting

Log Files