ORA-01552: Cannot Use System Rollback Segment - Configure Undo Tablespace
ORA-01552: Cannot Use System Rollback Segment for Non-System Tablespace
Section titled “ORA-01552: Cannot Use System Rollback Segment for Non-System Tablespace”Error Overview
Section titled “Error Overview”Error Text: ORA-01552: cannot use system rollback segment for non-system tablespace 'string'
The ORA-01552 error occurs when a transaction modifies data in a non-SYSTEM tablespace but Oracle has no user-defined rollback segment or undo tablespace available to record undo for that transaction. Oracle falls back to the SYSTEM rollback segment in this situation, but the SYSTEM rollback segment is prohibited from servicing transactions against non-SYSTEM tablespaces as a protective measure. The result is a hard error that prevents the transaction from executing.
This error is most commonly seen in databases using manual undo management (pre-Automatic Undo Management) that have insufficient or misconfigured rollback segments, or in newly restored/created databases that have not yet had an undo tablespace properly configured.
Common Causes
Section titled “Common Causes”1. No Undo Tablespace Configured (AUM Not Properly Set Up)
Section titled “1. No Undo Tablespace Configured (AUM Not Properly Set Up)”- Database is running with
UNDO_MANAGEMENT = AUTObutUNDO_TABLESPACEis not set or points to a tablespace that does not exist - A newly cloned or restored database was opened without first creating or pointing to a valid undo tablespace
2. Undo Tablespace Dropped or Inaccessible
Section titled “2. Undo Tablespace Dropped or Inaccessible”- The undo tablespace was accidentally dropped
- The undo tablespace datafile is offline, making the tablespace unavailable for new transactions
- The database was restored to a point in time before the undo tablespace was created
3. Manual Undo Management with No Online Rollback Segments
Section titled “3. Manual Undo Management with No Online Rollback Segments”- Database is running with
UNDO_MANAGEMENT = MANUALbut all user-defined rollback segments are offline - Rollback segments exist but none have been brought online (via
ALTER ROLLBACK SEGMENT ... ONLINEor theROLLBACK_SEGMENTSinit parameter) - The only segment available is the SYSTEM rollback segment, which cannot serve non-SYSTEM tablespaces
4. Migration from Manual to Automatic Undo Management Incomplete
Section titled “4. Migration from Manual to Automatic Undo Management Incomplete”- The
UNDO_MANAGEMENTparameter was changed toAUTOin the spfile, but the database was restarted without having created an undo tablespace first - An undo tablespace was created under a different name than what
UNDO_TABLESPACEspecifies
5. Database Opened in Restricted or Upgrade Mode
Section titled “5. Database Opened in Restricted or Upgrade Mode”- Opening in
MIGRATEorUPGRADEmode can limit undo availability - A database opened for maintenance without the standard undo infrastructure
Diagnostic Queries
Section titled “Diagnostic Queries”Check Current Undo Configuration
Section titled “Check Current Undo Configuration”-- Review all undo-related initialization parametersSELECT name, value, descriptionFROM v$parameterWHERE name IN ( 'undo_management', 'undo_tablespace', 'undo_retention', 'rollback_segments')ORDER BY name;
-- Confirm what undo tablespace the database currently usesSELECT tablespace_name, status, contents, retention, block_sizeFROM dba_tablespacesWHERE contents = 'UNDO'ORDER BY tablespace_name;Check Undo Tablespace Datafiles
Section titled “Check Undo Tablespace Datafiles”-- Check datafiles belonging to undo tablespacesSELECT d.tablespace_name, d.file_name, d.status, ROUND(d.bytes / 1024 / 1024, 2) AS size_mb, d.autoextensible, ROUND(d.maxbytes / 1024 / 1024 / 1024, 2) AS max_gbFROM dba_data_files dJOIN dba_tablespaces t ON d.tablespace_name = t.tablespace_nameWHERE t.contents = 'UNDO'ORDER BY d.tablespace_name, d.file_name;
-- Also check v$datafile for online statusSELECT df.file#, df.name, df.status, ts.name AS tablespace_nameFROM v$datafile dfJOIN v$tablespace ts ON df.ts# = ts.ts#WHERE ts.name IN ( SELECT tablespace_name FROM dba_tablespaces WHERE contents = 'UNDO');Check Rollback Segments (Manual Undo Management)
Section titled “Check Rollback Segments (Manual Undo Management)”-- View all rollback segments and their statusSELECT segment_name, owner, tablespace_name, status, initial_extent, next_extent, max_extents, min_extentsFROM dba_rollback_segsORDER BY status, segment_name;
-- Check v$rollname for currently online rollback segmentsSELECT usn, name, xacts, rssize, writes, statusFROM v$rollstat rJOIN v$rollname n ON r.usn = n.usnORDER BY usn;Check Active Transactions and Their Undo Usage
Section titled “Check Active Transactions and Their Undo Usage”-- Identify active transactions and which rollback/undo segment they useSELECT s.sid, s.serial#, s.username, s.status, t.used_ublk, t.used_urec, t.start_time, r.name AS rollback_segmentFROM v$session sJOIN v$transaction t ON s.taddr = t.addrLEFT JOIN v$rollname r ON t.xidusn = r.usnORDER BY t.used_ublk DESC;Check the Alert Log for Undo-Related Messages
Section titled “Check the Alert Log for Undo-Related Messages”-- Look for undo configuration errors at startup and runtimeSELECT originating_timestamp, message_textFROM v$diag_alert_extWHERE message_text LIKE '%ORA-01552%' OR message_text LIKE '%undo%' OR message_text LIKE '%rollback segment%' OR message_text LIKE '%UNDOTBS%'ORDER BY originating_timestamp DESCFETCH FIRST 50 ROWS ONLY;Step-by-Step Resolution
Section titled “Step-by-Step Resolution”1. Create an Undo Tablespace (If None Exists)
Section titled “1. Create an Undo Tablespace (If None Exists)”The most common fix for a newly built or restored database running AUM:
-- Create a new undo tablespaceCREATE UNDO TABLESPACE undotbs1 DATAFILE '/u01/oradata/orcl/undotbs01.dbf' SIZE 2G AUTOEXTEND ON NEXT 256M MAXSIZE 20G RETENTION NOGUARANTEE;
-- Set the database to use the new undo tablespaceALTER SYSTEM SET undo_tablespace = undotbs1 SCOPE=BOTH;
-- Verify the changeSELECT name, value FROM v$parameter WHERE name = 'undo_tablespace';2. Switch to an Existing Undo Tablespace
Section titled “2. Switch to an Existing Undo Tablespace”If an undo tablespace already exists but the parameter points to a non-existent or wrong tablespace:
-- Find existing undo tablespacesSELECT tablespace_name, status FROM dba_tablespaces WHERE contents = 'UNDO';
-- Switch to the correct oneALTER SYSTEM SET undo_tablespace = undotbs1 SCOPE=BOTH;
-- Immediately confirm the undo tablespace is activeSELECT value FROM v$parameter WHERE name = 'undo_tablespace';
-- Confirm it is ONLINESELECT tablespace_name, status FROM dba_tablespaces WHERE contents = 'UNDO';3. Bring Offline Rollback Segments Online (Manual Undo Management)
Section titled “3. Bring Offline Rollback Segments Online (Manual Undo Management)”If the database uses manual undo management and rollback segments are offline:
-- Bring individual rollback segments onlineALTER ROLLBACK SEGMENT rbs01 ONLINE;ALTER ROLLBACK SEGMENT rbs02 ONLINE;ALTER ROLLBACK SEGMENT rbs03 ONLINE;ALTER ROLLBACK SEGMENT rbs04 ONLINE;
-- Confirm they are now onlineSELECT segment_name, status FROM dba_rollback_segs WHERE segment_name != 'SYSTEM';To make this permanent across restarts, add the segments to the init parameter:
-- In spfile: add rollback_segments parameterALTER SYSTEM SET rollback_segments = 'RBS01,RBS02,RBS03,RBS04' SCOPE=SPFILE;-- Requires restart to persist4. Migrate from Manual Undo Management to Automatic Undo Management
Section titled “4. Migrate from Manual Undo Management to Automatic Undo Management”The recommended long-term resolution for any database still using manual rollback segments:
-- Step 1: Create the undo tablespace (if not already present)CREATE UNDO TABLESPACE undotbs1 DATAFILE '/u01/oradata/orcl/undotbs01.dbf' SIZE 4G AUTOEXTEND ON NEXT 512M MAXSIZE 32G;
-- Step 2: Set the undo management parameters in spfileALTER SYSTEM SET undo_management = AUTO SCOPE=SPFILE;ALTER SYSTEM SET undo_tablespace = undotbs1 SCOPE=SPFILE;-- Remove the old rollback_segments parameter if setALTER SYSTEM RESET rollback_segments SCOPE=SPFILE;
-- Step 3: Restart the database-- SHUTDOWN IMMEDIATE; STARTUP;
-- Step 4: After restart, verify AUM is activeSHOW PARAMETER undo_management;SHOW PARAMETER undo_tablespace;
-- Step 5: Verify no active transactions on old rollback segmentsSELECT segment_name, status, xacts FROM v$rollstat rJOIN v$rollname n ON r.usn = n.usnWHERE n.name NOT IN ('SYSTEM', '_SYSSMU%');
-- Step 6: Take old public rollback segments offline once drained-- (Only after confirming no active transactions)ALTER ROLLBACK SEGMENT rbs01 OFFLINE;
-- Step 7: Drop the old rollback segments and their tablespaceDROP ROLLBACK SEGMENT rbs01;DROP ROLLBACK SEGMENT rbs02;-- ... repeat for all manual segments
DROP TABLESPACE rbs_tablespace INCLUDING CONTENTS AND DATAFILES;5. Repair an Undo Tablespace After Datafile Loss
Section titled “5. Repair an Undo Tablespace After Datafile Loss”If the undo tablespace datafile was lost and needs to be restored:
-- From RMAN: restore the undo tablespaceRUN { SQL 'ALTER TABLESPACE undotbs1 OFFLINE IMMEDIATE'; RESTORE TABLESPACE undotbs1; RECOVER TABLESPACE undotbs1; SQL 'ALTER TABLESPACE undotbs1 ONLINE';}If no backup exists and undo transactions are not needed (no active transactions were in-flight):
-- Recreate the undo tablespace as an emergency measure-- WARNING: Any in-flight transactions using the old undo tablespace will be lost-- This is only appropriate if the database was shut cleanly
-- Drop the old broken undo tablespace reference-- (Only if you cannot restore it and the database is in a clean state)ALTER SYSTEM SET undo_tablespace = '' SCOPE=SPFILE;
-- Restart and create a new undo tablespaceCREATE UNDO TABLESPACE undotbs_new DATAFILE '/u01/oradata/orcl/undotbs_new01.dbf' SIZE 4G AUTOEXTEND ON;
ALTER SYSTEM SET undo_tablespace = undotbs_new SCOPE=BOTH;Prevention Strategies
Section titled “Prevention Strategies”1. Monitor Undo Tablespace Health
Section titled “1. Monitor Undo Tablespace Health”-- Create a procedure to monitor undo tablespace availability and usageCREATE OR REPLACE PROCEDURE monitor_undo_tablespace AS v_undo_ts VARCHAR2(30); v_ts_status VARCHAR2(10); v_used_pct NUMBER;BEGIN -- Get current undo tablespace SELECT value INTO v_undo_ts FROM v$parameter WHERE name = 'undo_tablespace';
-- Check its status SELECT status INTO v_ts_status FROM dba_tablespaces WHERE tablespace_name = v_undo_ts;
-- Check space usage SELECT ROUND( (1 - NVL(SUM(f.bytes),0) / SUM(d.bytes)) * 100, 1 ) INTO v_used_pct FROM dba_data_files d LEFT JOIN dba_free_space f ON d.tablespace_name = f.tablespace_name WHERE d.tablespace_name = v_undo_ts GROUP BY d.tablespace_name;
IF v_ts_status != 'ONLINE' THEN DBMS_OUTPUT.PUT_LINE( 'CRITICAL: Undo tablespace ' || v_undo_ts || ' is ' || v_ts_status ); ELSIF v_used_pct > 80 THEN DBMS_OUTPUT.PUT_LINE( 'WARNING: Undo tablespace ' || v_undo_ts || ' is ' || v_used_pct || '% full' ); END IF;END;/
BEGIN DBMS_SCHEDULER.CREATE_JOB( job_name => 'MONITOR_UNDO_TS_JOB', job_type => 'STORED_PROCEDURE', job_action => 'monitor_undo_tablespace', repeat_interval => 'FREQ=MINUTELY;INTERVAL=30', enabled => TRUE, comments => 'Monitor undo tablespace status and space usage' );END;/2. Validate Undo Configuration After Restores and Clones
Section titled “2. Validate Undo Configuration After Restores and Clones”-- Post-restore checklist: run these queries after any database restore-- 1. Confirm AUM is activeSELECT name, value FROM v$parameter WHERE name IN ('undo_management','undo_tablespace');
-- 2. Confirm the undo tablespace is ONLINESELECT tablespace_name, status FROM dba_tablespaces WHERE contents = 'UNDO';
-- 3. Confirm there is free space in the undo tablespaceSELECT d.tablespace_name, ROUND(SUM(d.bytes)/1024/1024/1024, 2) AS total_gb, ROUND(NVL(SUM(f.bytes),0)/1024/1024/1024, 2) AS free_gbFROM dba_data_files dLEFT JOIN dba_free_space f ON d.tablespace_name = f.tablespace_nameWHERE d.tablespace_name IN (SELECT tablespace_name FROM dba_tablespaces WHERE contents='UNDO')GROUP BY d.tablespace_name;
-- 4. Confirm autoextend is onSELECT file_name, autoextensible, ROUND(maxbytes/1024/1024/1024,2) AS max_gbFROM dba_data_filesWHERE tablespace_name IN (SELECT tablespace_name FROM dba_tablespaces WHERE contents='UNDO');3. Configuration Best Practices
Section titled “3. Configuration Best Practices”- Always use Automatic Undo Management (
UNDO_MANAGEMENT=AUTO) for all Oracle 9i and later databases — manual rollback segment management is obsolete and error-prone - Size the undo tablespace generously: use the formula
UNDO_SIZE = UNDO_RETENTION * UPS * DB_BLOCK_SIZE * 1.1, where UPS is undo blocks generated per second (fromv$undostat) - Enable
AUTOEXTEND ONon undo tablespace datafiles with a reasonableMAXSIZEto handle burst workloads - Set
UNDO_RETENTIONto cover the longest expected long-running query or report - Always include undo tablespace datafiles in the RMAN backup — without them, the undo tablespace cannot be restored
Diagnostic Scripts
Section titled “Diagnostic Scripts”These Oracle Day by Day scripts can help diagnose undo-related issues:
- vrolluse.sql — Rollback and undo segment usage analysis
Related Errors
Section titled “Related Errors”- ORA-01555 - Snapshot too old
- ORA-01650 - Unable to extend rollback segment
- ORA-30036 - Unable to extend segment in undo tablespace
- ORA-01653 - Unable to extend table
Emergency Response
Section titled “Emergency Response”Immediate Assessment
Section titled “Immediate Assessment”-- What undo management mode is the database in?SELECT name, value FROM v$parameter WHERE name IN ('undo_management', 'undo_tablespace');
-- Is there an undo tablespace and is it online?SELECT tablespace_name, status FROM dba_tablespaces WHERE contents = 'UNDO';
-- Are there any online user rollback segments?SELECT segment_name, status FROM dba_rollback_segsWHERE segment_name != 'SYSTEM' ORDER BY status;Immediate Actions
Section titled “Immediate Actions”- Identify the undo management mode — AUM (
UNDO_MANAGEMENT=AUTO) and manual management have different fixes - For AUM databases: verify the
UNDO_TABLESPACEparameter points to an existing, online undo tablespace; if not, create one immediately and runALTER SYSTEM SET undo_tablespace = ... - For manual undo databases: bring rollback segments online immediately with
ALTER ROLLBACK SEGMENT ... ONLINE, then plan migration to AUM - Do not attempt to run DML against non-SYSTEM tablespaces until undo is available — transactions will fail immediately
Post-Resolution Verification
Section titled “Post-Resolution Verification”-- Confirm undo is now fully functionalSHOW PARAMETER undo;
-- Confirm tablespace is onlineSELECT tablespace_name, status, retention FROM dba_tablespaces WHERE contents = 'UNDO';
-- Confirm transactions can now use undo (run a test DML in a non-system schema)-- SELECT * FROM v$undostat ORDER BY begin_time DESC FETCH FIRST 3 ROWS ONLY;
-- Review recent undo activity to confirm normal operationSELECT TO_CHAR(begin_time, 'DD-MON-YY HH24:MI') AS period, undoblks, maxquerylen, ssolderrcnt, unxpstealcntFROM v$undostatORDER BY begin_time DESCFETCH FIRST 10 ROWS ONLY;