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.
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之类的指定参数。

目录
相关文章
|
关系型数据库 MySQL
囧...执行analyze table意外导致waiting for table flush
囧...执行analyze table意外导致waiting for table flush
153 0
|
SQL Oracle 关系型数据库
flashback table肯定会造成rowid跟着修改
flashback table肯定会造成rowid跟着修改,为什么要开启行移动?
|
SQL 存储 Oracle
【IMPDP】使用 TRANSFORM选项去掉表空间和存储子句
使用IMPDP工具完成数据导入时,会按照dump文件中有关的存储的参数信息完成数据的导入。很多情况下我们希望按照被导入用户的默认参数完成数据的导入,此时我们可以使用IMPDP的TRANSFORM参数辅助完成。
1182 0
|
SQL 存储 Oracle
Oracle 临时事务表 全局临时表_global temporary table
所有的操作都在一个事务里,事务提交后,此表清空,特别适合做插入删除频率特别高的临时表操作,比如插入完数据就开始查询,查询完就删掉等,用完就扔! 临时表分事务级临时表和会话级临时表。 事务级临时表只对当前事务有效,通过语句:ON COMMIT DELETE ROWS 指定。
1457 0