Rollbacklmt

199 views

Published on

oracle foreign key primary key constraints performance tuning MTS IOT 9i block size backup rman corrupted column drop rename recovery controlfile backup clone architecture database archives export dump dmp duplicate rows extents segments fragmentation hot cold blobs migration tablespace locally managed redo undo new features rollback ora-1555 shrink free space user password link TNS tnsnames.ora listener java shutdown sequence

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
199
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rollbacklmt

  1. 1. Rollback Segments in Locally Managed Tablespace Administration TipsCreating Rollback Segments in Locally Managed TablespaceThere is no fundamental problem in creating rollback segments in locally managedtablespace (LMTs). In fact, they lend themselves to being created in such tablespaces,because LMTs are designed to minimise the performance impact associated with constantacquisition and dropping of extents -and if there is one thing rollback segments are likelyto find themselves doing over time, it is frequently acquiring new extents (growing) andreleasing old ones (shrinking).But it is impossible to create the first rollback segment in locally managed tablespacewithout generating an ORA-1522: cannot use system rollback segment for non-systemtablespace BLAH error message.There are two underlying reasons for this.First, the only rollback segment created inherently with the database is one calledSYSTEM, stored in the SYSTEM tablespace, and known as the "system rollback segment".All other rollback segments have to be created by yourself, manually, after the databasehas been created and opened. The system rollback segment has always been reserved forhandling the DML on the data dictionary tables (which is generated when you perform DDLelsewhere in the database). It cannot hold the rollback for any DML statements affectingdata stored anywhere other than the SYSTEM tablespace. For all updates to data in a non-system tablespace, you must have a non-system rollback segment available to house therollback associated with that update.Second, Locally Managed Tablespaces record the acquisition of extents by segments in abitmap, stored at the beginning of the datafile with which the tablespace was firstcreated. The bitmap is initially 64K in size, and when a segment acquires an extent(either because it is being created, and thus acquiring its initial extent, or because data isbeing loaded into it and thus causing it to extend and acquire a next extent), the bitmaprecords the fact by flipping a "0" to a "1".Put these two points together, and the problem becomes clear: creating your very firstnon-system rollback segment in locally managed tablespace is a clear case of Catch-22. Tocreate such a segment, you need to update the bitmap of the LMT involved to show thatextents have been acquired by a new segment. But that requires updating data in a non-system tablespace. And any updates to data in a non-system tablespace have to have theirrollback stored in a non-system rollback segment -which doesnt yet exist, because thatsprecisely what youre trying to create in the first place!!Fortunately, the cure is easy. Just create a temporary non-system rollback segmentsomewhere (it will have to be a dictionary-managed tablespace, obviously), and allow thatto store the rollback generated by the bitmap update when you create the first rollbacksegment in a locally managed tablespace. Once the new LMT rollback segment is thenCopyright © Howard Rogers 2001 10/18/2001 Page 1 of 2
  2. 2. Rollback Segments in Locally Managed Tablespace Administration Tipscreated and brought online, it can become the segment that houses all rollback generatedby the creation of all other LMT rollback segments, and there is thus no need to retain theoriginal, temporary, dictionary-managed rollback segment at all.Putting that into a sequence of simple steps, then, you might try something like this:CREATE ROLLBACK SEGMENT TEMPRBS TABLESPACE SYSTEM;ALTER ROLLBACK SEGMENT TEMPRBS ONLINE;CREATE ROLLBACK SEGMENT RBS1 TABLESPACE RBSLMT;ALTER ROLLBACK SEGMENT RBS1 ONLINE;ALTER ROLLBACK SEGMENT TEMPRBS OFFLINEDROP ROLLBACK SEGMENT TEMPRBS;CREATE ROLLBACK SEGMENT RBS2 TABLESPACE RBSLMT;CREATE ROLLBACK SEGMENT RBS3 TABLESPACE RBSLMT;...and so on.The key thing to note here is that the temporary first rollback segment is being createdwithin the SYSTEM tablespace. This does not make this a system rollback segment. Thattitle is reserved for the segment created at the same time as the database was createdwith the actual name SYSTEM. So, even though housed within the system tablespace, thisnew rollback segment is allowed to house rollback generated by updates to data takingplace in non-system tablespaces -including our subsequent update to the bitmap at thestart of the "rbslmt" tablespace.Now you dont have to create the temporary rollback segment in the system tablespace -any old dictionary-managed tablespace will do. Indeed, it is usually frowned upon tocreate any segments of your own within the system tablespace. So if you can create itelsewhere, do so. The only reason I show the system tablespace being used here isbecause (1) its guaranteed to exist; (2) its guaranteed to be dictionary-managed and (3)the segment being created is so small that it probably wont do any damage to house itthere.Copyright © Howard Rogers 2001 10/18/2001 Page 2 of 2

×