AW: help URGENT
Posted in 2006
yann wrote:
>
> Bonjour,
> jais une table informix corurpted, le problem ces que je ne
> peut pas faire
> de unload de cette table, ni de dbexport comment faire pour la reparer
> Urgent Merci
>
> Is table courrupted on informix 10
>
> help me.
Hi,
Je regret, mais ma francais n'suffis pas pour une response en Francais.
You have two options
1) restore
-> best option ,as it will get back a consistent state
In IDS <= 9.4 you ahve to restore the dbspace(s) of the table
and then roll forward all the logs.
In IDS 10 you may even do a table level restore.
See IBM Informix Backup & Restore Guide , Chapter 16 .
(look under
http://www-306.ibm.com/software/data/informix/pubs/library/ids.html
for online access to the dokumentation )
2) unload around the bad pages
-> difficult task, depends on the the amount of corruption
and will lead to loss of data.
General outline is to sequentially unload the table by rowid until you
receive an error, when IDS tries to read a corrupted page.
unload to tableunloadfile
SELECT rowid, * from <table>
Determine the last good rowid. Then restart the unload with
unload to tableunloadfile1
SELECT rowid, * from <table>WHERER ROWID >= <next_possible_good_rowid>
You may calculate next_possible_good_rowid as follows:
Example:
lastgoodrowid = 4711 = 0x1267
||
(page number in table)___________||___(rownumber on page)
The bad page is page 0x13(page 19)
So the lowest possible good page number will be 0x14 (20)
The <next_possible_good_rowid> hence will be 0x1401 ( 5121 in decimal
notation)
If page 0x14 (page twenty) is corrupt , too, then
<next_possible_good_rowid>
will become 0x1501 (5377 in decimal)
Repeat this until you have sucessfully unloaded all good rows (and
stored them in
a new table with same schema )
Then drop the bad table.
You will have to save schema of all views and recreate them on the new
table .
Also recreate all indexes.
As I said - it might be a difficult task AND in any case you will loose
data
and have a database that is logically inconsitent!!!!!!!!
So use option 2 only if no restore possible , (e.g. as no backup
exists!)
Best regards
Tilman