Oracle7 Server SQL Reference

Contents Index Home Previous Next

CREATE ROLLBACK SEGMENT

Purpose

To create a rollback segment. A rollback segment is an object that Oracle7 uses to store data necessary to reverse, or undo, changes made by transactions.

Prerequisites

You must have CREATE ROLLBACK SEGMENT system privilege. Also, you must have either space quota on the tablespace to contain the rollback segment or UNLIMITED TABLESPACE system privilege.

If you are using Trusted Oracle7 in DBMS MAC mode, your DBMS label must dominate the tablespace's label.

Syntax

Keyword and Parameters

PUBLIC

specifies that the rollback segment is public and is available to any instance. If you omit this option, the rollback segment is private and is only available to the instance naming it in its initialization parameter ROLLBACK_SEGMENTS.

rollback_segment

is the name of the rollback segment to be created.

TABLESPACE

identifies the tablespace in which the rollback segment is created. If you omit this option, Oracle7 creates the rollback segment in the SYSTEM tablespace.

STORAGE

specifies the characteristics for the rollback segment. See the STORAGE clause [*].

OPTIMAL

specifies an optimal size in bytes for a rollback segment. You can also use K or M to specify this size in kilobytes or megabytes. Oracle7 tries to maintain this size for the rollback segment by dynamically deallocating extents when their data is no longer needed for active transactions. Oracle7 deallocates as many extents as possible without reducing the total size of the rollback segment below the OPTIMAL value.

NULL specifies no optimal size for the rollback segment, meaning that Oracle7 never deallocates the rollback segment's extents. This is the default behavior.

The value of this parameter cannot be less than the space initially allocated for the rollback segment specified by the MINEXTENTS, INITIAL, NEXT, and PCTINCREASE parameters. The maximum value varies depending on your operating system. Oracle7 rounds values to the next multiple of the data block size.

Usage Notes

The tablespace must be online for you to add a rollback segment to it.

When you create a rollback segment, it is initially offline. To make it available for transactions by your Oracle7 instance, you must bring it online using one of the following:

For more information on creating rollback segments and making them available, see the "Managing Rollback Segments" chapter of the Oracle7 Server Administrator's Guide.

A tablespace can have multiple rollback segments. Generally, multiple rollback segments improve performance. When you create a rollback segment in Trusted Oracle7, it is labeled with your DBMS label.

Example

The following statement creates a rollback segment with default storage values in the system tablespace:

CREATE ROLLBACK SEGMENT rbs_2
	TABLESPACE system;

The above statement is the equivalent of the following:

CREATE ROLLBACK SEGEMENT rbs_2
	TABLESPACE system
	STORAGE
	(	INITIAL 2
		MINEXTENTS 121
		MAXEXTENTS 10240
		NEXT 10240
		PCT_INCREASE 0 )

Related Topics

CREATE TABLESPACE command [*] CREATE DATABASE command [*] ALTER ROLLBACK SEGMENT command [*] DROP ROLLBACK SEGMENT command [*] STORAGE clause [*]


Contents Index Home Previous Next