驗證undo切換後,還能不能查處以前的數據

實驗步驟整理:
conn scott/tiger
drop table t;
create table t as select * from dept;
查看有幾個undo表空間
select tablespace_name,contents,extent_management from dba_tablespaces;
set time on
show parameter undo確認當前使用的undo表空間,刪掉不用的undo表空間,防止混亂
conn scott/tiger
delete from t;
commit;
alter system checkpoint;
alter system flush buffer_cache;
select * from t as of timestamp to_timestamp('2016-12-08 17:04:05','yyyy-mm-dd hh24:mi:ss');此時可以查到數據
#select tablespace_name,block_size,status,contents,segment_space_management from dba_tablespaces;
alter system checkpoint;
alter system flush buffer_cache;
create undo tablespace undotbs datafile '/u01/app/oracle/oradata/ORA11GR2/undotbs.dbf' size 10m reuse;建立新的undo表空間
alter system set undo_tablespace='UNDOTBS2';
#select tablespace_name,block_size,status,contents,segment_space_management from dba_tablespaces;
 alter tablespace undotbs1 offline;
  drop tablespace undotbs1 including contents and datafiles;
show parameter undo
conn scott/tiger
select * from t as of timestamp to_timestamp('2016-12-08 17:04:05','yyyy-mm-dd hh24:mi:ss');



經驗證如果我不刪除undotbs1,那麼發現切換前的數據仍然能查到,不解

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章