Repairing and Verifying a Table
A) Run sp_iqcheckdb in repair mode to verify and repair the specified targets.
For example, to check and repair the indexes on the table StoreInvoice:
sp_iqcheckdb 'repair table StoreInvoice';
B) Run the stored procedure sp_iqcheckdb again in verify mode. For example, to verify the indexes on table StoreInvoice again:
sp_iqcheckdb 'verify table StoreInvoice';
Repair Types / Possible Outcomes
leaked blocks can recover
unallocated blocks can recover
multiply-owned blocks cannot recover
Dealing with Allocation Problems
This involves starting the DB in DBA-only mode, and running the allocation check
start_asiq -n HELENA -x 'tcpip{port=7934}'
-gd dba -gm 1 -iqdroplks HELENA
/opt/sybaseiq/data/HELENA.db
go
sp_iqcheckdb 'allocation database'
go
checkpoint
go
Forced Recovery Mode
start_asiq -n HELENA -x 'tcpip(port=7934}' -gd dba -gm 1 -iqfrec HELENA /opt/sybaseiq/data/HELENA.db
You must specify the override startup switch (-iqmpx_ov 1) and start in single node mode (-iqmpx_sn 1) when starting a multiplex write server after any failure. Never use multiplex mode (the default) for recovery.
Forced Recovery Mode - No Transaction Log
Warning! May result in corruption of database
start_asiq -n HELENA -x 'tcpip(port=7934}' -gd dba -f
Dropping objects: DROP INDEX, ALTER TABLE DROP COLUMN, or DROP TABLE statements
If you cannot drop an inconsistent object, set the temporary FORCE_DROP option. FORCE_DROP causes the IQ server to silently leak the on-disk storage of the dropped object, rather than try to reclaim it.
set temporary option FORCE_DROP = 'ON'
shutdown .. then
start_asiq -n HELENA -x 'tcpip{port=7934}' -iqdroplks HELENA HELENA.db
You need to specify the database name twice, once to specify which database you are starting (with no path), and once to identify the database for the -iqdroplks option (pathname optional). Next, run sp_iqcheckdb.
sp_iqcheckdb 'allocation database'
go