Skip to Main Content
  • Questions
  • CPU time consumed by SELECT,UPDATE,DELETE,INSERT statements

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Mazhar.

Asked: June 27, 2001 - 11:52 am UTC

Last updated: September 24, 2004 - 8:47 am UTC

Version: 8.1.6.3

Viewed 1000+ times

You Asked

I want to know the SQL or PL/SQL script which displays
the CPU time taken by all the SELECT,UPDATE,DELETE,INSERT statements which run against the Database.

and Tom said...

We do not track that information.

See V$SQL for the data we do track but bear in mind that that list is NOT a list of all SQL / PLSQL executed -- it can be flushed out of them if memory is short.


See V$SYSSTAT for system level stats like this:


ops$tkyte@ORA8I.WORLD> select * from v$sysstat where lower(name) like '%cpu%'
2 /

STATISTIC# NAME CLASS VALUE
---------- ------------------------------ ---------- ----------
8 recursive cpu usage 1 86477773
11 CPU used when call started 128 168336166
12 CPU used by this session 1 4.6141E+11
169 parse time cpu 64 3992541
203 OS User level CPU time 16 0
204 OS System call CPU time 16 0
205 OS Other system trap CPU time 16 0
211 OS Wait-cpu (latency) time 16 0

8 rows selected.



Rating

  (3 ratings)

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

Comments

Estimating CPU in real world

Nihal, January 17, 2003 - 12:11 am UTC

Hi Tom,
In the real world we need to estimate the CPU requirments, before building the application we atleast need to give them the approximate speed of the CPU like a recomended speed. Is there a way of estimating that say using 9.1 database on NT 4, estimated size of the database will be 12 GBS 1000 Transactions a day updating 10 tables should cater for 25 concurrent user in peak time, with 100 reports executed in a day on the system
Has a batch process in the night.

How does one give a comfortable estimate in RAM and CPU for the size.

In other words what are the criteria do we consider and if and if we have those criteria, how does one clculate the app size, These are very day to day problem ppl face in giving proposals presenting cases to the management who actually approves/disaproves the cost.

Management normally doesnt want to go to a stage where they want to analyze and design the system and then think about the hardware and other cost. ?

Can you throw some light at estimate CPU/RAM size in planning stage.

Thank



Tom Kyte
January 17, 2003 - 9:06 am UTC

One benchmarks -- in my experience, you can hypothesize, theorize, summarize all you want -- and you'll always be wrong.

Simulate via a benchmark, and you'll get it.

Estimated size of the db has nothing to do with RAM/CPU. I've seen a 5gig database need tons more then a 500gig database.

1,000 transactions a day? a palm pilot can do that -- that isn't very much.

If I had to swag it -- 25 users, low transactions, sounds like a low end dual cpu machine with 2gig of ram. it would run better on linux ;)


CPU

Nihal, January 17, 2003 - 9:36 pm UTC

Hi Tom,
Thanks,
My problem is i hv to give the management,if they would need a upgrade in their system if they made the current DB also as a DW, the DW as such is only 10 gigs of data, They currently have a single CPU P3 1266 Mhtz with 2 gigs of ram
The OLtp system does not show any contention in the stats pack,the users are also okay with the speed, if you had to suggest a dual CPU, what would the be the ideal cpu you would you suggest, just from ur expeerience, based on this limited input i have.


Thanks

Nihal

Tom Kyte
January 18, 2003 - 8:55 am UTC

it is very small, practically any server on the market today would suffice.

Reader

A reader, September 23, 2004 - 11:28 am UTC

There is somewhere in the site another good discussion of
CPU 100% Utilization.

Is there a concern about life of the CPU or overheating
issues if you use the CPU 100% over a period of time
(say batch jobs)

Tom Kyte
September 24, 2004 - 8:47 am UTC

ask your hardware vendor "so, if I fully utilize your equipment for some period of time, but I have followed your specifications for keeping the room at 72F and humidity at X% -- will your machines blow up?"

I would certainly hope the vendor would say "no", if not, might be time to peek around for another one.