Ghulam Rasool, October 20, 2002 - 6:18 am UTC
Awan asked a good question and as usual YOU replied well. I wish the people who ask these kind of questions, read this.
Many thnaks for such a nice answer.
Awan, October 20, 2002 - 6:58 am UTC
Dear Kyte:
Well it is very good answer indeed. You are smart. I am happy that you explain the things in a very proper manner.
excellent advise
Eric D. Peterson, January 19, 2004 - 11:28 am UTC
A coworker and our DBA is recommend that we go from multiple tablespaces to just two (one for tables and one for indexes). This is part of our move from 8i to 9i. I've been trying to explain to them the usefullness of a variety of tablespaces with different extents sizes (your small, medium, large model). But to no avail. Can you provide more fodder for this discussion. I've been sending them various articles from here but would like some more concrete examples on why one tablespace may not be the best idea.
I haven't heard them say but I'd guess they are thinking of one tablespace with varying extent size. I've seen your comments on how that can lead to fragmented available space. Would this lead to a regular scheduled coalessing of the tablespace to defregment it?
Thanks much for any help you can provide.
Eric
January 19, 2004 - 12:59 pm UTC
I use two per application at most myself (usually just one -- both tables and indexes go into it)
using LMTs with autoallocate extents is just too easy to skip over. I've grown over the years to become very fond of that storage mechanism (wrote about it in my last book). Even easier than small medium and large.
how i handle bad interview questions
Ryan Gaffuri, January 19, 2004 - 2:09 pm UTC
I routinely get asked interview questions where the interviewer is looking for a buzzword response and they clearly have not even read the documentation. The most generic of these is 'How do you tune a query?'. They are looking for these buzzwords: explain plan, 'cost', full table scans, and cartesian joins.
The best way I have found to answer this is to do the following:
'I'm not sure what you are looking for. So first I'll give you the generic response, then I'll tell you how I do it and why it is better'.
The guys I talked to argued with me over ignoring 'cost', but after a little bit they realized I knew what I was doing. Occasionally you will get the true 'know it all' interviewing you who insists what is incorrect is correct. The vast majority of time people will realize you know more than they do. Since the people interviewing you have not read the documentation, that isn't saying much...
I get that SQL Tuning question almost every time.
Tom-- The OFA recommends using 7 tablespaces. Should it be re-written? Isn't that the official Oracle 'statement' on how to set up your tablespaces and datafiles?
I'm assuming by two tablespaces you mean Undo, data, and then a third for system right?
January 19, 2004 - 2:35 pm UTC
I'm talking at the "application level"
someone comes to me and says "hey, i have this new app we are going to put into your database that we just wrote. It does 'x'. Can you give me some space"
Well, I'll create them a single tablespace, with locally managed extents, set to autoallocate and tell them to leave off ALL storage clauses and use that single tablespace. At most, they might get two -- to separate tables from indexes, but not usually.
Thanks much for such clarity
Eric D. Peterson, January 19, 2004 - 3:03 pm UTC
Thanks that will help in our discussion. The current discourse now is on what are the advantages for each side. I.e. Using three tablespaces = better performance, better management of tables. versus. One tablespace = ease of use, better managment by allowing the database to handle it, easier coding.
But what would you say are the downsides to using three tablespaces versus one?
Thanks.
Eric
January 19, 2004 - 3:55 pm UTC
there really are not downsides in general to either implementation. It starts to come down to a matter a choice.
it is easier to judge growth in the uniform sized lmt.
if you don't know the ultimate size of all objects (and hence cannot figure out "s", "m", and "l"), autoallocate looks really good.
How to design VLDB (version 11gR2)
JUN GU, April 06, 2011 - 10:40 am UTC
The database is OLTP with heavy writing (inserting, merging) - 5 million orders messages (db size increases 6G per day). The goal is to handle 50 million orders per day.
The tables are partitioned by month and ASM is used to spread out I/O. We only keep two month data online, so every month we retire 2-month ago data.
Currently it runs fine. But with the goal 50 million orders per day (60G writing), the performance will become a problem. If the tables are partitioned by day, it would be a nightmare for the maintenance.
Also because of heavy writing, there are lots of redo logs generated (even after I turn off logging on some big tables). Currently, the redo log size is 1G, and log switch happens every 3~5 minutes during the peak time. With 50m orders, how can I handle the redo logs? How big can redo logs be?
I sometimes see indexes contention, will it be better if I put the indexes (on partitioned tables) locally instead of globally?
Thanks,
Jun
April 12, 2011 - 1:14 pm UTC
If the tables are partitioned by day, it would be a nightmare for the maintenance.
why?
(even after I turn off logging on some big tables)
I doubt that did anything for you. It would ONLY affect things like create table as select, sqlldr direct=y, insert /*+ append */, alter table t move and the like. It does NOTHING for insert, update, delete, merge. It does nothing for index maintenance.
But with the goal 50 million orders per day (60G writing), the performance will become a problem.
why - what reasons do you see for that, what are the technical issues you are anticipating. Give you have sufficient CPU, IO bandwidth (NOT storage, IO capabilities), this isn't going to be astronomical.
With 50m orders, how can I handle the redo logs?
Again, what issues do you anticipate? What do you have to do to "handle" redo logs other than
a) have the space
b) have the IO capabilities
c) have the plan in place to handle archiving, which you already have a need for
I sometimes see indexes contention, will it be better if I put the indexes (on partitioned tables) locally instead of globally?
"it depends". If the index was on LAST_NAME for example - it would probably be a really bad idea to use local indexes since a query of the form:
where last_name = ?
would have to scan each and every local index partition. It would make more sense to globally partition that index for retrieval AND for reducing insert contention.
An index on the partition key would be different of course, it would be local. However, an index on your date column (monotonically increasing value) will be a point of contention! It will be a right hand side index, always growing.
How to design VLDB (version 11gR2)
Martin, April 12, 2011 - 11:16 pm UTC
Hi Jun,
I am interested to know what kind of business you work for that handles 50 million orders per day?