mi_integer am_check(MI_AM_TABLE_DESC *tableDesc, mi_integer option)
A user, generally a system administrator or operator, runs the oncheck utility to verify physical data structures. The options that follow the oncheck command indicate the kind of checking to perform. For information about oncheck options, refer to the IBM Informix: Administrator's Reference.
In response to an oncheck command, the database server calls the am_check purpose function, which checks the internal consistency of the table and returns a success or failure indicator. If appropriate, am_check can call the am_open and am_close purpose functions.
To determine the exact contents of the command line, pass the option argument to the following VTI macros. Each macro returns a value of MI_TRUE if the option includes the particular -c or -p qualifier that the following table shows.
The am_check purpose function executes each macro that it needs until one of them returns MI_TRUE. For example, the following syntax tests for oncheck option -cD demonstrate:
if (MI_CHECK_EXTENTS(option) == MI_TRUE) { /* Check rows and smart-large-object metadata * If problem exists, issue message. */ }
The access method can call accessor function mi_tab_spacetype() to determine whether the specified table resides in an sbspace or extspace. If the data resides in an sbspace, the am_check purpose function can duplicate the expected behavior of the oncheck utility. For information about the behavior for each oncheck option, refer to the IBM Informix: Administrator's Reference.
For an extspace, such as a file that the operating system manages, am_check performs tasks that correspond to the command-line option.
To provide detailed information about the state of the table, am_check can call the mi_tab_check_msg() function.
MI_OK validates the table structure as error free.
MI_ERROR indicates the access method could not validate the table structure as error free.
See the descriptions of: