zoukankan      html  css  js  c++  java
  • 如何计算必要的回滚段大小

    SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
           SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
           (TO_NUMBER(e.value) * TO_NUMBER(f.value) *
           g.undo_block_per_sec) / (1024*1024)
           "NEEDED UNDO SIZE [MByte]"
      FROM (
           SELECT SUM(a.bytes) undo_size
             FROM v$datafile a,
                  v$tablespace b,
                  dba_tablespaces c
            WHERE c.contents = 'UNDO'
              AND c.status = 'ONLINE'
              AND b.name = c.tablespace_name
              AND a.ts# = b.ts#
           ) d,
           v$parameter e,
           v$parameter f,
           (
           SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
              undo_block_per_sec
             FROM v$undostat
           ) g
    WHERE e.name = 'undo_retention'
      AND f.name = 'db_block_size'
      ;
     
      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 value AS DBS
               FROM v$parameter
               WHERE name = 'db_block_size');


    (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)

    ======================
    The UNDO tablespace still must be sized appropriately.
    The following calculation can be used to determine how much space a given undo segment will consume
    given a set value of UNDO_RETENTION.
    Undo Segment Space Required = (undo_retention_time * undo_blocks_per_seconds)
    As an example, an UNDO_RETENTION of 5 minutes (default) with 50 undo blocks/second (8k blocksize) will generate:
    Undo Segment Space Required = (300 seconds * 50 blocks/ seconds * 8K/block) = 120 M

  • 相关阅读:
    ZOJ 3876 May Day Holiday 蔡勒公式
    ZOJ 3870 Team Formation 贪心二进制
    ZOJ 3872 计算对答案的贡献
    Codeforces Round #324 (Div. 2)C. Marina and Vasya set
    Jquery前端分页插件pagination使用
    最简单的混合开发教程资料汇总
    最简单的混合开发教程资料汇总
    2018年各大互联网前端面试题二(滴滴打车)
    2018年各大互联网前端面试题二(滴滴打车)
    【福利】小程序开发资源干货汇总
  • 原文地址:https://www.cnblogs.com/HondaHsu/p/2665419.html
Copyright © 2011-2022 走看看