undo只是逻辑还原
2012-05-29 09:29
134 查看
undo只是逻辑还原数据库而不是物理的还原:
测试:
1.新建一个空表
create table t1
(
sid int not null primary key,
sname varchar2(10)
)tablespace test;
create table t2
(
sid int not null primary key,
sname varchar2(10)
)tablespace test;
select * from t2;
2.做全表扫描并查看I/O数量
set autotrace traceonly statistics;
select * from t2;
统计信息
----------------------------------------------------------
0 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
399 bytes sent via SQL*Net to client
509 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
set autotrace off;
--循环导入数据
declare
maxrecords constant int:=20000;
i int :=1;
begin
for i in 1..maxrecords loop
insert into t1 values(i,'ocpyang');
end loop;
dbms_output.put_line(' 成功录入数据! ');
commit;
end;
/
insert into t2 select * from t1;
rollback;
set autotrace traceonly statistics;
select * from t2;
统计信息
----------------------------------------------------------
0 recursive calls
0 db block gets
53 consistent gets
0 physical reads
0 redo size
399 bytes sent via SQL*Net to client
509 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
虽然数据rollback但是insert的操作还是导致表的高水位线,这些数据块并
没有因为rollback而回滚.
验证了数据库并没有物理完全恢复,仅仅是逻辑恢复!
测试:
1.新建一个空表
create table t1
(
sid int not null primary key,
sname varchar2(10)
)tablespace test;
create table t2
(
sid int not null primary key,
sname varchar2(10)
)tablespace test;
select * from t2;
2.做全表扫描并查看I/O数量
set autotrace traceonly statistics;
select * from t2;
统计信息
----------------------------------------------------------
0 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
399 bytes sent via SQL*Net to client
509 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
set autotrace off;
--循环导入数据
declare
maxrecords constant int:=20000;
i int :=1;
begin
for i in 1..maxrecords loop
insert into t1 values(i,'ocpyang');
end loop;
dbms_output.put_line(' 成功录入数据! ');
commit;
end;
/
insert into t2 select * from t1;
rollback;
set autotrace traceonly statistics;
select * from t2;
统计信息
----------------------------------------------------------
0 recursive calls
0 db block gets
53 consistent gets
0 physical reads
0 redo size
399 bytes sent via SQL*Net to client
509 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
虽然数据rollback但是insert的操作还是导致表的高水位线,这些数据块并
没有因为rollback而回滚.
验证了数据库并没有物理完全恢复,仅仅是逻辑恢复!
相关文章推荐
- undo只是逻辑还原
- undo只是逻辑还原
- oracle初级简单逻辑备份还原
- LLVM代码混淆分析及逻辑还原
- Oracle-undo-还原管理
- lvm 逻辑卷的快照及备份 还原
- 人大金仓-逻辑备份、还原
- 深刻理解hive分区,分区只是一种逻辑结构
- 【bat文件制作】Mysqldump逻辑备份与还原
- 文件的逻辑与物理结构(不完善,只是基础轮廓)
- struct 中的宏定义--没有作用域,只是为了逻辑上理解,和放在外部是一样的
- lvm 逻辑卷的快照及备份 还原
- ORACLE的还原表空间UNDO写满磁盘空间,解决该问题的具体步骤
- 数据库备份还原时-Sql Server 检测到基于一致性的逻辑I/O错误解决方案
- PostgreSQL逻辑备份还原代码分析--目录
- SQL语句 还原未知逻辑名称数据库
- MySQL中基于mysqldump和二进制日志log-bin进行逻辑备份以及基于时间点的还原
- Oracle数据库零散知识08 -- 逻辑备份和还原(转)
- oracle的还原表空间UNDO写满磁盘空间,解决该问题的具体步骤
- 复杂的业务逻辑真恼人!没有太大进步,只是多了感悟!