--再次查看执行计划SYS_FBA还在列,期间尝试过程flush shared_pool,修改undo_tablespace和重启instance,结果还是如此,这就有点不解了,本来认为Flashback archive被清空后flashback query应该去读取undo的
SQL> explain plan for select * from t0516_7 as of scn 12723393908514;
Explained.
SQL> set pagesize 100 linesize 150
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 4190489988
----------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 5 | 80 | 9 (23)| 00:00:01 | | |
| 1 | VIEW | | 5 | 80 | 9 (23)| 00:00:01 | | |
| 2 | UNION-ALL | | | | | | | |
| 3 | PARTITION RANGE SINGLE| | 1 | 44 | 2 (0)| 00:00:01 | 1 | 1 |
|* 4 | TABLE ACCESS FULL | SYS_FBA_HIST_549255 | 1 | 44 | 2 (0)| 00:00:01 | 1 | 1 |
|* 5 | FILTER | | | | | | | |
| 6 | MERGE JOIN OUTER | | 4 | 8224 | 7 (29)| 00:00:01 | | |
| 7 | SORT JOIN | | 4 | 112 | 3 (34)| 00:00:01 | | |
|* 8 | TABLE ACCESS FULL | T0516_7 | 4 | 112 | 2 (0)| 00:00:01 | | |
|* 9 | SORT JOIN | | 2 | 4056 | 4 (25)| 00:00:01 | | |
|* 10 | TABLE ACCESS FULL | SYS_FBA_TCRV_549255 | 2 | 4056 | 3 (0)| 00:00:01 | | |
----------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
4 - filter("ENDSCN">12723393908514 AND "ENDSCN"<=12723394613470 AND ("STARTSCN" IS NULL OR
"STARTSCN"<=12723393908514) AND ("OPERATION" IS NULL OR "OPERATION"<>'D'))
5 - filter("STARTSCN"<=12723393908514 OR "STARTSCN" IS NULL)
8 - filter("T"."VERSIONS_STARTSCN" IS NULL)
9 - access("RID"(+)=ROWIDTOCHAR("T".ROWID))
filter("RID"(+)=ROWIDTOCHAR("T".ROWID))
10 - filter(("ENDSCN"(+) IS NULL OR "ENDSCN"(+)>12723394613470) AND ("STARTSCN"(+) IS NULL OR
"STARTSCN"(+)<12723394613470))
3、如果SYS_FBA_还没有被创建,在flashback query的时候会到undo里获取(假设undo retention足够大,undo segment未被循环利用)
alter table t0517_1 no flashback archive;
drop table t0517_1;
create table t0517_1 (id number) tablespace TS0422_1 flashback archive fba0517_1;
insert into t0517_1 values(1);
insert into t0517_1 values(2);
insert into t0517_1 values(3);
commit;
select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
12723378820886
delete from t0517_1 where id>=2;
commit;
update t0517_1 set id=11 where id=1;
commit;