nologging 不起作用!【解决】

SQL> conn system/yang as sysdba
已连接。
SQL> create  or replace  view redo_size
  2  as
  3  select value
  4  from v$mystat m,v$statname s
  5  where m.statistic#=s.statistic#
  6* and s.name='redo size'

SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
         0      
----------------创建表----------------------------                                                                  
SQL> create table test tablespace test as select * from dba_objects;
表已创建。
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
   8432324                                                                     

SQL> select table_name ,logging,owner from dba_tables where table_name='TEST';
TABLE_NAME                     LOG OWNER                                       
------------------------------ --- ------------------------------               
TEST                           YES SCOTT                                       
TEST                           YES SYS                                          
SQL> show user
USER 为 "SYS"
SQL> insert into test select * from dba_objects;
已创建68982行。
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  16686608                                                                     
SQL> select (16686608-8432324) redo from dual;
      REDO                                                                     
----------                                                                     
   8254284                                                                     
SQL> insert /*+ append*/ into test select * from dba_objects;
已创建68982行。
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  25066556                                                                     
SQL> select (25066556-16686608) redo from dual;
      REDO                                                                     
----------                                                                     
   8379948                                                                     
SQL> select (25066556-16686608) redo_append,(16686608-8432324) redo from dual;
REDO_APPEND       REDO                                                         
-----------                ----------                                                         
    8379948
    >     8254284
                                                         
SQL> truncate table test ;
表被截断。
SQL> drop table test ;
表已删除。
----------------创建nologging表----------------------------                                                              

SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  33635864                                                                     
SQL> create table testnolog nologging as select * from dba_objects where 1=0;
表已创建。
SQL> select count(*) from testnolog;
  COUNT(*)                                                                     
----------                                                                     
         0                                                                     
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  33657684                                                                     
SQL> select table_name,logging,owner
  2  from dba_tables where table_name='TESTNOLOG';
TABLE_NAME                     LOG OWNER                                       
------------------------------ --- ------------------------------               
TESTNOLOG                      NO  SYS                                          
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  33657684                                                                     
SQL> insert into testnolog select * from dba_objects;
已创建68982行。
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  41941584                                                                     
SQL> insert [b ]/*+append*/ into testnolog select * from dba_objects;
已创建68982行。
SQL> select * from redo_size;
     VALUE                                                                     
----------                                                                     
  50298684                                                                     
SQL> select (50298684-41941584) redo_append,(41941584-33657684) redo from dual;
REDO_APPEND       REDO                                                         
-----------              ----------                                                         
    8357100            8283900          
 
原因:
   以前在测试机上做了dataguard 的实验,数据库为Force Logging模式。
    指定数据库为Force Logging模式后,数据库将会记录除临时表空间或临时回滚段外所有的操作,而忽略类似NOLOGGING之类的指定参数。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22664653/viewspace-668345/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22664653/viewspace-668345/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值