手机版
你好,游客 登录 注册
背景:
阅读新闻

Oracle 减少redo size的方法

[日期:2013-03-06] 来源:Linux社区  作者:laoshangxyc [字体:大 中 小]

二、在归档模式下(在数据库和表空间级别为设置force logging的情况下,默认非force logging):

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival            Enabled
Archive destination            /archive1
Oldest online log sequence    114
Next log sequence to archive  116
Current log sequence          116

同上(非归档里面)建立测试表

①:在表为logging的情况下

SQL>  create table test_redos as select * from dba_objects where 1=2;

Table created.

SQL> select * from redo_size;

    VALUE
----------
    26812

SQL> insert into test_redos select * from dba_objects;

71971 rows created.

SQL> select * from redo_size;

    VALUE
----------
  8490044

SQL> insert /*+ append */ into test_redos select * from dba_objects;

71971 rows created.

SQL> select * from redo_size;

    VALUE
----------
  17001396

SQL> select (8490044-26812)普通插入,(17001396-8490044) append插入 from dual;

  普通插入 APPEND插入
---------- ----------
  8463232    8511352

可以看出在归档模式表logging(默认)的情况下,append插入产生的redo量并不会减少。

②:在表nologging的情况下

将表设置为nologging模式

SQL> alter table test_redos nologging;

Table altered.

继续测试

SQL> select * from redo_size;

    VALUE
----------
  8397184

SQL> insert into test_redos select * from dba_objects;

71971 rows created.

SQL> select * from redo_size;

    VALUE
----------
  16801072

SQL> insert /*+ append */ into test_redos select * from dba_objects;

71971 rows created.

SQL> select * from redo_size;

    VALUE
----------
  16836516

SQL> select (16801072-8397184)普通插入,(16836516-16801072) append插入 from dual;

  普通插入 APPEND插入
---------- ----------
  8403888      35444

可以看出在表nologging的模式下,append可以减少大量减少redo量的产生。

linux
相关资讯       Oracle redo  redo size 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款