Skip Headers
Oracle® Database SQL Language Reference
11g Release 2 (11.2)

Part Number E17118-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

ALTER ROLLBACK SEGMENT

Note:

Oracle strongly recommends that you run your database in automatic undo management mode instead of using rollback segments. Do not use rollback segments unless you must do so for compatibility with earlier versions of Oracle Database. Refer to Oracle Database Administrator's Guide for information on automatic undo management.

Use the ALTER ROLLBACK SEGMENT statement to bring a rollback segment online or offline, change its storage characteristics, or shrink it to an optimal or specified size.

This section assumes that your database is running in rollback undo mode (the UNDO_MANAGEMENT initialization parameter is set to MANUAL or not set at all). If your database is running in automatic undo mode (the UNDO_MANAGEMENT initialization parameter is set to AUTO, which is the default), then user-created rollback segments are irrelevant.

See Also:

Prerequisites

You must have the ALTER ROLLBACK SEGMENT system privilege.

Syntax

alter_rollback_segment::=

Description of alter_rollback_segment.gif follows
Description of the illustration alter_rollback_segment.gif

(storage_clause, size_clause::=)

Semantics

rollback_segment

Specify the name of an existing rollback segment.

ONLINE

Specify ONLINE to bring the rollback segment online. When you create a rollback segment, it is initially offline and not available for transactions. This clause brings the rollback segment online, making it available for transactions by your instance. You can also bring a rollback segment online when you start your instance with the initialization parameter ROLLBACK_SEGMENTS.

OFFLINE

Specify OFFLINE to take the rollback segment offline.

When the rollback segment is offline, it can be brought online by any instance.

To see whether a rollback segment is online or offline, query STATUS column of the data dictionary view DBA_ROLLBACK_SEGS. Online rollback segments have a value of IN_USE. Offline rollback segments have a value of AVAILABLE.

Restriction on Taking Rollback Segments Offline You cannot take the SYSTEM rollback segment offline.

storage_clause

Use the storage_clause to change the storage characteristics of the rollback segment.

Restrictions on Rollback Segment Storage You cannot change the value of INITIAL parameter. If the rollback segment is in a locally managed tablespace, then the only storage parameter you can change is OPTIMAL. If the rollback segment is in a dictionary-managed tablespace, then the only storage parameters you can change are NEXT, MINEXTENTS, MAXEXTENTS and OPTIMAL.

See Also:

storage_clause for syntax and additional information

SHRINK Clause

Specify SHRINK if you want Oracle Database to attempt to shrink the rollback segment to an optimal or specified size. The success and amount of shrinkage depend on the available free space in the rollback segment and how active transactions are holding space in the rollback segment.

If you do not specify TO size_clause, then the size defaults to the OPTIMAL value of the storage_clause of the CREATE ROLLBACK SEGMENT statement that created the rollback segment. If OPTIMAL was not specified, then the size defaults to the MINEXTENTS value of the storage_clause of the CREATE ROLLBACK SEGMENT statement.

Regardless of whether you specify TO size_clause:

To determine the actual size of a rollback segment after attempting to shrink it, query the BYTES, BLOCKS, and EXTENTS columns of the DBA_SEGMENTS view.

Restriction on Shrinking Rollback Segments In an Oracle Real Application Clusters environment, you can shrink only rollback segments that are online to your instance.

See Also:

size_clause for information on that clause, and "Resizing a Rollback Segment: Example"

Examples

The following examples use the rbs_one rollback segment, which was created in "Creating a Rollback Segment: Example".

Bringing a Rollback Segment Online: Example This statements brings the rollback segment rbs_one online:

ALTER ROLLBACK SEGMENT rbs_one ONLINE; 

Resizing a Rollback Segment: Example This statements shrinks the rollback segment rbs_one:

ALTER ROLLBACK SEGMENT rbs_one 
   SHRINK TO 100M;