Database reporting a lot of ORA-12012 lately with no apparent changes to it in the last month or so.
Errors in file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_j000_7094.trc:
ORA-12012: error on auto execute of job 63
ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
From the above it’s pretty clear that my scheduled jobs are failing for something. (all traces had *j00*some number in the file name)
Just to confirm the hypothesis, I did this.
[oracle@localhost trace]$ grep ORA-08102 *trc
orcl_j000_3442.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3442.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3442.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3442.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3480.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3480.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3480.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3480.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3490.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3490.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3490.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
orcl_j000_3490.trc:ORA-08102: index key not found, obj# 289, file 1, block 2025 (2)
select * from dba_objects where object_id=289;
SYS I_JOB_NEXT 289 289 INDEX
Now the index I_JOB_NEXT seems to be corrupted at block# 2025. This belongs to the job$ table.
Let’s try to run an ANALYZE on the table.
SYS@orcl SQL>ANALYZE TABLE JOB$ VALIDATE STRUCTURE CASCADE;
ANALYZE TABLE JOB$ VALIDATE STRUCTURE CASCADE
*
ERROR at line 1:
ORA-01499: table/index cross reference failure - see trace file
By now, we know that index i_job_next is created on the next_date column of job$ table.
So, let’s try to do an explicit full table scan on job$.
SELECT /*+ FULL(j1) */ next_date
FROM job$ j1
MINUS
SELECT /*+ index(j i_job_next) */ next_date
FROM job$ j;
Surprisingly, doing the above FTS followed with an ANALYZE table command did the trick for me
and the index is reusable now.