Re: Oracle's use of tablespaces

From: Lee Parsons <lparsons_at_exlog.com>
Date: Mon, 30 Aug 93 17:08:00 GMT
Message-ID: <1993Aug30.170800.12805_at_exlog.com>


In article <Aug.30.08.06.55.1993.1882_at_andromeda.rutgers.edu> holowcza_at_andromeda.rutgers.edu (Richard D Holowczak) writes:
>grimes_at_access.digex.net (Seth Grimes) writes:
>
>>Why does Oracle use tablespaces? On the balance, they seem unnecessarily
>>complicated given the advantages they offer.
 

>>Tablespaces are reminiscent (to me) of the IBM mainframe world: allocate a
>>file and then create it. It would make more sense to me to create the file
>>with some quota mechanism to limit it size or the number of extents, but not
>>actually tie up disk space that's not used, which is what happens with
>>tablespaces (or am I not using them correctly?). If a query needs a lot of
>>disk space, say for a sort or temporary tables, let the server grab the space
>>for the duration of the operation and then free it to the OS when the
>>operation ends. Oracle seems to need permanently allocated space, however.
>>For instance, I recently had to create a 50M TEMP tablespace for a query
>>joining a 10k-row table with a 1k-row table. Why should this space persist
>>after I'm done this query? For comparison, Ingres allows the DBA to specify
>
> What would you do with the freed space if you had it ? You probably
> would not want to use it up since the next time you wish to run a
> query you'll need it back.
>
> What happens when you guess wrong and the OS can't grab the space it
> needs ? What should the query do ? Abort ? In a real production
> environment, this kind of mistake can be very costly. I think Oracle
> is just taking the safest road. Make sure space is available no
> matter what else is going on.
>

Except that the query can still fail if 50M temp space is taken up by another query. The Pre-allocate tablespace scheme isn't any kind of guarantee from the DB that you are going to have enough disk space to run your query/update. It works exactly the same way as it would in the OS if it is there use it, if not abort.

I think Seth answered his own question, it is really a portability/support issue. Given that you have to write all this code anyway for systems that don't have the native file control that oracle wants, it makes sence that you would use it on across all platforms. This way your development/support groups could be as generic as possible and the starup costs of a new platform are reduces.

The only reason beyond that I can think of is the use of raw partitions You have to have put all this code in to support non FS tablespaces anyway why not useit.

Isn't it easier for Oracle to keep a FS datafile in one contiguous piece on disk if they control space management. Granted they still have fragmentation/chaining but by writing there own space managment system they can keep track of whats going on and not have to know anything about the OS.

-- 
Regards, 

Lee E. Parsons                  		Baker Hughes Inteq, Inc
Oracle Database Administrator 			lparsons_at_exlog.com 
Received on Mon Aug 30 1993 - 19:08:00 CEST

Original text of this message