Oracle 減少redo size的方法

來源:互聯網
上載者:User

用實驗說明

一、在非歸檔模式下:

SQL> archive log list
資料庫記錄模式            非存檔模式
自動封存            禁用
存檔終點            USE_DB_RECOVERY_FILE_DEST
最早的聯機日誌序列    2491
當前日誌序列          2493

用sys使用者建立查詢redo size的視圖(方便查詢)

SQL> create or replace view redo_size
  2  as
  3  select value
  4    from v$mystat, v$statname
  5  where v$mystat.statistic# = v$statname.statistic#
  6    and v$statname.name = 'redo size';

視圖已建立。

用sys使用者建立同義字

SQL> create public synonym redo_size for redo_size;

同義字已建立。

以下用scott操作

建立測試表

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

表已建立。

查看當前redo量

SQL> select * from redo_size;

    VALUE
----------
      736

插入資料,看結果

SQL> insert into test_redos select * from dba_objects;

已建立73104行。

SQL> select * from redo_size;

    VALUE
----------
  8473536

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

已建立73100行。

SQL> select * from redo_size;

    VALUE
----------
  8504856

SQL> select (8473536-736)普通插入,(8504856-8473536) append插入 from dual;

  普通插入 APPEND插入
---------- ----------
  8472800      31320

以上結果說明在非歸檔模式下,append插入資料產生的redo要少得多。

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.