Skip to Main Content
  • Questions
  • Combination of Locally Managed and Dictionary Managed TS

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Sridevi.

Asked: September 15, 2002 - 3:10 pm UTC

Last updated: April 16, 2009 - 12:16 pm UTC

Version: 9i Release 2

Viewed 1000+ times

You Asked

In a Oracle 9i Database, we are planning to have a Database with a combination of Locally Managed and Dictionary managed tablespaces. Is this possible?

The basic idea is that the Master and Transaction Tables will be dictionary managed. Other temporary tables where the data is often truncated and inserted through procedures (for generating reports), will be in a locally managed tablespace.These tables are temporary in the sense that data stored in them is temporary. But the table structure is pre-defined. There are scenrios where we prefer to use such temporary tables instead of global temporary tables.

With your vast experience, can you tell us if there are any drawbacks/ limitations in using such a combination of tablecpaces in the same database - if it is possibl to use such a combintion in the first place.

Thank You


and Tom said...

Yes, but you'll have to create system as DICTIONARY managed, else you'll get

12913, 00000, "Cannot create dictionary managed tablespace"
// *Cause: Attemp to create dictionary managed tablespace in database
// which has system tablespace as locally managed
// *Action: Create a locally managed tablespace.


Why Why Why do you want to use the slower, dumber, bad dictionary managed tablespaces? What possible theoritical (but wrong) reasoning could you have behind that?

The drawbacks are -- that dictionary managed tablespaces are bad, locally managed tablespaces are good and there is no reason to use a DMT at all.



Rating

  (14 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Combination of Locally Managed and Dictionary Managed TS

Ravi, September 15, 2002 - 10:12 pm UTC

From your answer you said we have to create system TS as dictionary managed, if we want to use both locally managed and dictionary managed tablespaces in DB.
Does it mean can I create system TS with locally managed extent management? What I understood uptill 9iR2 is, system tablespace has to be created dictionary managed at all times!!

Tom Kyte
September 16, 2002 - 7:12 am UTC

And in 9iR2, system can be locally managed and in fact the DEFAULT is for system to be locally managed (making dictionary managed OBSOLETE)

question about SPFILE and dictionary extent management

Fernando Sanchez, December 13, 2003 - 12:02 pm UTC

I get the ORA-12913 error when trying to create a dictionary extent managed tablespace.

I understand that Oracle does not recommend but I'd like to know if there is a way to modify my instance spfile in order to allow that management.



Tom Kyte
December 13, 2003 - 12:23 pm UTC

nothing to do with spfiles.

it is a choice you made at database creation time, you created the system tablespace as an LMT.

that means -- all other tablespaces will be, that database has no support for DMT's.

As there are no reasons I can dream of to use a DMT, this is a "good thing"

[tkyte@tkyte-pc-isdn tkyte]$ oerr ora 12913
12913, 00000, "Cannot create dictionary managed tablespace"
// *Cause: Attemp to create dictionary managed tablespace in database
// which has system tablespace as locally managed
// *Action: Create a locally managed tablespace.
[tkyte@tkyte-pc-isdn tkyte]$


temp tablespace

Reader, December 13, 2003 - 2:59 pm UTC

Tom, in 9i R2 database, can i create a temp tablespace with datafile clause using CREATE TABLESPACE datafile ....... TEMPORARY syntax? or should it be CREATE TEMPORARY syntax with tempfile clause? thanks.

Tom Kyte
December 13, 2003 - 3:27 pm UTC

with tempfiles.

Can I use locally Managed Tabelspaces for all apps?

Hannibal, February 26, 2004 - 2:54 am UTC

Hi Tom,

I found a oracle tool (sql trace analyzer) at metalink 224270.1. I wanted to test it but when tried
to run

create tablespace TRCA datafile '<some_path>trca01.dbf'
size 100M autoextend on next 100M permanent
default storage ( initial 1M next 1M)
extent management dictionary;

I got

ERROR at line 1:
ORA-12913: Cannot create dictionary managed tablespace

No surprise since my system tablespace is locally managed. The documentation to this tool clearly
says : 'you need to install this TRCA tool on a dictionary managed tablespace' ...

So i started to read about locally and dictonary managed Tabelspaces to find out why the documentation
tells my to create a dictonary managed tablespace - also asked my DBA. But I cant find any reason! I
searched this forum and you keep people telling, 'use locally managed tablespaces - faster, better' and
i found no reason why some application running in a dictonary managed tablespace should not run in a
locally managed one.

Am I missing something? Is there a reason why the trace analyzer (or any other appplication) MUST have
the dictonary managed tabelspace? Are they intercangeable in any situation or are there things where
you MUST keep them in the dictonary managed tablespace or things would fail?

Our DBA keeps creating the system tablespace as locally managed. He told me this is the default for
installing the database when I asked him why he does not use dictonary managed ones for system.

Sorry, when this questions sounds a little bit strange/silly. Matter of factly, it was 100% sure for me I could
use a locally managed tablespace for all my applications (I do so) until i found the trace-analyzer and did read
the documentation and I started to ask myself 'why does this docu from oracle say : use dictonary managed
tablespace? Is there someting I missed and I would mess up my database by running it on a locally managed
tablespace?'

1) Are locally and dictonary managed tablespaces 100% intercangeable?

2) What are the arguments for running system as Locally managed or dictonary managed?

thanks

Hannibal

Tom Kyte
February 26, 2004 - 10:00 am UTC

the reason here is because their script, that they have not updated, includes a create tablespace command that is dictionary managed. no other reason.

The reason you have to use dictionary managed is solely because "that is what the script is expecting".

you can certainly change the script, drop the dictionary managed part and it should never know.

I am impressed

Senthil Kumaravel, April 19, 2004 - 4:59 am UTC

It was very interesting and usefull.

Good and clear Questions and neat Explanations.

thats cool

santosh, April 23, 2004 - 8:24 am UTC

it was really great.
from this document only i came to know that in oracle 9i R2 we can not create dictionary managed tablespace unless we have system tablespace as dictionary managed .Really good.
But A SMALL QUESTION HOW TO CREATE DICTIONARY MANAGED SYSTEM TABLESPACE WHILE CREATING THE DATABASE?


Tom Kyte
April 23, 2004 - 1:28 pm UTC

you'd have to use the CREATE DATABASE statement manually.

</code> http://docs.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_55a.htm#2061235 <code>

if you omit the extent management clause system will be dictionary managed.

This document is of immense help

Tirtha S Mitra, June 29, 2004 - 3:37 am UTC

Thanks Tom, once again.... for your explanation.

A reader, August 27, 2006 - 6:53 pm UTC


Scofield, April 14, 2009 - 3:26 am UTC

Hi Tom

My db version is Oracle 9iR2,but tablespaces are dictionary managed.
Is there any performance gain, if I migrate the tablespaces from dictionary managed to locally managed?


Tom Kyte
April 14, 2009 - 11:24 am UTC

The main things locally managed offer are

a) faster extent allocation - both in serial and highly concurrent environments. They scale better if you are adding lots of extents frequently.

In general, this shouldn't be the case (if it is, alter your next extents so they grow a tad slower). So, while this is nice - it might not matter.

b) fast extent de-allocation. This only affects you if you truncate and release storage or drop things with lots of extents frequently. And quite frankly - if you do, you just need to adjust your initial/next extent sizes so the things you drop/truncate frequently have less extents.

So, again, nice - but it might not matter.

c) vastly improved storage allocation with system allocated extents. No more initial, next, pctincrease, minextents, maxextents. You just let us figure out how many extents of what size to use. Nothing could be easier.

But you already have everything in place.... so.....



I would not MIGRATE a tablespace to locally managed - that is sort of a hack. If you want to start utilizing locally managed tablespaces - you would create a new empty one (with system allocated extent sizes!) and either

1) alter move/rebuild segments into it.
2) dbms_redefinition them into it.

That is: you would 'reorganize' into it.

tablespace_migrate_to_local procedure

Shankar, April 15, 2009 - 3:07 pm UTC

Tom,

I have recently upgraded my test environment from 8.1.7.4 to 10.2.0.4 . I have converted dictionary managed tablespaces to locally managed using the package. We are doing application testing and everything looks fine.
I am planning to create new locally managed tablespaces and selectively move the objects from original tablespace later on , probably in next 6 months ..This way I thought I can some benefit of LMT for now. Is this a good approach.


Tom Kyte
April 15, 2009 - 4:39 pm UTC

you only need read my response right above this to know what I would say....

Shankar, April 15, 2009 - 9:25 pm UTC

Tom ,

The explanation is very clear. You dont prefer using package. I understand it is kind of hacking.My problem is I dont have enough time before the production upgrade to go through the list of objects and move them to new tablespace.Also practically there wont be enough time in
production in moving all the objects to new tablespace
at once.

Would you suggest to keep the tablespace in dictionary managed after upgrade to 10.2.0.4 If I decide to move in parts keep some of the objects still in dictionary managed

Lastly I dont understand why the package has been provided
if it is not much useful.

Please let me know your inputs.

Shankar
Tom Kyte
April 16, 2009 - 9:15 am UTC

And therefore, I suggested, don't do it - you didn't need to do it, you probably will not benefit from having done it.

Why did you do it, rather then me justify to you - you justify to me the technical reason you did it, what motivated you to do it?

Shankar, April 16, 2009 - 9:45 am UTC

Tom ,

I felt with this initially I can avoid the recursive operation of allocating and deallocating extents from uet$ and fet$ and avoid ST enqueues.
Later I was planning to create new tablespaces and move
all the objects to new locally managed tablespaces.

Regards,
Shankar


Tom Kyte
April 16, 2009 - 10:10 am UTC

but, like I said, if you drop and truncate - then you pay the penalty - and you would JUST FIX THE INITIAL/NEXT and be done with it. The next time you drop/truncate, you would deallocate very few extents - because you fixed the underlying problem.

And if you are allocating new extents at such a rate as to cause a problem, again, the fix was outlined above - fix you NEXT EXTENT SIZE.


Did you have an identified problem with extent allocation?

Shankar, April 16, 2009 - 11:58 am UTC

Tom,

The application team needs some tables to be truncated on daily basis and they load data. This is done during off hours.They have not informed us of any issues.
I believe this would update the dictionary tables.

Regards,
Shankar


Tom Kyte
April 16, 2009 - 12:16 pm UTC

You believe "what" would update the dictionary tables?

Not sure what "this" you are referring to


And like I said - if the performance of allocating/deallocating extents was an issue - the simple way to fix that would be.......... fix your NEXT EXTENT size on the affected segments so that you have tens of extents instead of hundreds or thousands.

IF you had an identified issue (which you didn't)
then
    assuming that issue was extent allocate/deallocate time on these 
    segments you truncate/load every day
    then
          alter those segments and increase their NEXT extent size (doubling 
          it would cut the extents in half, triple would ... and so on)
    end if
end if;

Shankar, April 16, 2009 - 12:20 pm UTC

Tom,

Thanks for your input.Appreciate your time .

Regards,
Shankar

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library