Nologging到底何时才能生效?
文章作者 100test 发表时间 2007:03:14 13:45:13
来源 100Test.Com百考试题网
最初的问题是这个帖子:
http://www.itpub.net/showthread.php?threadid=239905
请大家仔细看那些测试的例子.
看了Tom的解释,始终觉得牵强.
开始以为可能是bug
经过观察和测试,终于发现了Nologging的秘密
--------------------------------------------------------------------------------
我们知道,Nologging只在很少情况下生效
通常,DML操作总是要生成redo的
这个我们不多说.
关于Nologging和append,一直存在很多误解.
经过一系列研究,终于发现了Nologging的真相.
我们来看一下测试:
1.Nologging的设置跟数据库的运行模式有关
a.数据库运行在非归档模式下:
SQL> archive log list.
Database log mode No Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/oradata/hsjf/archive
Oldest online log sequence 155
Current log sequence 157
SQL> @redo
SQL> create table test as 0select * from dba_objects where 1=0.
Table created.
SQL> 0select * from redo_size.
VALUE
----------
63392
SQL>
SQL> insert into test 0select * from dba_objects.
10470 rows created.
SQL> 0select * from redo_size.
VALUE
----------
1150988
SQL>
SQL> insert /* append */ into test 0select * from dba_objects.
10470 rows created.
SQL> 0select * from redo_size.
VALUE
----------
1152368
SQL> 0select (1152368 -1150988) redo_append,(1150988 -63392) redo from dual.
REDO_APPEND REDO
----------- ----------
1380 1087596
SQL> 0drop table test.
Table 0dropped.