Oracle - Tablespace Locally Management Tablespaces
Oracle - Tablespace Locally Management Tablespaces
Administration Tips
10/17/2001
Page 1 of 3
Administration Tips
As for performance: there's no question: Locally Managed tablespaces every time. The issue is one of dynamic extent allocation and de-allocation. When a table runs out of space in Dictionary Managed tablespace, it has to consult and update the Data Dictionary to record the acquisition of a new extent. That involves doing inserts on the UET$ table (which records used extents) and deletes from the FET$ table (which records free extents) -because an allocation of a new extent means you've gained some more used space, but lost some old free space. Inserts and deletes are both expensive in the amount of redo they generate -one half of the redo is always the entire row being inserted or deleted. That's multi-byte-sized redo. The rollback for a delete is also the entire row. So the updates to FET$ suffer the double-whammy of expensive redo AND rollback. That translates into relatively slow extent allocation... and, of course, the same happens whenever extents are de-allocated (by means of a truncate or drop command). In Locally Managed tablespace, however, extent allocations are controlled by setting a bit in a bitmap at the head of the tablespace. A bit of "1" indicates an extent is allocated, and a bit of "0" means it's free. An extent allocation by a table now therefore consists of updating a "0" to a "1". That's a trivially small operation, the redo and rollback for which would be correspondingly tiny (and hence quick to perform). Dynamic extent allocations and de-allocations are therefore easy meat for Locally Managed tablespaces -and that translates into better performance during normal working hours. (It's true that there are still some updates in the data dictionary to record which table has acquired the extent, but you'd be doing those anyway, whatever type of tablespace you have -they are therefore not a factor that needs to be taken into account when deciding on the one type or the other). In particular, where do dynamic extent allocations and de-allocations happen all the time? In TEMP and ROLLBACk tablespace, that's where. So, even if you don't want to implement Locally Managed tablespaces throughout your entire database, you really ought to make those two specific tablespace types locally managed. Which brings me to the one nasty with Locally Managed tablespace for rollback segments:it is impossible to create your first rollback segment in a Locally Managed tablespace unless there is already in existence a non-system rollback segment in Dictionary Managed tablespace. That's because creating the first segment requires updating the bitmap of the tablespace to record the extent allocations. -and that's an update to a non-SYSTEM tablespace, which are not permitted if the system rollback segment is the only one you've got. You therefore have to create a rollback segment in some Dictionary Managed tablespace first -and that tablespace can be the SYSTEM tablespace if you like (being created in the SYSTEM tablespace doesn't make it a system rollback segment). Once that's been created and brought online, you can create the real segment in Locally Managed tablespace without a problem. And once that's been brought online, you don't need the Dictionary Managed one
Copyright Howard Rogers 2001 10/17/2001 Page 2 of 3
Administration Tips
at all any more, so you can simply offline it and then drop it. The creation of all other rollback segments in Locally Managed tablespace is then handled perfectly well by the first one you managed to create. One final word: it is 100% utterly impossible to create the SYSTEM tablespace itself as Locally Managed, despite the Oracle documentation itself telling you that it is possible. The documentation is wrong. SYSTEM is Dictionary Managed, even in Oracle 9i, and there's nothing you can do about it. Neither is there any need to want to do anything about it. SYSTEM breaks most of the "good DBA" rules, including this one, and it is fine that it does so. It knows what it is doing, and has been designed and tuned to do it that way. Don't try and second-guess Oracle on this one!
10/17/2001
Page 3 of 3