oncheck实用程序

oncheck 作为informix重要的实用工具, 可以执行以下功能:

检查指定的磁盘结构是否存在不一致性。
修复已发现存在不一致性的索引。
显示有关磁盘结构的信息。
检查和显示分布式数据库中有关用户定义数据类型的信息。


oncheck 实用程序可以修复以下类型的磁盘结构:

分区页统计信息
位图页
分区 Blob 页
Blob 空间 Blob 页
索引
Sb 空间页
Sb 空间的元数据分区
如果 oncheck 检测到其它结构中的不一致性,则向您发送消息警告以通知这些不一致性,但 oncheck 不能解决问题。


oncheck 选项分为三类:检查、修复和显示。显示或打印选项(以字母 p 为前缀的那些选项)的功能与 -c 选项的功能相同,不同之处是 -p 选项显示 oncheck 实用程序执行时受检查数据的其它信息。您不能组合 oncheck 选项标志,以下段落中描述的情况除外。

一般地,-c 选项检查一致性,并且只在找到错误或不一致性时才在屏幕上显示消息。

使用 -y 选项执行修复
使用 -y 选项指示 oncheck 自动执行修复,如下例所示:

oncheck -cd -y
oncheck -cD -y
oncheck -ci -y
oncheck -cI -y
如果不使用 -y 选项,则 oncheck 会在遇到不一致性时提示您,并允许您请求修复。如果指定了选项 -n,则 oncheck 不提示您,因为该选项指示 oncheck 不执行修复。


[informix@test ~]$ oncheck --help

ONCHECK
Usage: oncheck {-cCheckOption | -pPrintOption} [-y | -n] [-q]
[ { database[:[owner.]table[,fragdbs|#index]] | TBLspace number

| Chunk number } { rowid | page number } ] [# pgs] [-h]

-c - CheckOption
r - reserved pages
R - reserved pages including logical and physical logs
e - extents
c - database catalogs [database]
i - table indexes database[:[owner.]table[#index]]
I - table indexes and rowids in index database[:[owner.]table[#index]]
x - place share lock on table during index check
d - TBLspace data rows including bitmaps
database[:[owner.]table[,fragdbs]]
D - TBLspace data rows including bitmaps, remainder pages and BLOBs
database[:[owner.]table[,fragdbs]]
s - SBLOBspace metadata partitions
S - SBLOBspace metadata partitions and LO extents

-p - PrintOption
r - reserved pages (-cr)
R - reserved pages including logical and physical logs (-cR)
e - extents report (-ce)
c - catalog report (-cc) [database]
k - keys in index (-ci) database[:[owner.]table[#index]]
K - keys and rowids in index (-cI) database[:[owner.]table[#index]]
l - leaf node keys only (-ci) database[:[owner.]table[#index]]
L - leaf node keys and rowids (-cI) database[:[owner.]table[#index]]
x - place share lock on table during index check
d - TBLspace data rows (-cd) database[:[owner.]table[,fragdbs]] [rowid]
D - TBLspace data rows including bitmaps, remainder pages and BLOBs (-cD)
database[:[owner.]table[,fragdbs]] [page number]
t - TBLspace report database[:[owner.]table[,fragdbs]]
T - TBLspace disk utilization report database[:[owner.]table[,fragdbs]]
p - Dump page for the given
[table[,fragdbs] and rowid | TBLspace and page number] {[# pgs]
[-h]}
P - Dump page for the given chunk number and page number
[chunk num and page number] {[# pgs] [-h]}
B - BLOBspace utilization for given table(s)
database[:[owner.]table[,fragdbs]]
s - SBLOBspace metadata partitions
S - SBLOBspace metadata partitions and LO extents

-q - Quiet mode - print only error messages
-n - Answer NO to all questions
-y - Answer YES to all questions

[informix@test ~]$

请使用浏览器的分享功能分享到微信等