Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, oralearner.

Asked: April 09, 2002 - 12:47 pm UTC

Last updated: November 23, 2002 - 9:41 am UTC

Version: 8.15

Viewed 1000+ times

You Asked

1--In real world when a database is designed how do dbaS calculate its components' size(datafiles,logfiles,SGA). I want to calculate and design a database as per 100 entries a day. can you give me guidance over architecture & calculations and some web links for guidance.


2--- in your book you say --"My approach is to do everything I can in the database. If my requirements go beyond what the database environment can offer, I do it in Java outside of the database. ---
sir I don't really uderstand these lines you mean while developing a program you try to do every thing in database rather in forms.
I hope my question is clear to you.
thankyou.

and Tom said...

1) 100 entries per day doesn't mean anything to me.

datafiles are a function of the data you have to put in there.
If you have 500 gig of data -- that will drive the size of your datafiles. If you have 50meg -- that will drive the size of your datafile.

Logfiles are a function of the amount of redo you generate per minute. Very little redo generated -- small logs, lots -- bigger.

SGA is a function of the size of the machine, the number of users, the size of the database.


There are no rules of thumb here, experience is the best teacher.


2) Here is what I mean (by example).

I need to schedule a recurring job to move some data from table1 to table2. That is, I need to "archive" some data. I could use the UNIX cron facility and a shell script with perl to do this OR I could use PLSQL + DBMS_JOB *inside* the database to do this. I will choose PLSQL + DBMS_JOB to do this.


I need to have a an email sent out whenever a particular row is updated with a value that exceeds a threshold (eg: when the INVENTORY on hand of something falls below 5 units -- i want an email). I could write a program in some language that periodically polls a table looking for this condition and sends an email when it finds it. I could also write a trigger that used a java stored procedure to send an email straight away. I will use a java stored proceudre + trigger (utl_smtp in 816 and up)


I need to make sure idle connections are disconnected from the database after 20 minutes of inactivity. I could write a monitor program that wakes up every 20 minutes using the OS scheduling facility, looks for idle sessions and terminates them. Or, I could use a resource profile that limits idle time to 20 minutes and assign that to users in the database. I will use the resource profiles.



My point is -- there are perhaps an infinite number of ways to do things. I choose to look for how to implement something within the database, using the database facilities. In that fashion I am 100% portable (sending email from a trigger on NT is the same as Unix). I am certain my jobs only run when the database is up and running (not so with cron or "at"). And so on. I use the database as my operating system -- only looking outside of it when it is not possible (or practical) to do it inside the database.



Rating

  (4 ratings)

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

Comments

architecture

oralearner, April 10, 2002 - 2:26 am UTC

1.I wanted to write 1000 by mistake I wrote 100.
but still I am confused how to start my calculations

2. 5 star answer.

Tom Kyte
April 10, 2002 - 8:47 am UTC

100, 1000, 1000000 -- doesn't matter.

N entries a day -- that doesn't compute.

My answer however stands:

There are no rules of thumb here, experience is the best teacher.


I might start with:

1meg of ram * number of concurrent users
50meg shared pool
50meg buffer cache

and work up from there. It is 100% impossible to say -- the above is sort of a minimal configuration, something to start with.

sizing files - wholly 100% totally impossible, you have to do that based on what you put in there.


architecture

oralearner, April 10, 2002 - 11:54 am UTC

thankyou tom
atleast i get a start clue.
sometimes the first step seems to be difficult.
Is there any manual I can read about this.

Tom Kyte
April 10, 2002 - 12:25 pm UTC

The admin guide for each platform has rudimentary sizing -- but it won't tell you about the SGA sizing -- thats experience, knowledge of how its used (read the concepts guide from cover to cover) and testing.

A reader, November 22, 2002 - 2:51 pm UTC

Regarding #2 of the original question:

I like your approach. Can I have your openion on this?

We have a data warehouse build which loads up the tables with data and then recreate indexes, collect statistics etc. Due to issues with our data feeds, we have to truncate and reload the tables everytime.

We are trying to make things faster by running jobs parallely. We are using parallel Direct loads for Sqlloader. For creating indexes, we have functions which will read the index ddl from ut_fil_dir. We are running all these jobs at o/s level. Will there be any advantage/disadvantage if we schedule the jobs(except sqlldr jobs) inside the d/b? I assume that, may be we can monitor the resource usage in a better way inside the d/b and use parallel processing more effectively. Some DBAs are of the openion that dbms_jobs will be slower compared to o/s level schedulig. I can't believe that. What would be your approach to this. Can there be any benefit at all to move these jobs inside the d/b? Thank you for your time.

Tom Kyte
November 22, 2002 - 4:29 pm UTC

In 9i -- i would do it all in the DB with external tables and parallel automatic tuning.

You get all of the advantages of parallel direct path loads.
Without having to mess with the OS.

In 8i -- since some of it has to be done "outside" -- from a coordination perspective -- it may be easier to do it all outside.

A reader, November 23, 2002 - 9:23 am UTC

Thanks for answering.

I understand about external tables. But it will take some more time for us to get there. What we really wanted to know was if dbms_jobs has any advantage/disadvantage as against o/s scheduling from a performance standpoint. I am aware of the convenience of doing it all from either inside the db or outside. I am looking at the performance gain only. I know that if it is done inside the d/b, I can monitor the resource usage in a better way (without depending on the Unix SAs). But there will be a host of other parameters like job_que_processors/buffers which might affect the performance. I wanted to get your openion specifically on that. Hope I am clear about what I am asking.

Thanks again for your time.

Tom Kyte
November 23, 2002 - 9:41 am UTC

dbms_jobs and using the os will have no performance differences cause at the end of the day -- the create statements are all about SQL and that is where the time will be spent.

dbms_jobs has a limit as to the number of jobs it'll run at a time (so does cron by the way, it'll stop doing things as the load explodes).

dbms_job has a period (interval), it'll only peek for jobs every N seconds.

there are no performance gains EITHER WAY (could not be) or performance hits.




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