码迷,mamicode.com
首页 > 其他好文 > 详细

验证undo切换后,还能不能查处以前的数据

时间:2016-12-09 01:16:18      阅读:176      评论:0      收藏:0      [点我收藏+]

标签: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,那么发现切换前的数据仍然能查到,不解

验证undo切换后,还能不能查处以前的数据

标签:undo

原文地址:http://duxiutemp.blog.51cto.com/10788420/1880849

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!