0% found this document useful (0 votes)
116 views2 pages

How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1)

This document provides guidance on sizing the UNDO tablespace for automatic undo management in Oracle Database. It explains that the size needs is calculated based on the undo retention period, the maximum number of undo blocks generated per second, and the database block size. It provides SQL queries to determine the peak undo block generation rate and to calculate the number of bytes needed to handle peak undo activity based on these factors.

Uploaded by

selfrit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views2 pages

How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1)

This document provides guidance on sizing the UNDO tablespace for automatic undo management in Oracle Database. It explains that the size needs is calculated based on the undo retention period, the maximum number of undo blocks generated per second, and the database block size. It provides SQL queries to determine the peak undo block generation rate and to calculate the number of bytes needed to handle peak undo activity based on these factors.

Uploaded by

selfrit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Document 262066.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Copyright (c) 2021, Oracle. All rights reserved. Oracle Confidential.

How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1)

In this Document

Goal
Solution
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 11.2.0.4 [Release 9.2 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 9.2.0.1 to current release
***Checked for relevance on 04-Feb-2016***

GOAL

To assist Database Administrators in sizing an UNDO Tablespace for automatic undo management.

SOLUTION

Sizing an UNDO tablespace requires three pieces of data.

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

The undo space needed is calculated as:

UndoSpace = UR * (UPS * DBS)

Two of the pieces of information can be obtained from the instance configuration: UNDO_RETENTION and
DB_BLOCK_SIZE. The third piece of the formula requires a query being run against the database. The maximum number of
undo blocks generated per second can be acquired from V$UNDOSTAT.

Note: Overall consideration for peak/heavy vs. normal system activity should be taken into account when peforming the
calculations. Autoextend OFF vs. ON will change the behavior for UNDO_RETENTION growth and use of UNEXPIRED
extents. See Note 461480.1 for more information.

The following formula calculates the peak undo blocks generated per second:

SQL> SELECT undoblks/((end_time-begin_time)*86400) "Peak Undo Block Generation" FROM v$undostat

1 of 2 04-Feb-21, 04:24 PM
Document 262066.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

WHERE undoblks=(SELECT MAX(undoblks) FROM v$undostat);

Column END_TIME and BEGIN_TIME are DATE data types. When DATE data types are subtracted, the resulting value is
the # of days between both dates. To convert days to seconds, you multiply by 86400, the number of seconds in a day (24
hours * 60 minutes * 60 seconds).

The following query calculates the number of bytes needed to handle a peak undo activity:

SQL> SELECT (UR * (UPS * DBS)) AS "Bytes"


FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'),
(SELECT undoblks/((end_time-begin_time)*86400) AS UPS
FROM v$undostat
WHERE undoblks = (SELECT MAX(undoblks) FROM v$undostat)),
(SELECT block_size AS DBS
FROM dba_tablespaces
WHERE tablespace_name = (SELECT UPPER(value) FROM v$parameter WHERE name =
'undo_tablespace'));

For 10g and Higher Versions where Tuned undo retention is being used,please use below query:

SQL>SELECT (UR * (UPS * DBS)) AS "Bytes"

FROM (select max(tuned_undoretention) AS UR from v$undostat),


(SELECT undoblks/((end_time-begin_time)*86400) AS UPS
FROM v$undostat
WHERE undoblks = (SELECT MAX(undoblks) FROM v$undostat)),
(SELECT block_size AS DBS
FROM dba_tablespaces
WHERE tablespace_name = (SELECT UPPER(value) FROM v$parameter WHERE name = 'undo_tablespace'));

Didn't find what you are looking for?

2 of 2 04-Feb-21, 04:24 PM

You might also like