INTRODUCTION
IBM® Informix® Dynamic Server (IDS) includes the oncheck utility that is used to check for corruption within the database instance, and in some cases fix it.
This article describes the initial diagnostics that should be run against a database instance that may contain corruption.
BEFORE YOU BEGIN
Ensure that you have database system administrator (DBSA) access rights and have your shell environment configured to enable you to connect to your database instance.
STEPS
oncheck -cr
This command checks the consistency of the reserved pages. The reserved pages are used to track control and configuration information for the entire instance. For example, the currently used onconfig parameters are stored here.
Running this command will usually take very little time if the engine is online. If the instance is not running, the utility will take a short while to respond as it confirms the current state of the instance before continuing. This command will have little or no performance impact when run against a production server.
Example
$oncheck -cr
Validating IBM Informix Dynamic Server reserved pages
Validating PAGE_PZERO...
Validating PAGE_CONFIG...
Validating PAGE_1CKPT & PAGE_2CKPT...
Using check point page PAGE_2CKPT.
Validating PAGE_1DBSP & PAGE_2DBSP...
Using DBspace page PAGE_2DBSP.
Validating PAGE_1PCHUNK & PAGE_2PCHUNK...
Using primary chunk page PAGE_1PCHUNK.
Validating PAGE_1ARCH & PAGE_2ARCH...
Using archive page PAGE_2ARCH.
oncheck -cc
This command checks the constancy of the system catalog tables of which there are a set for every database within the instance. These tables store critical data about the database, such as database schema's.
This command will usually take a few minutes to execute; the precise amount of time is proportional to the number of databases within the instance. This command will have little or no performance impact when run against a production system.
Example
$oncheck -cc
Validating database sysmaster
Validating systables for database sysmaster
Validating syscolumns for database sysmaster
Validating sysindexes for database sysmaster
Validating systabauth for database sysmaster
Validating syscolauth for database sysmaster
Validating sysdepend for database sysmaster
Validating syssyntable for database sysmaster
WARNING:No syssyntable records found.
Validating sysviews for database sysmaster
Validating sysconstraints for database sysmaster
[...]
oncheck -ce
This command checks the consistency of the extents within the database server. An extent is a contiguous area of disk that stores data, index data or blob data for a specific table. The oncheck utility ensures that all of the extents and free space within the database server, match their associated control information.
This command will usually take a few minutes to execute. The exact amount of time is proportional to the amount of disk space that is allocated to the database instance. This command will have little (or no) performance impact when run on a production system.
Example
%$oncheck -ce
Validating extents for Space 'rootdbs' ...
Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
1 /chunks/ids10/rootdbs 2 15000 12552 2448
oncheck -cDI database_name [:table_name - optional]
This command checks the consistency of the data and index pages within the specified database.
Caution: This command can take a substantial amount of time to complete as oncheck analyses every page within the database.
Tip: You can calculate the speed (MB/sec) with which oncheck runs on your system by running oncheck against a specific table. You will then be able to estimate how long it will take oncheck to analyse an entire database.
This command will typically have a considerable impact on database performance. You should consider bringing the server into quiescent mode prior to running this command, in order to ensure that the utility has exclusive access to the database.
Example
Validating indexes for stores7:informix.systables...
Index tabname
Index tabid
Validating indexes for stores7:informix.syscolumns...
Index column
Index col_xtd_id
Validating indexes for stores7:informix.sysindices...
Index idxtab
Index idxname
[...]
TBLspace data check for stores7:informix.systables
TBLspace data check for stores7:informix.syscolumns
TBLspace data check for stores7:informix.sysindices
[...]
If errors are reported whilst running these commands then please contact your local technical support office for assistance.
For further details on using the oncheck utility, refer to the IBM Informix Dynamic Server Administrator's Reference.
http://www-01.ibm.com/support/docview.wss?uid=swg21209842