Updated: Sep 4, 2020
Corruptions are not necessarily recognized quickly after they have been introduced. It might take weeks and months until the corrupted area is accessed the next time. The more time passes between the introduction of a corruption and the repair, the more difficult is the root cause analysis and correction.
Regular consistency checks are required to detect hidden corruptions as early as possible.The CHECK_TABLE_CONSISTENCY procedure can be used to check the consistency of the structure and data of tables. Its parameters are:
ACTION: Type of action, e.g. ‘CHECK’
SCHEMA_NAME: Name of analyzed schema (NULL for all schemas)
TABLE_NAME: Name of analyzed object (NULL for all objects)
We all have heard about DBCC or Database Consistency Check in SAP HANA. Those who are new, can refer to SAP Note 2116157 for more information.
Below you can find some known options for running manual consistency check in SAP HANA for tables :
-- Consistency Check for all tables in all schemas CALL CHECK_TABLE_CONSISTENCY('CHECK', NULL, NULL); -- Consistency Check for all tables in a specific schema CALL CHECK_TABLE_CONSISTENCY('CHECK', <schema_name>, NULL); -- Consistency Check for specific table in a specific schema CALL CHECK_TABLE_CONSISTENCY('CHECK', <schema_name>, <table_name>);
Sometimes consistency checks may require significant amounts of CPU and memory resources, so it is better not to run it concurrent with peak workload. For production systems, an alternative is to run these checks on recent copy if done on any test/dev system.
But if you want to continue this check on production system only, excluding the bigger tables or excluding any specifi