Tip

Optimal size of rollback segments

This script displays the optimal size of rollback segments created in the database.

		
-- -------------------------------
-- Marcelo Castanho
-- castanho@sun.com
-- -------------------------------
-- Rollback Segments (Optimal Size)
-- -------------------------------
column "Segment Name" format a15
column "Optimal Size" format 999,999,999,999
column "Status" format a25

spool optimal_size
select a.name "Segment Name",
       b.optsize "Optimal Size",
       b.status "Status"
from   v$rollname a,
       v$rollstat b
where a.usn=b.usn
/
spool off
exit

Reader Feedback

Jay W. writes: "I can appreciate the value of reporting the "what is" size of optimal rollback. What would be really useful to me is a tip to help me tune what the optimal rollback size should be."

Ashok T. writes: "I am not getting any optimal size value from this query."

Rohit D. writes: I agree with comments of Jay W. I thought the tip would tell me how to tune and arrive at optimal size and not just to find existing values. So, I'd like to share a query and a matrix of actions to tune optimal size.

1. Query:

 
select a.name, b.extents, b.rssize,
 b.optsize, b.shrinks, b.aveshrink,
 b.aveactive, b.wraps, b.extends, b.status
from v$rollname a, v$rollstat b
where a.usn = b.usn;
2. Here is the matrix:
SHRINKS		AVESHRINK	OPTSIZE
-------		---------	---------------------------------
High

    Requires Free Membership to View

High Too low, increase optimal High Low Too low, increase optimal Low Low Too high, reduce optimal (unless nearly equal to AVEACTIVE) Low High OK

This matrix gives an indication of when and how to tune the optimal size of rollback segments. Essentially, when the number of "SHRINKS" is low and the "AVGSHRINK" size in bytes is high, the size of rollback segments is considered "optimized."

If you need to know the reference, it's "DBA Certification Exam Guide" by Jason S. Couchman (Oracle Press).

Jose M. writes: "The problem with this tip is that it's of little value; it's like telling a car mechanic where to find the carburetor on an engine. If you understand what "optimal size of rollback segments" means then you most definitely know where to find it."

For More Information

  • What do you think about this tip? E-mail the Editor at tdichiara@techtarget.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

This was first published in May 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.