查看redo和undo
select b.name,a.value
from v$mystat a,v$statname b
where a.statistic#=b.statistic# and b.name in ('redo size','undo change vector size');
select b.name,a.value from v$mystat a,v$statname b where a.statistic#=b.statistic# and b.name in ('redo size','undo change vector size');
insert
CREATE TABLE table1(a int);
INSERT INTO table1 VALUES (1);
commit
commit;
select
select * from table1;
update & commit
update table1 set a=2 where a=1;
commit;
rollback
update table1 set a=3 where a=2;
rollback;
update
update table1 set a=4 where a=3;
结论
commit & rollback操作产生undo和redo。
commit提交瞬间,要将最后那些没有提交的redo信息写到redo log file中。
select语句在某些特定的情况下也会产生redo和undo,例如select导致的延迟块清楚发生时。