How to check which query is consuming most resources....

Hi guys how can i check which query is consuming most resources , run by which user and how to kill that....
Khurana

1)     At the first stage, login to the server and at the OS level I run commands like TOP and see the overall performance of the Server. From this one can know the Total CPU Memory, CPU Usage, Memory Available, and Swap Memory Available and how busy the CPU is.
2)     Once you identify the top processes in the CPU, relate them to ORACLE using V$PROCESS.SPID = OS Process ID to get the V$PROCESS.ADDR and join this with the V$SESSION.PADDR to get the V$SESSION.SID and SERIAL# columns.
3)     Then enable the Session Trace using DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION.
4)     look on the Trace File using the TKPROF. During this sort the Trace File using various options like EXEELA/DSK, PRSELA/DSK, FCHELA /DSK.
5)     Once you identify the expensive SQL statements, inform the user about it and KILL the respective job.

Similar Messages

  • How can check which patch install in oracle 10g

    hi experts,
    i have use oracle 10g , i hv patch information but how can check which patch install ?

    Run following command , it will give you list of patches installed on Oracle Home
    cd ORACLE_HOME/OPatch
    opatch lsinventory
    For patchset and CPU patch , check/query DBA_REGISTRY_HISTORY
    Virag

  • How to check which version of hyperic is installed , hyperic 32 bit or 64 bit version on solaris

    how to check which version of hyperic is installed , hyperic 32 bit or 64 bit version on solaris

    If you have only a single home, the quickest/easiest way is probably just to check the properties of %ORACLE_HOME%\odp.net\bin\2.x\oracle.dataacess.dll
    Or are you asking how to check it at runtime?
    If you want to see externally what is actually loaded by an app you can use process explorer
    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    If you want to check it in the app itself:
    http://stackoverflow.com/questions/383686/how-do-you-loop-through-currently-loaded-assemblies
    Hope it helps,
    Greg

  • How to find which query taking more cpu

    Hi,
    How to find which query taking more CPU
    at a particular point of time .
    Chhers,

    Take a look at Server Standard Reports. It has a few CPU usage oriented reports.
    You can also track CPU usage by server-side tracing:
    http://www.sqlusa.com/bestpractices/createtrace/
    Glenn Berry's CPU usage query:
    SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime],
    qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count,
    ISNULL(qs.execution_count/DATEDIFF(Second, qs.cached_time, GETDATE()), 0) AS [Calls/Second],
    qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count
    AS [avg_elapsed_time], qs.cached_time
    FROM sys.procedures AS p WITH (NOLOCK)
    INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
    ON p.[object_id] = qs.[object_id]
    WHERE qs.database_id = DB_ID()
    ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE);
    LINK:
    http://dba.stackexchange.com/questions/52216/sql-server-2008-high-cpu-historical-queries
    Query optimization:
    http://www.sqlusa.com/articles/query-optimization/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to check which version of Jdk installed on the machine?

    How to check which version of Jdk installed on the machine?
    & Which version of Oracle Insatlled on my machine?

    String version = System.getProperty("java.version"); %

  • How to check the query, which had run how many times in a year?

    <Moderator Message: ok, subject is better now but you didn't search at all. Therefore thread is locked again>
    Hi All,
    I want to check the Query statistics like it had run how many times in a year?
    Regards,
    Kiran
    Edited by: Siegfried Szameitat on Dec 9, 2008 11:55 AM

    Hi Kiran,
    please follow the below steps
    1. Create a query for that purpose
    2. Make use of BW Statistic InfoProvider 0BWTC_C02
    3. in Col: Key Figure:0TCTNAVCTR
    4. in Row: 0TCTQUERY (select a variable 0TCTQUYS)
    5. in Filter: BW System( 0TCTSYSID) [give yr source system name whether its production/quality)
    6. in Free char you can give calmonth/year  or user if want to do so.
    save and execute the query
    you will be asked for input the query name
    As output you will be getting count (as many times query is hit by all users since the time it was created)
    if you give date and user name then it will display the count accordingly.
    Hope it Clarifies you.
    Thanks & Regards
    Nagaraju.V

  • How to check which function was used in a function based index.

    Hi how can i check which function was used in a function based index created on a column.
    Thanks

    Hi,
    What is your requirement... !!
    Bascially performing a function on an indexed column in the where clause of a query guaranteed an index would not be used. From Oracle 8i onwards introduced Function Based Indexes to counter this problem.
    Any how check this..you will get an idea..
    http://www.akadia.com/services/ora_function_based_index_2.htm
    http://www.oracle-base.com/articles/8i/FunctionBasedIndexes.php
    -Pavan Kumar N

  • How to check which user has the privilege to execute a stored procedure?

    I am using Oracle 7 and I would like to check which user has the privilege to execute a stored procedure. How can I check it? Is there any view I can query for?
    Alex Hung

    Please check DBA_SYS_PRIVS.
    SQL> select * from dba_sys_privs
    2 where grantee='HARY';
    GRANTEE PRIVILEGE ADM
    HARY EXECUTE ANY PROCEDURE NO
    ....

  • How to check which PSA is having more data

    Hi,
    I want to delete the PSA, and check which PSA is having huge space is occupied, from table RSTSODS we can check the availble psa`s how can we check PSA database.
    we have to configure in db02 ?
    Regards,
    Vamsi

    For checking the which PSA having more data then run ST14 tcode for getting top 30 objects which has PSA also
    in that case you have set a procedure to overcome that...by inlcuding those things in Process chain so that deletion will happen if the data gets older by certain days...if not you can go with any program where you can use FM's given SAP .. so that your system wont go into oversize...

  • How to check  which column data differs from master table and archive table

    Hi All,
    i have two tables, table a (a1 number,a2 varchar2,a3 varchar2) and table b (b1 number,b2 varchar2,b3 varchar2).
    how to check the data in both the table are same( including all columns).
    data in a.a1 is same as b.b1 and a.a2 is same as b.b2 like that.
    if they not same , i need to know which field differs.
    Kindly Share ur ideas.

    887268 wrote:
    thanks Sven W. ,
    above reply clearly shows what my question is.
    one column must be primary key, based on that key i need to find out which are the fields having different data..
    im strugling with this, i tried the following already, but not able to get.
    select the columns from a MINUS select the columns from b.
    -- from this i can find whether the difference occurred or not.
    but i cant able to get which are the fields value changed.Good. Then you would match the rows using the PK column and need to compare the columns
    Instead of a MINUS + UNION ALL + MINUS we can now use a FULL OUTER JOIN
    It is a little task to write out all column names, but 40 columns can be handled.
    This statement would show you both tables with matching rows on the same line.
    select a.*, b.*
    from a
    FULL OUTER JOIN b on a.id = b.idNow filter/check for mismatches
    select case when a.col1 != b.col1 then 'COL1 value changed'
                    when a.col2 != b.col2 then 'COL2 value changed'
                    when a.col3 != b.col3 then 'COL3 value changed'
             end as compare_result
            ,a.*, b.*
    from a
    FULL OUTER JOIN b on a.id = b.id
    /* return only non matching columns */
    where (a.col1,a.col2,a.col3) != (b.col1,b.col2,b.col3) You might need to add nvls to take care of null values. Test this!
    Another way could be to group upon the primary key
    select *
    from (
      select id 
               ,count(distinct col1)-1 cnt_col1
               ,count(distinct col2)-1 cnt_col2
               ,count(distinct col3)-1 cnt_col3
       from
         select 'A' source, a.*
         from a
         UNION ALL
         select 'B' source, b.*
         from b)
       group by ID
    /* only records with differences */
    where 1 in (cnt_col1, cnt_col2, cnt_col3)
    ;The count columns will hold either 1 or 0. If it is 1 then this column has a difference.

  • How to check which administrator had modified the AD Group properties

    Dear Sir,
    Some one had modified a Distribution group (removed email address). I checked it in group properties and last modified was on 22/09/14. How to find which administrator had modified.
    I dont have access to domain controller. Is there any way to find it?
    thanks in advance.
    Karan

    Hello,
    this will be logged on DCs and also auditing must be configured correct that this will show up in the event viewer from a DC.
    Without access to the DC contact your administrators and let them find out.
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • How to check which is th best method to use in LSMw and the file

    Hi all,
    I am new to LSMW,
    Can know me when i get the file , how to check the which is the Best method ( Batch input, Direct input,BAPI, IDOC)  have to use in LSMW .
    How to check the input file is completely filled and how to check whether it is correct and also how to Prevalidation check has to be done fior the file before uploading.
    Can you provide any documents LSMW also Apprecited.
    Regards,
    Madhavi

    Hi Madhavi,
    To check Correctness & completeness of the file:
    1. The input file structure should be same as source structure what you defined whicle creating LSMW.
    2. Check the following steps to assure the field mapping is done correctly.
    a) Maintain field mapping & conversion rule
    b) Check 'Display Read data'
    c) Check ' Display Converted data''
    Please note LSMW is a tool, which will simply upload the data whatever you are providing. So you need to be careful while making your file and validate it outside SAP ( before upload start)
    Pradeep D

  • How to check which table is used

    After creating RFQ , i want to check which table is used  in creating RFQ.
    how can i see that data has gone or not into the database table.

    Hi
    See the Table EKKO and EKPO only
    with EKKO-BSTYP = A
    Regards
    Anji

  • Basic Question - How to check which version of XMLP I have ?

    I have seen several posts mentioning few features work from XMLP 5.5
    Where would i check which version we have ?

    Hi,
    Run the following query to find the version installed.
    SELECT DECODE(bug_number
    ,'3120489', '3.5.0 Installed'
    ,'3395631', '4.3.0 Installed'
    ,'3554612', '4.5.0 Installed'
    ,'3822219', '5.0.0 Installed'
    ,'4236958', '5.0.1 Installed'
    ,'4206181', '5.5.0 Installed'
    ,'4561451', '5.6.0 Installed'
    ,'4905678', '5.6.1 Installed'
    ,'5097966', '5.6.2 Installed'
    ,'5472959', '5.6.3 Installed'
    FROM ad_bugs
    WHERE bug_number IN
    '3120489'
    ,'3395631'
    ,'3554612'
    ,'3822219'
    ,'4236958'
    ,'4206181'
    ,'4561451'
    ,'4905678'
    ,'5097966'
    ,'5472959');

  • How to find which query need to tuned

    Hi ,
    How can i find , which query need to tuned . Is there any mechanism behind it?

    The mechanisms behind it are depending on your database version.
    For example:
    Oracle 9i has STATSPACK that helps you to identify possible problem queries.
    Oracle 10g has AWR - Automatic Workload Repository
    Oracle 11g has SPA - Database Replay SQL Performance Analyzer
    but there are many more tools/mechanisms...trace/tkprof for example.
    Go to http://tahiti.oracle.com and do a search on 'performance tuning guide', and pick the one that matches your (sofar unknown) database version, read a bit every now and then and see what tools are at your disposal and fit your requirement and situation.
    Besides the links that Blu already posted, searches on http://asktom.oracle.com also give lots of pointers and explanations regarding the (neverending) tuning process (at least: helped me tremendously in understanding the tuning process, the do's and dont's).
    Make sure you don't get CTD (Compulsive Tuning Disorder) from all this... ;)

Maybe you are looking for

  • Important Steps to create a report using BI Publisher

    I have been working in OAF and have also made a few applications. I have to create a few reports in applications I have made using OAF. Can I use BI Publisher to generate reports in the applications I have made? I am new to BI Publisher. Can someone

  • How to use variables in Hidden Fields

    Hi, I have the following piece of code: <input type="hidden" name="item_number"> But how can i add a value thats equal to a variable, something like: <input type="hidden" name="item_number" value = $var1> Where var1 is set previously. Thanks.

  • Icons in normal alv

    Hai can any one give me example of normal interactive alv .. report. I hav one alv rep having 5 secondary lists. 1) i need to print this report via diff. options unconverted, richtext format, spreadsheet, html format 2)i wnt icons such as firstpage,

  • The wackiest thing ever on FCE

    Ok, this beats all. somehow, i lost my timeline and canvas, they were greyed out in the selection to modify the windows, so i found the answer on this forum, i think (double click on sequence) but i must have spaced out or something because right bef

  • Apple creates Drivers but WINDOWS won't recognize them and doesn't let me install W7

    Hi dear Mac users, Boot Camp Assistant creates my drivers for me and I can place them either in a CD or a USB Disk. I start W7 installation and it ask me for MAC drivers, even thought I browse drivers location W7 won't recognize them. So i checked, m