首页 » 编程开发 » ORACLE » 正文

Oracle中错误ORA-01410: 无效的 ROWID的解决方法

1、如果是在两个表联合查询更新表字段值时发生“ORA-01410: 无效的 ROWID”错误,那么本站之前有讨论过它的解决方法,详见http://www.aiphere.com/oracle-for-update-invalid-rowid.html
2、如果仅仅是查询时发生“ORA-01410: 无效的 ROWID”错误,那么很可能是表的索引坏掉了,可以先把表结构拿出来分析一下,定位到是哪个表的哪个索引有问题。大家都知道,索引是通过存储rowid值来快速定位记录,如果一些什么原因造成这种对应关系出现错误,那么根据索引里面的rowid无法找到对应的记录,就会出现“ORA-01410: 无效的 ROWID”的错误。对于索引有问题的情况,下面的方法供参考:
1) 首先考虑能不能刷新一下索引,找到索引名,并执行命令“alter index index_name rebuild”。
2) 如果经过第一步,还是没有好,那么可以考虑将索引删除 ,重建索引。
3) 将表转移到另外一个表空间,命令为“alter table table_name move tablespace tablespace_name;”。
4) 如果上面的3个方法都没能解决,可以尝试下面的命令:

exec dbms_stats.gather_database_stats();
exec dbms_stats.gather_system_stats();
exec dbms_stats.gather_fixed_objects_stats();
exec dbms_stats.gather_dictionary_stats();
exec dbms_stats.gather_database_stats_job_proc();

3、如果是在create table tablename as select * from…的时候发生”ORA-01410: 无效的 ROWID”错误,建议先让dba权限用户执行“alter system checkpoint”试试。

ROWID是表记录在数据文件中存储的物理地址,是不会变更的,“无效的 ROWID”即没办法找到相应的记录,我们多想想数据库是怎样工作的,它会怎么执行我们的语句,问题就变得比较一目了然了。

本文共 2 个回复

  • how to stop hair loss in teenagers 2018/02/01 16:20

    Thank you, I have recently been searching for info approximately this topic for a while and yours is the greatest I've discovered till now. However, what in regards to the conclusion? Are you positive in regards to the source?

  • how to stop hair fall and grow hair 2018/02/27 13:32

    Great blog! I am loving it!! Will come back again. I am bookmarking your feeds also.

回复 how to stop hair fall and grow hair 取消