ORA-01418问题原因是索引不存在。
但有时候可以通过user_indexes表查询到索引。
可能的原因如下:
1. 索引所有者与当前用户不一致;
2. 当前用户无权限。

可通过以下SQL来确定所有者,失效的索引:
-- 查询索引所有者
select owner from all_indexes where index_name = 'xxx';
-- 查询失效的索引
select * from user_indexes where status <> 'VALID';还有一个可能的原因是,索引名称需要使用双引号包起来:
-- 生成重建索引的SQL语句,索引名使用双引号包起来.
select 'alter index "'||index_name||'" rebuild;' from user_indexes where status <> 'VALID' and index_name not like'%$$';或者使用:
-- 生成重建索引的SQL语句,索引名使用双引号包起来.
select 'alter index "'||index_name||'" rebuild online;' from user_indexes where status <> 'VALID' and index_name not like'%$$';