Sunday, August 16, 2015

How to drop and recreate a Corrupt Index

1. Verify the error.

2. Try to rebuild the index as below.

alter index <index name> rebuild;

If the still the issue exists.

3. Query for the Index script from dbms_metadata.get_ddl as below.

select dbms_metadata.get_ddl('INDEX','<INDEX_NAME>','OWNER') from dual;

DBMS_METADATA.GET_DDL('INDEX','PO_VENDORS_F1','PO')
-------------------------------------------------------------------------
  CREATE INDEX "OWNER"."<INDEX_NAME>" ON "OWNER"."<INDEX_NAME>" (NVL("END_DATE_ACTI
VE",TO_DATE(' 9999-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))
  PCTFREE 10 INITRANS 11 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 16384 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)

  TABLESPACE "APPS_TS_TX_IDX"

4. Use the above script to recreate the index.



No comments:

Post a Comment