首页 > 数据库技术 > 详细

闪回drop恢复表后sql执行计划异常

时间:2015-06-25 23:04:40      阅读:401      评论:0      收藏:0      [点我收藏+]


-----正常执行计划
set autotrace traceonly
set linesize 1000

select /*+index(t idx_object_id)*/ * from t where object_id=19;
Execution Plan
----------------------------------------------------------
Plan hash value: 2041828949
---------------------------------------------------------------------------------------------
| Id  | Operation                   | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                               |     1 |         207 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T             |     1     |   207 |           2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN               | IDX_OBJECT_ID |     1 |                |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("OBJECT_ID"=19)


----在误操作drop 表t 后,立即flashback drop;
但是之前相应的索引已经被rename了,但是oracle依然可以这个这个rename后的索引

SQL> drop table t;
SQL> flashback table t to before drop;


-----异常执行计划
SQL> select   * from t where object_id=19;
Execution Plan
----------------------------------------------------------
Plan hash value: 329240726
--------------------------------------------------------------------------------------------------------------
| Id  | Operation                                | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |                              |     1 |   207 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T              |     1 |   207 |     2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN            | BIN$GVgNy7hUF5HgUFAK8RIOcA==$0 |     1 |            |     1   (0)| 00:00:01 |------貌似性能没有大影响
--------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("OBJECT_ID"=19)


SQL> select index_name,status from user_indexes where table_name=‘T‘;
BIN$GVgNy7hUF5HgUFAK8RIOcA==$0         VALID  

------重命名索引

alter index "BIN$GVgNy7hUF5HgUFAK8RIOcA==$0" rename to IDX_OBJECT_ID;



闪回drop恢复表后sql执行计划异常

原文:http://blog.csdn.net/lixora/article/details/46640987

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!