Oracle undo資料表空間大小估算

來源:互聯網
上載者:User

(UR) UNDO_RETENTION in seconds
(UPS) Number of undo data blocks generated per second
(DBS) Overhead varies based on extent and file size (db_block_size)

UndoSpace = [UR * (UPS * DBS)] + (DBS * 24)


上面的公式中,第1、3個參數都可以輕鬆的從參數檔案中得到:
SQL> show parameter undo_retention

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
undo_retention        integer  5400
SQL> show parameter db_block_size

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
db_block_size        integer  8192

現在重要的是要確定第2個參數:每秒鐘產生undo block的總數,可以從 V$UNDOSTAT 中得到。

每秒產生的UNDO量:
SQL> SELECT (SUM(undoblks))/ SUM((end_time - begin_time) * 86400) FROM v$undostat;

(SUM(UNDOBLKS))/SUM((END_TIME-BEGIN_TIME)*86400)
--------------------------------------------------------------
          117.97590055

正常估算值:
SELECT (UR * (UPS * DBS)) + (DBS * 24) AS "Bytes"
FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'),
(SELECT (SUM(undoblks)/SUM(((end_time - begin_time)*86400))) AS UPS FROM v$undostat),
(select block_size as DBS from dba_tablespaces where tablespace_name=
(select upper(value) from v$parameter where name = 'undo_tablespace'));

最大值估算:
SELECT (UR * UPS * DBS + DBS * 24) / 1024 / 1024 AS "undo size(M)"
FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'),
     (SELECT max(undoblks / ((end_time - begin_time) * 24 * 3600)) AS UPS FROM v$undostat),
     (SELECT value AS DBS FROM v$parameter WHERE name = 'db_block_size');

建議在業務量繁重的那一天進行統計,而將UNDO資料表空間大小設為最大估算值以上。

說明:本文整理於How To Size UNDO Tablespace For Automatic Undo Management [ID 262066.1]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.