oncheck -pk, -pK, -pl, -pL: Display index information
>>-oncheck------------------------------------------------------>
>----+- -pk-+--+---+--database--+---------------------------------------+---><
+- -pK-+ '-x-' '-:--+--------+--table--+-------------+-'
+- -pl-+ '-owner.-' '-#index_name-'
'- -pL-'
The -pk option performs the same checks as the -ci option and in addition, displays the key values for all indexes on the specified table as it checks them.
The -pK option performs the same checks as the -cI option and in addition, displays the key values and rowids as it checks them.
The -pl option performs the same checks as the -ci option and displays the key values, but checks only leaf-node index pages. It ignores the root and branch-node pages.
The -pL option performs the same checks as the -cI option and displays the key values and rowids, but checks only leaf-node index pages. It ignores the root and branch-node pages.
Element | Purpose | Key Considerations |
---|---|---|
database | Specifies the name of a database that you want to check for consistency | Syntax must conform to the Identifier segment; see HCL OneDB™ Guide to SQL: Syntax. |
index_name | Specifies the name of the index that you want to check for consistency | Index must exist on table and in database specified. Syntax must conform to the Identifier segment; see HCL OneDB Guide to SQL: Syntax. |
owner | Specifies the owner of a table | You must specify the current owner of the table.
Syntax must conform to the Owner Name segment; see HCL OneDB Guide to SQL: Syntax. |
table | Specifies the name of the table that you want to check for consistency | Table exists when you execute the utility. Syntax must conform to the Table Name segment; see HCL OneDB Guide to SQL: Syntax. |
-x | Places a shared lock on the table when you check and print an index | For complete information, see Turn On Locking with -x. |
If any of the oncheck options detect inconsistencies, you are prompted for confirmation to repair the problem index. If you specify the -y (yes) option, indexes are automatically repaired. If you specify the -n (no) option, the problem is reported but not repaired; no prompting occurs.
oncheck -pl -n stores_demo:customer
oncheck -pl -n stores_demo:customer#zip_ix
By default, the database server does not place a shared lock on the table when you check an index with the oncheck -pk, -pK, -pl, or -pL options unless the table uses page locking. For absolute assurance of a complete index check, you can execute oncheck -pk, oncheck -pK , oncheck -pl , or oncheck -pL with the -x option. With the -x option, oncheck places a shared lock on the table, and no other users can perform updates, inserts, or deletes until the check has completed. For more information on using the -x option, Turn On Locking with -x.
For more information on oncheck -ci, see oncheck -ci and -cI: Check index node links. For more information index pages, see Structure of B-Tree Index Pages.