Balancing Instances and schemas
Tony Fernandez, August 07, 2009 - 2:53 pm UTC
Tom,
You mentioned "There is no reason to break up a database because of some number of schemas", so if it is not by the number of schemas, is there any other gain/reason that you know of, where running four instances in same the box is best and only for that case?
The background on this question is because I currently have a performance tuning project under one of those 4 instances. I want to recommend the possibility of merging all instances into one. But before that happens this far huge progress have been done by de-normalizing the data model just a bit and re-writing the queries with the goal of minimizing the plan cost.
Thanks,
August 07, 2009 - 3:42 pm UTC
... is there any other
gain/reason that you know of, where running four instances in same the box is
best and only for that case?
...
nope, I thought I was unambiguous with this statement:
Also, do you see any scenario where by all means in that case only the having 25 schemas per instance and having 4 instances in the same box will be better.
....
No, you break the cardinal rule of "a HOST should have at most ONE instance"
The problem with two (or more instances) on a single host is - it does not matter how well tuned your instance is if the other one decides to consume 100% of some resource. You cannot tell from your instance that is happening, you cannot fix it, you cannot touch it, you cannot tune it.
You need more (many more) resources to run four instances - memory, cpu, disk bandwidth - you need MORE all of that.
You stand zero chance of tuning, any one of the instances could decide to "run away with the workload" and kill the performance of the other n-1 instances.
Just one thing to consider...
Adarsh Kumar, August 10, 2009 - 3:00 pm UTC
The Only issue with Single database having Millions of Schema supporting Hundreds of Application is
if Database is Crashed or Needs Upgrade or Due to any xyz reason it is down , all application will suffer.
DBA's job becomes a little challenging if Your single very large database supports Multiple Applications and Sometime just couple bad New sql¿s can create a major problem for the entire database and hence all applications suffers.
Otherwise a Single Database is a great thing . you do not have to worry about replicating data across several database and keeping them in Synch.
Adarsh Kumar
Oracle DBA
August 13, 2009 - 8:54 am UTC
If you have 100 databases - the odds that X% of them (and X > 0) are "crashed at any point in time" is 100% in my experience.
If you have 1 database and all eyes are focused on it - the downtime can and will be near... 0.
The more databases you have, the more likely components will be down
And I actually view the fact that if you upgrade, you upgrade them all as a BONUS not a negative, it is a POSITIVE outcome/result, not something to be considered "bad"
Balancing Instances and schemas
Tony Fernandez, August 10, 2009 - 4:07 pm UTC
Tom,
The gentleman above replied with the same description my senior DBA described the reason why we have 5 instances in one box ( Not 4 but 5 ). It is convenience of not affecting more people/applications when something goes wrong in 1 DB.
Is this enough reason to break the cardinal rule of "one instance per box"?
( Off course the ideal would be 5 boxes, but that means ask the company to break the bank. )
August 13, 2009 - 8:59 am UTC
... Is this enough reason to break the cardinal rule of "one instance per box"? ...
you should already know my answer to that. I have not be ambiguous at all here.
... Off course the ideal would be 5 boxes, but that means ask the company to
break the bank. ...
there are other ways to get five hosts on a single physical machine. We've (people in IT) have been doing it since - well, a really long time - longer than I've been in the business.
VM it?
A reader, August 10, 2009 - 7:56 pm UTC
what about running each instance in a VM?
Although, i believe, the only VM officially supported by Oracle is the one that Oracle sells, it still is an option.
You'd have to do your own ROI.
The other question is "what will happen if something on the one machine FUBARs and takes down the whole system?"
If you are worried about bad SQL, look into RMAN, flashback query, and other DR type technologies.....you DO have development on a different box, right?!?
Double check your security policies on each 'user'. Make sure they don't have things like DBA role or DROP ANY TABLE.
A reader, August 11, 2009 - 2:35 pm UTC
I think you are confusing it unnecessarily. Tom is not saying you should run all your applications in one database or that you should run only one application per database - it is totally upto you (btw, from your question it sounded like you are equating applications with schemas - not quiet right, one application can have many schemas and many applications can share one schema depending on how you design it). It is a logical division based on your applications design and ofcourse you can squeeze things in or spead out liberally or have something in between depending on what you can afford. But you should alway "run only one database at the most per box" - simple.
If you do a simple search you can find we have had these discussions many times over in the forum. I hate to see Tom's time being wasted for silly stuff like this over and over...
tables
kamau, August 12, 2009 - 2:36 am UTC
how do i know the number of tables,constraints and triggers in my schema?
August 13, 2009 - 11:39 am UTC
1 select object_type, count(*) from user_objects where object_type in ('TRIGGER', 'TABLE' )
2 group by object_type
3 union all
4* select 'CONSTRAINTS', count(*) from user_constraints
ops$tkyte%ORA10GR2> /
OBJECT_TYPE COUNT(*)
------------------- ----------
TRIGGER 1
TABLE 25
CONSTRAINTS 117
Balancing Instances and schemas
Tony Fernandez, August 12, 2009 - 3:14 pm UTC
Dear "A reader",
My question was directed from a high level perspective. We are balancing Schemas against Instances. Nothing more. If you need to elaborate on how many schemas per application or how many applications to a schema, then that is out of the scope of the original question. Derailing from the original question is a waste of time to anyone.
Fortunately as always, Tom took it from the higher perspective and replied accordingly.
Do not de-merit a question if the subject matter in it is not clearly in your understanding.
But what about.......?
Robert, August 13, 2009 - 12:43 pm UTC
Tom,
How about if we have a (10.2) physical standby database on a given server, and we want to put another instance (say a logical standby) on that same server.
I think that might be an exception to the problem of mysterious, unbridled resource consumption, since the resource consumptoin of the physical standby would be pretty stable. It would almost be like just having a single instance on the server.
What do you think?
Thanks,
Robert.
August 13, 2009 - 12:45 pm UTC
that could be one sort of case - but still be nice to segregate as the logical standby database could now overwhelm the machine processing ad-hoc read only queries and make the physical standby database not able to keep up with the flow of redo.
Thanks Tom!
Robert, August 13, 2009 - 3:56 pm UTC
That was the only problem I could think of.
Wow, matching answers with Tom Kyte - my day is made :)
One instance hundreds of schemas
Rob D, June 10, 2011 - 4:09 pm UTC
Hi Tom.
Is there some particular tuning parameters that one should configure to support hundreds of schemas? In particular I have an instance set up for test with about 45 schemas and nightly I tear down all objects in each schema and then refresh all objects per schema (with production export of tables, indexes, views, etc.) If all these run at the same time it seems the I/O will be affected but won't the data dictionary in the instance churn and cause waits if all schemas kick off the re-init at the same time? If I had a few instances I'd think I would have same I/O issue but the data dictionary one would go away. Assuming I have plenty of RAM.
June 10, 2011 - 5:17 pm UTC
You probably spend most of your time hard parsing all of the DDL and SQL - it would be like flushing your shared pool.
Nothing comes into mind as far as tuning for this beyond memory related parameters - your shared pool is going to get hit hard, if you are using old fashioned import, it uses conventional path - so your buffer cache will need to be cleaned by dbwr fast. The dictionary stuff - least of your worries I think (although DDL is a very serial operation - about one person at a time for that stuff typically)
Why not restore a backup and avoid all of the work?
Reply
Rob D, June 10, 2011 - 6:44 pm UTC
The instance which has the 45 schemas are basically empty production tables except for necessary "static dml". Applied to the production schemas are various deltas that go out in deployment. Each schema is used by various build servers (regression, bugfix, current) that run suites of tests. At the end of each test cycle a quick DELETE from (list of tables) is executed (instead of the nightly tear down). I guess there's not much to do other than try to make everything play nicely like don't tear down all 45 at same time, spread them out. But I was hoping for something to tune in this respect. I think the disk I/O would be one of the main bottlenecks but I was just curious about the data dictionary. We do significant partitioning of tables as well global partitioned indexes. Just curious, thank you for your time. -Rob