gpcheckcat
1 概述
GP 提供了 gpcheckcat 用于在集群内检查系统表。
| 检查项 || 描述 || Utility 模式 || 复合查询 || 错误等级 | |———————|————————————————————————-|————|——|——| | pg_class || Check pg_class entry that does not have any correspond pg_attribute entry || Y || N || NOREPAIR | | namespace || Check for schemas with a missing schema definition || Y || N || NOREPAIR | | unique_index_violation || Check for violated unique indexes || N || Y || NOREPAIR | | duplicate || Check for duplicate entries || N || Y || | | missing_extraneous || Cross consistency check for missing or extraneous entries || N || Y || | | inconsistent || Cross consistency check for coordinator segment inconsistency || N || || | | foreign_key || Check foreign keys || N || || | | || || || || |
Note:
Utility 模式: 对应 SQL 是否执行在 utility 模式下
有些 SQL 只能在集群中执行复合查询: 下发的 SQL 是否为动态生成
有些 SQL 为根据表定义或者其他条件拼接而成错误等级:
- SUCCESS
success - REMOVE
error, with repair script removes objects - RESYNC
error, with repair script that resynchronizes objects - NOREPAIR
error, no repair script
- SUCCESS
2 pg_class
|
|
3 namespace
|
|
4 unique_index_violation
SQL 为拼接而成,分成两步:
- 获取有唯一索引约束的表和索引
- 逐一检查每个表是否违反了唯一约束
代码: unique_index_violation_check.py
|
|