Steps to recover RLV from failed recovery
If RLV failed to recover due to any kind of corruption such as OS exceptions/checksum errors on reading page from disk or mismatched sequence number on head/tail of page.
- Add -gm 1 (allow single user connection plus one DBA connection) and -gd DBA (users with SYSTEM OPERATOR system privilege can start and stop database) in param.cfg
- Add -iqrvrec_bypass 1 switch to params.cfg to by pass all RLV recovery. This option should only be used in emergency to drop corrupted RLV table or for deleting RLV portion of the table. Currently this option disables further logging, but doesn't prevent general RLV operations. Non-DBA users should n't allowed access to database, when recovering RLV with this switch.
- Run sp_iqcheckdb 'allocation/check/verify database' to check consistency of the database.
- To get list of RLV enabled tables:
select table_name, is_rlv from sysiqtab,systab where sysiqtab.table_id=systab.table_id and is_rlv='T'
5. Delete RLV portion of the table(you will lose all the data in the RLV portion of the table), This might leave inconsistent database, but will allow a subsequent recovery
delete from table where ROWID(<table>) > 2^48
6. Stop and restart SAP Sybase IQ server normally i.e without -gm 1 -gd DBA and -iqrvrec_bypass 1 switches.