Manage Learn to apply best practices and optimize your operations.

Managing rollback segments

Sizing rollback segments can be a difficult task, especially with new applications. Here are a few tips and a script to help out.

Sizing rollback segments can be a difficult task, especially with new applications. A good rule of thumb when sizing a rollback segments is to start by creating each rollback segment with a total rollback segment size at 10% of the largest table in the database. I like to start by splitting the rollback segments into 10 extents, and use "Maxextents Unlimited". You should use smaller extents sizes for OLTP databases, and larger segments in a batch environment. Use the OPTIMAL parameter to maintain a specific size for your rollback segments. If you are in a mixed environment (and who isn't these days), try to get the developers to use the "SET TRANSACTION USE ROLLBACK SEGMENT" command in to point at a specific rollback segment.

After taking your first guess at the rollback segment size, you need to monitor the rollback segments. The following query will give you statistics on your rollback segments. Increase the "Optimal" size in order to reduce the number of "Shrinks" and "Wraps".

col segment_name format a10 head 'Rollback|Segment'
col owner format a10 head 'Owner'
col tablespace_name format a15 head 'Tablespace|Name'
col init format 99999.99
col next format 99999.99
col opt format 99999.99
col extents format 999 head 'Ext'
col min_extents format 999 head 'Min|Ext'
col max_extents format 999 head 'Max|Ext'
col pct_increase format 999 head 'Max|Ext'
col status format A7 

select 
  s.segment_id, s.segment_name, s.owner, s.tablespace_name,
  s.initial_extent/1024/1024 Init, s.next_extent/1024/1024 Next,
  v.optsize/1024/1024 Opt, v.extents, v.shrinks, v.wraps, s.min_extents,
  s.max_extents, s.pct_increase, s.status 
from 
  sys.dba_rollback_segs s,
  v$rollstat v 
where
  v.usn = s.segment_id    
order by 1 ;

About the Author

James Giordano is an Oracle database administrator. He has been working with Oracle for about seven years, and also has experience with UNIX and PeopleSoft/Oracle financials.

For More Information

  • Feedback: E-mail the editor with your thoughts about this tip.
  • More tips: Hundreds of free Oracle tips and scripts.
  • Tip contest: Have an Oracle tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize -- submit your tip today!
  • Ask the Experts: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.
  • Forums: Ask your technical Oracle questions--or help out your peers by answering them--in our active forums.
  • Best Web Links: Oracle tips, tutorials, and scripts from around the Web.

Dig Deeper on Oracle and SQL

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close