首页 > 其他 > 详细

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

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

实验步骤整理:
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切换后,还能不能查处以前的数据

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

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