Finding Current High-Consuming CPU SQLs
Hi All,
How do we find SQL's consuming most CPU at the current moment. If I find SQL's from V$SQLAREA and sort descending based on CPU_TIME, it may be idle sessions as CPU_TIME gives the cumulative cpu time. Current high-consuming SQL may not even figure on top if cumulative cpu time is less. I am interested in finding top 10 SQL's at the current moment. Is there a way we find the top consumers of CPU?
Thanks,
...
you can use top,nmon or topass command at OS level to find out PID consuming maximum CPU and resources .. you can use this PID and qury against
v$sesson , V$process and v$SQL to find out user session and SQL been consuming max CPU time and resources.
select a.username , a.program , to_char(a.LOGON_TIME,'dd-mon-yy:hh24:mi'),c.sql_text from v$session a ,
v$process b , v$sql c where
a.paddr=b.addr and a.sql_id=c.sql_id and b.spid='you OS PID' ;
Similar Messages
-
Find Current Form name from SQL or Unix Prompt.
I have five oracle forms
FORMS1.FMB
FORMS2.FMB
FORMS3.FMB
FORMS4.FMB
FORMS5.FMB
I am using call_form function calling from FROMS1 to FORMS2, FORMS2 TO FORMS3, and FORMS3 to FORMS4 and FORMS4 to FORMS5.
There are 3 users using this application. The userâs current forms may be FORMS3 or FORMS4 or FORMS5.
From OS (Operating system) or ORACLE SQL Prompt, I want find which user using which form.
Pls help me to find the solution.
Thanks, Raghu.KRaghu,
if you need this information, trace it in a database table and get it from there.
Frank -
Java threads consume CPU in sleep state (??)
Hi,
I'm using the PRSTAT command on Solaris for the first time.
I am investigating high CPU usage problem in my application. So to monitor the CPU usage I used the prstat and mpstat command. My machine is a 2-CPU box.
The prstat -L -p <pid> command output is as follows:
PID UNAME ... .... STATE CPU PROCESS / LWPID
2962 bea run 7.6% java / 5
2962 bea run 5.6% java / 38
2962 bea run 5.6% java / 22
2962 bea sleep 5.5% java / 21
2962 bea sleep 5.4% java / 36
2962 bea cpu2 5.2% java / 23
2962 bea sleep 5.1% java / 29
2962 bea run 5.1% java / 37
2962 bea sleep 4.9% java / 34
2962 bea run 4.9% java / 15
2962 bea run 1.1% java / 12
2962 bea sleep 1.0% java / 33
2962 bea run 0.6% java / 14
2962 bea run 0.0% java / 17
..... This shows that of all the threads in my app only one thread(23) is currently on the CPU and is using 5.2% of CPU. But why are the threads in sleep and runnable state consuming CPU?
Also the mpstat output shows high CPU usage:
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 8 0 366 428 61 994 387 40 70 0 10941 95 4 0 1
2 3 0 370 1003 563 1362 648 42 61 0 5374 92 2 0 6If my application is taking only ~57% according to sum of values from prstat, why is my mpstat showing 95% and 92% usage on EACH of my CPUs...??
I'm unable to interpret the result.
Any help would be really useful to me at this moment.
.Hi,
Your question should be posted in a unix forum instead of a java forum. The question, and the answer is not related to java.
The reason that prstat shows processes in sleaping state is that it doesn't create a snaphost at one point in time. It does instead show an average over some time (don't know the period), so the process has been running and consumed cpu, or is generally running, but currently sleeping.
Kaj -
Find current age from day in mdx query
Hi,
I need to find current age.In my cube i have dob attribute.
so how can i find current age from day using mdx query.
Thanks,
Indu
induHi,
when i ran above query, i am getting days.
But i need current age in years.
so i tried with below query, then i am getting value like 8.99.how can i round off in mdx query?
in sql i used Floor function for roundoff. in mdx which function should i use?
With
MEMBER [DOB] AS DATEDIFF('d',[Ship Date].[Date].CurrentMember.Name,Now())/365.25
Select {[DOB]}
on columns ,
NON
EMPTY {[Ship Date].[Date].[Date]}
ON ROWS From [Adventure Works]
indu -
How to troubleshooting high sys cpu usage ???
how to troubleshooting high sys cpu usage ???
Hi,I have post the top 5 event above.
before tuning:
SQL ordered by Gets
• Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code.
• Total Buffer Gets: 4,348,081
• Captured SQL account for 73.3% of Total
Buffer Gets Executions Gets per Exec %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
1,768,970 2,593 682.21 40.68 32.47 1375.28 a2vm9mf99ma3p
select
712,504 2,883 247.14 16.39 13.14 83.85 66vrg3gz2stvf
select
130,928 7,901 16.57 3.01 7.83 10.49 ctnn0bpfd3v5k
select
92,800 2,902 31.98 2.13 2.73 6.40 2985xzq8x547u
select
81,498 27,159 3.00 1.87 3.12 3.98 1prkhshjp25sc
select
60,513 2,631 23.00 1.39 2.29 5.64 2d8w9016z0kug
select
55,416 15,835 3.50 1.27 2.12 2.39 8tk22zsappg9m
select
44,879 15,838 2.83 1.03 1.74 1.89 c6sjzyfh9jmz0
select
31,677 10,558 3.00 0.73 1.15 1.24 5yr7z98xmcpqz
select
26,346 13,172 2.00 0.61 1.31 1.47 36shs0f8kxp5z
select after tuning:
SQL ordered by Gets
• Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code.
• Total Buffer Gets: 7,734,429
• Captured SQL account for 99.4% of Total
Buffer Gets Executions Gets per Exec %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
1,728,723 99,759 17.33 22.35 113.87 119.45 309a6ak09rud2
select
996,920 332,437 3.00 12.89 41.57 44.03 1prkhshjp25sc
select
964,093 199,469 4.83 12.46 32.19 33.28 8tk22zsappg9m
select
531,776 33,241 16.00 6.88 34.38 36.36 2985xzq8x547u
select
432,140 199,473 2.17 5.59 20.86 21.57 c6sjzyfh9jmz0
select
332,406 166,226 2.00 4.30 17.28 17.84 36shs0f8kxp5z
select
265,872 33,234 8.00 3.44 7.74 8.09 4a34fa9tt90wx
select *
232,617 33,243 7.00 3.01 7.54 7.78 53rvrd0ug5gwm
select
232,603 33,237 7.00 3.01 9.24 9.83 9254c5ag3z9qd
select
232,589 33,239 7.00 3.01 8.11 8.40 gum17w9qgrw8p
select co
232,547 33,246 6.99 3.01 12.56 13.21 cx8yttzjh9ftz
select
232,484 33,244 6.99 3.01 10.08 11.07 gbx7hs3ykpjqs
select
199,446 99,753 2.00 2.58 11.27 11.89 2hpja5k312kwa
select
199,428 33,241 6.00 2.58 9.15 9.56 2d8w9016z0kug
select
199,389 199,469 1.00 2.58 19.59 20.25 b9j0pb2d5cn69
select
133,004 33,253 4.00 1.72 17.56 18.67 a2vm9mf99ma3p
select
99,756 33,255 3.00 1.29 3.77 3.92 5yr7z98xmcpqz
select
99,747 33,258 3.00 1.29 4.58 4.70 1fnshqnqxjtqz
select -
I ran a statspack report for the full day and noticed extremely high recursive CPU as being a large portion of the overall response time. Any ideas on how to minimize this? Or, how to investigate culprits?
Using 9.2.0.3 on solaris.Find the queries that are using CPU intensively and try to optimize them..
There might be poor joins or excessive sorting. -
I would like to upgrade my OS from 10.6.8. I can't find any higher version on the site. Yosemite is the latest but not available. Can someone help please?
If Yosemite is not available to you, your system may not meet the minimum requirements.
How to install OS X Yosemite on your Mac - Apple Support -
Query or Profile Option to find Current logged in user in oracle apps R12
Query or Profile Option to find Current logged in user in oracle apps R12.
I want to get value of current user who is logged in to that particular session, based on the value of user_id or user_name returned i have to do a Forms Personalization.
Plz help.
Regards,
Sadiya P.Hi Sadiya,
do you have the answer for this? please send it to me because i am also have same requirement. so plz post it here.... -
Match edges error message - can't find current layer
Hello everybody,
If I use filter --> "match edges" an error message appears: can't find current layer.
It is no different if it is a smartobject or a rasterized layer.
Are there any suggestions to fix this problem?
What layer-order is exactly to be used?
Is there anything I could try? Btw: the filter "interpolate" seems to work right.
Thank you!Hi, Dave & Dave -
Wow, that took longer than I thought. I have been back for a couple of hours, and spent that time running the uninstall program, and then going to users/library/VirtualBox and deleting that folder, and its contents. Next I downloaded a fresh copy of VirtualBox from the Sun website, installed it on my computer, then ran the VirtualBox set up (setup the settings) and then clicked on the start icon. After the splash screen, I once again got the same error message. I repeated that routine at least three time, all three times I received the same message.
I then got the bright idea to go into my time machine and went back to several days after I had installed the program previously (March 25, 2009) and retrieved both the program from the application folder, and the vb folder from the user library, restoring them to my present computer state. After all, I thought, if it worked on March 25th, those files should work now. DRAT, I was wrong, Got the same message at the same place in the startup routine.
So, Dave and Dave, after a little more futzing around, I'm now back to the same place I was when I first posted about my problem: My win xp disk will still not mount. ****!!!
Phil -
To find last updated date in sql developer for a procedure or a function
hi
how to to find last updated date in sql developer for a procedure or a function.
i m using sql developer version in 1.2I think you are in the wrong forum...
Anyway you can try
select * from
all_objects o
where o.object_type in ('FUNCTION','PROCEDURE');
you have there the created date, last DDL and timestamp -
How to find current user name on a LAN machine....
how to find current user name in a remote machine in LAN .
how to find current user name on a local machine in LAN .how to find current user name in a remote machine in
LAN .Many users may be logged on concurrently on the remote machine.
how to find current user name on a local machine in
LAN .The user who is running the code in the process would be obtainable via:
System.getProperty("some property goes here");
I leave it to you to look at the API documentation for System.getProperties() to see what property name you would retrieve. -
Hi,
I'm using ArchLinux 64bit, with KDE 4.3.4 on a sony vaio, everything work fine, but after some normal work I see that process X takes more then 90% of CPU and never slow down. Even if I closed all my application it stays at 90%. I don't know how to see which application could cause this.
As first impression it seems when I use samba adn move some file from my machine to a windows machine, but today it takes high load cpu without using samba, so I don't know what else do, any good advice?
thanks a lot
cesareHi thank you very much for your reply, I'm sorry to reply just now.
Anyway I have a Sony Vaio VGN.SR21M, using opensource driver xf86-video-radeonhd with hardware acc on. My graphics card is a Radeon3400HD
I used the closed driver till I switch to Xorg 1.7 and so I can't using it anymore so I switched to the free one.
Should I disable desktop effects?
Thanks again
Cesare
Last edited by cesare (2010-01-25 08:48:01) -
How to find current database name i am using
what is the command to find current database name i am using
Dear user!
SELECT name
FROM v$database;Yours sincerely
Florian W. -
I called a contact and their current location showed up. I've never noticed or seen that before. Is that feature only available during calls or can I find current locations of any of my contacts?
Your friend may have this turned on -
Settings - Privacy - Location Services - scroll all the way down - System services - Share my location - toggle on -
How to find Installation Date for each SQL installation
Dear All,
I need a basic info. How to find installation date of each SQL instance (My environment running with multiple standalone/cluster instances)?
So, I need a query to find installation date easily (I don't want to check it in registry by manual). Thanks in advance...Hi Balmukund
This is the same answer that (1) Prashanth posted
from the start, letter on (2) Stan posted
this again with the same link, and now for the third time, (3) you posted it with the same link :-)
* This answer is correct for specific instance.
The OP asked a solution for several instances. Therefore he should execute this on each instance. As I mentioned he can do it dynamically on all instances, for example using powershell (basic logic is, first find all instances and than post this query in a
loop).
Ronen Ariely
[Personal Site] [Blog] [Facebook]
Then your answer is correct :)
Balmukund Lakhani
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
| Facebook
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle
Maybe you are looking for
-
I would like to get the 3.6 version and uninstall the 4.0 version computer running slow
-
Can't get LELA w/ WRT160N to work
I can't get LELA to work. I was working fine from July to early September. Since then I have not been able to get it to work. Everything with the router works fine. In LELA, pretty much everything I try to click on comes up with an error message. "E
-
Hi all, i m trying to populate a report column with overall result of some other column say A. Now A is calculated by a formula(current date-net due date divided by balance).But in report it gives only X. Any idea why this is happening?? re
-
Content level settings in fact LTS
Hi all, i just want to get very clear picture upon content level settings of LTS, when we create a dimensional hierarchy say time hierarchy (Year, Quarter, Month, Day), when we want a measure to sum up to month level we go to that particular measure
-
Hi experts, I have to generate an IDOC for every material using basic type MATMAS05 along with few custom segments, and I have been asked to used standard program, RDBSEMAT report. I have created an extension for basic type MATMAS05 as ZMATERIAL