ORA-08102 while creating a view

oracleoracle-10goracle-11g-r2

I am learning PL/SQL programming. I'm trying to create a view with the following statement:

create or replace view viewName as select ID from employees; 

The view creation throws the following error:

ORA-00604 error occurred at recursive level 1
ORA-08102 Index not found, obj #39 , file 1 block 61248

How can I fix it?

The problem is with all objects, procedures,functions,views and i am using the HR Database of Oracle 11G for learning purposes.

Best Answer

File 1 belongs to the SYSTEM tablespace. Objects with such low id as 39 are dictionary objects. For example in my database it is an index of OBJ$ (I_OBJ4). ORA-08102 also points us towards an index, which seems to be corrupt based on the error you get.

Find the index name by:

select object_name from dba_objects where object_id = 39;

Unfortunately you will not be able to rebuild this index (ORA-00701), but you can recreate it:

shutdown immediate
startup upgrade
alter session set nls_length_semantics=byte;
@?/rdbms/admin/utlmmig