DBA Hub

📋Steps in this guide1/9

Undo Tablespace Management in Oracle Database

Learn how to manage Undo Tablespace in Oracle Database. Understand its purpose, configuration, retention, and best practices for stable and efficient database performance.

oracle configurationintermediate
by OracleDba
45 views
1

What is an Undo Tablespace?

An Undo tablespace stores undo records generated by DML operations (INSERT, UPDATE, DELETE). These records are used to: - Roll back uncommitted transactions Roll back uncommitted transactions - Provide read consistency for queries Provide read consistency for queries - Support flashback features like and Support flashback features like and - Recover transactions during instance recovery Recover transactions during instance recovery
2

Types of Undo Management in Oracle

Oracle offers two undo management modes: - Manual Undo Management (Deprecated) Uses rollback segments manually created and managed by DBAs. Obsolete from Oracle 9i onwards. Manual Undo Management (Deprecated) - Uses rollback segments manually created and managed by DBAs. Uses rollback segments manually created and managed by DBAs. - Obsolete from Oracle 9i onwards. Obsolete from Oracle 9i onwards. - Automatic Undo Management (AUM) (Recommended) Managed automatically by Oracle. You only need to create and assign undo tablespaces. Controlled by the initialization parameter: Automatic Undo Management (AUM) (Recommended) - Managed automatically by Oracle. Managed automatically by Oracle. - You only need to create and assign undo tablespaces. You only need to create and assign undo tablespaces. - Controlled by the initialization parameter: Controlled by the initialization parameter:
3

How Undo Tablespace Works

When a transaction modifies data: - Old values are written to the undo tablespace . Old values are written to the undo tablespace . - If the transaction is rolled back, Oracle restores these old values. If the transaction is rolled back, Oracle restores these old values. - Queries that started before the change can still see the consistent old data. Queries that started before the change can still see the consistent old data. Oracle automatically reuses undo space when it’s no longer needed, based on undo retention .
4

Creating an Undo Tablespace

Run the following SQL as SYSDBA :
5

Switching to a New Undo Tablespace

If you want to switch the active undo tablespace: You can then drop the old one (after verifying it’s not in use):
6

Viewing Undo Tablespace Information

To check which undo tablespace is active: Check undo usage:
7

Setting Undo Retention

Undo retention determines how long undo data is preserved after a transaction commits. Set it using: If you want Oracle to strictly keep undo data for 900 seconds:
8

Best Practices for Undo Management

Use Automatic Undo Management ( ) Create separate undo tablespaces for different PDBs in Multitenant environments Enable AUTOEXTEND for undo datafiles Monitor undo space with and Periodically resize undo tablespaces based on workload trends
9

Undo Management in Oracle RAC

In Oracle RAC , each instance must have its own undo tablespace: This ensures proper transaction isolation between nodes.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!