Oracle减少redo size的方法(二)
在表nologging的模式下,append可以减少大量减少redo量的产生。
三、在归档force logging模式下:
改变SCOTT用户的默认表空间为force logging模式
[sql]
SQL> select username,default_tablespace from dba_users where username='SCOTT';
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
SCOTT USERS
--在数据级别置为force logging模式语句为 alter database force logging;
SQL> alter tablespace users force logging;
Tablespace altered.
继续测试
[sql]
SQL> select * from redo_size;
VALUE
----------
25488368
SQL> insert into test_redos select * from dba_objects;
72010 rows created.
SQL> select * from redo_size;
----------
33973556
SQL> insert /*+ append */ into test_redos select * from dba_objects;
72010 rows created.
SQL> select * from redo_size;
VALUE
----------
42492396
SQL> select (33973556-25488368)普通插入,(42492396-33973556) append插入 from dual;
普通插入 APPEND插入
---------- ----------
8485188 8518840
可以看出在表空间在force logging模式下append不能减少redo量
总结:
非归档模式下:append能大量减少redo量。
归档模式下:在表空间和数据库级非force logging模式下,表如果是nologging,则append能大量减少redo量。