Question

I have found alert about corrupted block in alert log. Corrupted block belonged to the table named DOCS. Because of I don't have any backup of this database, decided to recreate DOCS table to solve the corruption. And here is a problem.

Generated all scripts:

1. DDL for table.
2. DDL for constraints,triggers,indexes on the table.
3. DDL for the constraints that references this table.
4. Saved grants on this table.

Now I want to drop table , but left its dependencies , and then recreate table with its constraints,triggers,indexes..

How can I do that?

------------------------Edit

It seems to be very simple.

  1. Save data of this table

    create table new_table as select * from my_table;

  2. Save DDL for table and its comments
  3. DDL for indexes on this table
  4. DDL for constraints on this table
  5. DDL for Foreign key-s that references on this table
  6. Save grants on this table
  7. Drop table purge
  8. Recreate table, comments, constraints, indexes, foreign keys that references to this table
  9. Give grants
  10. insert data

    insert into my_table as select * from new_table

This solution works for re-creation the table(it is a correct way to recreate a table). But the corruption did not solved, during the insertion into the table in Alert.log raised the same error about block corruption.

In comments @Mindaugas Riauba wrote a solution and it worked. I just want to know why my solution about re-creation table did not work and @Mindaugas Riauba's solution work?

Thank you @Mindaugas Riauba again!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top