查看数据库操纵产生多少日志
select a.name,b.value from v$statname a,v$mystat b where a.statistic#=b.statistic# and a.name='redo size'; --2572
select * from v$statname;
select * from v$mystat;

创建表,产生多少日志?

create table t as select * from dba_objects;
计算创建表产生的日志大小
select a.name,b.value from v$statname a,v$mystat b where a.statistic#=b.statistic# and a.name='redo size'; --8665020
select (8665020-2572)/1024/1024||'M' from dual;---8.2611541748046875M

删除数据,产生多少日志?

delete t;
计算删除数据库产生多少日志?
select a.name,b.value from v$statname a,v$mystat b where a.statistic#=b.statistic# and a.name='redo size'; --37546584
select (37546584-8665020)/1024/1024||'M' from dual; --27.543605804443359375M
其中:delete比create产生的redo多,这是因为delete操纵产生大量的undo,而undo所在数据块的改变也会产生redno,所以delete参数日志多;

转载自chenoracle

最后修改:2022 年 02 月 27 日
如果觉得我的文章对你有用,请随意赞赏