Enable an Index

Enable an Index example

In Oracle database to enable an index you must use the command alter index with rebuild keyword. The status of index will change from unusable to valid.

  

-- enable Index using REBUILD
ALTER INDEX STU_LN_IDX REBUILD;  
	 

Output:

index STU_LN_IDX altered.

Check indexes

select INDEX_NAME, INDEX_TYPE, STATUS
from USER_INDEXES
WHERE table_name='STUDENTS_LIST'; 

Output:

INDEX_NAMEINDEX_TYPESTATUS
STUDENT_IDXNORMALVALID
STU_LN_IDXNORMALVALID