Stat 'DB CPU"AWR % DB time

11.2.0.4

Looking for a piece of sql code that will give me the time spent waiting on CPU DB we see in an AWR report.

Top 10 Foreground Events by Total Wait Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                            Tota    Wait   % DB
Event                                 Waits Time Avg(ms)   time Wait Class
------------------------------ ------------ ---- ------- ------ ----------
DB CPU                                      1186           77.9
db file sequential read              30,531 94.9       3    6.2 User I/O
SQL*Net message from dblink       1,181,186   71       0    4.7 Network
gc cr block 2-way                   192,773 38.1       0    2.5 Cluster
direct path read                     29,131 33.3       1    2.2 User I/O
log file sync                        33,672 29.4       1    1.9 Commit
gc cr multi block request            25,831 19.5       1    1.3 Cluster
SQL*Net more data to client       1,061,764   16       0    1.0 Network
db file parallel read                 1,355  7.6       6     .5 User I/O
gc current block 2-way               40,081  6.6       0     .4 Cluster

dba_hist_sys_time_model stores the "DB CPU" stat and record the value of that component in microseconds, snap.

Select * from dba_hist_sys_time_model

where stat_name = "DB CPU"

snap_id desc order

How that data is translated at the time of Db % above?

all sorted.

SELECT
     e.stat_name "E.STAT_NAME"
     , Round((e.value - b.value)/1000000,2)"Time (s)"
     , Round(decode( e.stat_name,'DB time'
             , to_number(null)
             , 100*(e.value - b.value)
             )/
  (SELECT NVL((e1.value - b1.value),-1)
     FROM dba_hist_sys_time_model  e1
        , dba_hist_sys_time_model  b1
     WHERE b1.snap_id              = b.snap_id
     AND e1.snap_id                = e.snap_id
     AND b1.dbid                   = b.dbid
     AND e1.dbid                   = e.dbid
     AND b1.instance_number        = b.instance_number
     AND e1.instance_number        = e.instance_number
     AND e1.stat_name             = 'DB time'
     AND b1.stat_id                = e1.stat_id ),2) "Percent of Total DB Time"
  FROM dba_hist_sys_time_model e
     , dba_hist_sys_time_model b
 WHERE b.snap_id                = 40889
   AND e.snap_id                = 40890
   AND b.instance_number        = 1
   AND e.instance_number        = 1
   AND b.stat_id                = e.stat_id
   AND e.value - b.value > 0
   and e.stat_name = 'DB CPU'
 ORDER BY 2 DESC

74.5% what gives

DB CPU 16244.26 74,53

Tags: Database

Similar Questions

  • Spooler subsystem app making more than 50% CPU all the time?

    Spooler subsystem app making more than 50% CPU all the time?

    -------------------

  • don't forget the select result of a statement to be used several times in the procedure

    Hi all

    I'm sorry for this kind of question, I'm not newbie, but still need your help.

    My need is remember the select result of a statement to be used several times in the procedure.

    My first guess is to use a temporary table, but I think there's better decisions.

    For example, I should make a heavy request

    Select the code from table_function (param1)

    Then, this query is used to insert a list of the id in table1, delete table2 and update in table 3.

    Help me please do not use if possible temporary tables.

    If there is more than one column, you need to create an object type at the database level. Create a collection of this type of object in the procedure.

    Example:

    CREATE OR REPLACE TYPE "OBJ1" as OBJECT(
            column1 varchar2(256 CHAR),
            column2 varchar2(35 CHAR)
            );
    
    CREATE OR REPLACE TYPE "nt_obj1" as table of OBJ1; -- this could be done at procedure level as well
    
    DECLARE
       t_employee_ids   nt_obj1;
    BEGIN
       SELECT OBJ1(column1,column2)
         BULK COLLECT INTO  t_employee_ids
         FROM table1
        WHERE column3 = NNN
    .............
    .....
    
  • AWR: Time CPU = 0, % of time Total DB > 0

    Hello!

    I use * 10.2.0.5 *, AWR I see next statistical operation in one of my report:
    SQL ordered by Elapsed Time
    CPU Time   ... % Total DB Time
     0                            12.21
    Please explain, how is it possible
    DB-time does not time CPU here?

    Thank you and best regards,
    Pavel

    Published by: Pavel on April 18, 2012 04:17

    Hello

    for explanation of time CPU and DB, please visit http://savvinov.com/2012/04/06/awr-reports-interpreting-cpu-usage/.

    In your case, I think that the numbers is not reliable due to errors of instrumentation (for example, I saw 0 time processor in an extremely overloaded system).

    Best regards
    Nikolai

  • GetStat-entity (Cluster) - CPU in real-time - values to zero of the recent time intervals

    Hello world:

    I have a strange behavior when querying via PowerCLI CPU statistics.  We have a handful of clusters in a data center, some with HA + DRS and some DRS only.  PowerCLI seems to report different time intervals (5 min. 20 s vs) according to which cluster is queried and for the most recent 15 minutes of data queries is always zero, although sometimes it's only been 5 minutes which are zero.  This behavior is indicated for applications on clusters and resource pools.

    Is this known behaviour?  vSphere Client shows that the data is present when searching in graphics in real time, so it's confusing why smaller or no value is present at all from the CLI.  Ideally, I would like to know the average use of MHz and percentage for all groups to 20 s averaged granularity on the last 2 minutes, but no amount of massage does seem to happen.

    example query:

    Get-Stat - Realtime-Stat "cpu.usagemhz.average" - entity (Get-ResourcePool-name 'Low') - departure (Get-Date). AddMinutes(-20)-Instance "

    As I understand it, the measures for groups and entities related to the cluster as resourcepools, are aggregated values of definition.

    Which means that the vCenter must calculate these metrics of the values collected by the ESXi hosts.

    In other words there is no interval in real time for the metric for clusters, only of the historical intervals.

  • Create table as select statement (ETG) takes a long time.

    Hi all

    One of my procedure launched a table create as select statement each month.
    Usually it ends in 20 minutes. for 6172063 records and 1 hour in 13699067.
    But this time it never even takes to 38076 records.
    When I checked everything he does is the CPU usage. No e/s.
    I did a count (*) using the query, it has brought very good results.
    BUT guard going on DEC.
    I use Oracle 10.2.0.4.
    temp_ip of the main table has 38076
    table nhs_opcs_hier has 26769 records.
    and table nhs_icd10_hier 49551 records.
    -------------------
    Query is:
    create the table analytic_hes.temp_ip_hier as
    Select b.*, (select nvl (max (hierarchy), 0))
    of ref_hd.nhs_opcs_hier one
    where fiscal_year = b.hd_spell_fiscal_year
    and a.code in
    (primary_PROCEDURE, secondary_procedure_1, secondary_procedure_2,
    secondary_procedure_3, secondary_procedure_4, secondary_procedure_5,
    secondary_procedure_6, secondary_procedure_7, secondary_procedure_8,
    secondary_procedure_9, secondary_procedure_10,
    secondary_procedure_11, secondary_procedure_12)) as hd_procedure_hierarchy,
    (select nvl (max (hierarchy), 0) for ref_hd.nhs_icd10_hier one)
    where fiscal_year = b.hd_spell_fiscal_year
    and a.code in
    (primary_diagnosis, secondary_diagnosis_1,
    secondary_diagnosis_2, secondary_diagnosis_3,
    secondary_diagnosis_4, secondary_diagnosis_5,
    secondary_diagnosis_6, secondary_diagnosis_7,
    secondary_diagnosis_8, secondary_diagnosis_9,
    secondary_diagnosis_10, secondary_diagnosis_11,
    secondary_diagnosis_12, secondary_diagnosis_13,
    secondary_diagnosis_14)) as hd_diagnosis_hierarchy
    of analytic_hes.temp_ip b
    -----------------

    Any help would be greatly appreciated

    Hello

    It is a bit of a wild card, I think because it will require 14 scans to fill the table temp_ip to unpivot codes diagnostic and procedure, so this lilkely things are moving slower than the original. However, as it is a temporary table, I guess you could have some control over its structure, or at least be able to dismiss it and try something else. If you are able to change the structure of this table, you could make the application much simpler and probably much faster. I think that you need a list of codes of procedure for the year and a list of diagnosis for fiscal codes. I do this through the large list of UNION all THE INSTRUCTIONS, but you can have a more efficient way to do according to the base tables you are people temp_ip of. In any case, it's here (as far as I can tell this will do the same job)

    WITH codes AS
    (   SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            primary_PROCEDURE       procedure_code,
            primary_diagnosis       diagnosis_code,
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_1    procedure_code,
            secondary_diagnosis_1    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_2    procedure_code ,
            secondary_diagnosis_2    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_3    procedure_code,
            secondary_diagnosis_3    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_4    procedure_code,
            secondary_diagnosis_4    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_5    procedure_code,
            secondary_diagnosis_5    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_6    procedure_code,
            secondary_diagnosis_6    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_7    procedure_code,
            secondary_diagnosis_7    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_8    procedure_code,
            secondary_diagnosis_8    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_9    procedure_code,
            secondary_diagnosis_9    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_10  procedure_code,
            secondary_diagnosis_10    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_11  procedure_code,
            secondary_diagnosis_11    diagnosis_code
        FROM
            temp_ip
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_12  procedure_code,
            secondary_diagnosis_12    diagnosis_code
        FROM
            temp_ip
    ), hd_procedure_hierarchy AS
    (   SELECT
            NVL (MAX (a.hierarchy), 0) hd_procedure_hierarchy,
            a.fiscal_year
        FROM
            ref_hd.nhs_opcs_hier a,
            codes pc
        WHERE
            a.fiscal_year = pc.hd_spell_fiscal_year
        AND
            a.code = pc.procedure_code
        GROUP BY
            a.fiscal_year
    ),hd_diagnosis_hierarchy AS
    (   SELECT
            NVL (MAX (a.hierarchy), 0) hd_diagnosis_hierarchy,
            a.fiscal_year
        FROM
            ref_hd.nhs_icd10_hier a,
            codes pc
        WHERE
            a.fiscal_year = pc.hd_spell_fiscal_year
        AND
            a.code = pc.diagnosis_code
        GROUP BY
            a.fiscal_year
    )
    SELECT b.*, a.hd_procedure_hierarchy, c.hd_diagnosis_hierarchy
      FROM analytic_hes.temp_ip b,
           LEFT OUTER JOIN hd_procedure_hierarchy a
              ON (a.fiscal_year = b.hd_spell_fiscal_year)
           LEFT OUTER JOIN hd_diagnosis_hierarchy c
              ON (c.fiscal_year = b.hd_spell_fiscal_year)
    

    HTH

    David

  • The MRT.exe program keeps using 50% of my cpu all the time, how do I stop

    I really need help... After you install the update for the MRT. EXE for it can always stay less and its made my computer run slow and my cpu runs at 10 degrees warmer... I need help it is so frustrating.

    First of all, most of the people who respond on this forum is not related to Microsoft.  Unless the machine is identified as a "Support Engineer" or "Microsoft moderator system" or similar, he or she is not employed by Microsoft.  Thus, one who you "connected direct to" was not one of our "associates".

    MRT.exe is the Microsoft Malicious Software Removal Tool.  A new version of this tool is included in the critical updates each month on "Patch Tuesday" (the first Tuesday of the month).  It must run once - at the time download you - where and then be dormant for the rest of the month, except if you manually start upward.

    Apparently, the nameless person with which you handled has not well understand this.

    Have you ever received a message indicating that the MRT found something?

    Click Start > run and then type the following in the run box, and then click OK
       
    %SystemRoot%\Debug

    A Windows Explorer window will open and you should see - at least - a file named mrt.log.  Well, you will see another file named mrt.log.old, which is the last newspaper of the month.

    Open the file with Notepad mrt.log.  You should see something like the following:

    ---------------------------------------------------------------------------------------

    Microsoft Windows Malicious Software Removal Tool v3.19, may 2011
    Began Wednesday, May 11 01:54:01 2011

    Summary of the results:
    ----------------
    No infections found.
    Malicious software removal tool Microsoft Windows has finished Wednesday May 11 01:57:25 2011

    Return code: 0 (0x0)

    If there is an ERROR in the log, post it here or see http://support.microsoft.com/kb/891717

    MRT.exe does not run continuously.  If so, something is wrong.

    MRT.exe should be located in c: Windows\System32.  If she is not there, look for your entire drive, making sure to check the search options "Search system folders", "search the hidden files and folders" and "Search subfolders".  If you find MRT.exe somewhere other than C:\Windows\system32, it is probably malware masquerading as the real Malicious Software Removal Tool.

    Everywhere where you find it, delete it.  You can download the latest version of the MRT here.

    I also suggest you analyzing your system with free MalwareBytes Antimalware and SUPERAntiSpyware.  Be sure to update both scanners before their execution.

    If, after you remove MRT.exe, you get an error at startup complain that MRT could not be found, download and run Autoruns.  Click the 'Connection' tab and look in the column 'Image path' the MRT.exe.  If it is not displayed in the connection tab, click the "all" tab and use the file > search tool.  A characteristic of the search of Autoruns tool is that you must move the selection under the element line "found" before you "Find Next."  Once you find the entrance with MRT.exe, delete it.

  • SVCHOST is keep my 30% CPU all the time!

    My CPU is housed at 30% all the time because of SVCHOST constantly running. There are multiple instances (usually 2 or 3) to operate and my CPU usuage never less than 30%. I watched until it SVCHOST is intended and have decided that I should not stop anything that has to do with it.

    Is there any fix out there to keep it from eating my system resources, or is it just a natural part of Windows now?
    (currently under Vista, even though I have this same problem on my laptop, which is running XP)

    Hi wildgamer,

    We have collected some imformation from the Microsoft Help and how article from the link below which will help you to know which services are used by various instances of SVCHOST.exe are running on your computer.  From there, you can decide if it would be a good idea to stop these services or not.

    Of the atricle:
     
    Svchost.exe is a process on the computer that hosts, or contains, other individual services that Windows uses to perform various functions. For example, Windows Defender uses a service that is hosted by a svchost.exe process.

    To view the services that are running under svchost.exe

    1.

    Open the Task Manager by right-clicking the taskbar and then click Task Manager.

    2.

    Click the processes tab.

    3.

    Click on Show processes from all users.

    If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    4.

    Right-click a svchost.exe instance and then click on reach or services. Services associated with the process are highlighted on the Services tab.

    What is SVCHOST.exe?

    This is probably a good idea to leave things as they are, if you are not noticed problems of performance for this reason, but it will tell you what services are used by svchost.exe.  Please let us know if you have any other questions.  Thank you. Shane
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • W7 100% CPU all the time - what can I do about it?

    Hi and thanks in advance for the help. My computer has very little memory, so I keep it really clean. Do just about everything with him, it is browse the web and stream media. Recently, it has been very slow, and Firefox (49.2) has suspended all the time. At first, I thought it was Firefox, and I followed all of their instructions to identify the high resource using plugins, etc. I deleted the history, ran CCleaner, etc.. Then I realized that even if I close FF I always see spikes frequent (approximately five seconds) to 100% CPU usage, and it often extends by 50% even if I don't do anything. I ran Avast and Malwarebytes and MSE - full scan with each of them and none of them found nothing. Is it possible that my computer resources is hacked and used by someone else?  As for mining bitcoin or something else?  How I understand this and stop it?  If it is little likely, what can I do to improve performance. It seems kind of ridiculous that open a document or a web page to "forever".  Even to write this post, I type, and then look at the screen, while the letters slowly appear...

    Not sure what is relevant for the problem, but I have 4MB of RAM, but the single 80 GB hard drive (hope I said that right), which only 29GB is free. Right now I am 1480 Cached, available from 1725 and ~ 320 is free, there are 69 total running processes. The only applications that are running are FF and two documents LibreOffice.  I checked a few days ago, and the system says that I don't have to defragment.

    I don't even know if all this has nothing to do with the peaks of the processor, so it's how little I know!

    Any help is very appreciated!

    Try running task Mgr, looking for running applications, locate the (s) using all the resources, R.click on this subject,

    Properties, see what/why use that much... In addition, 69 process is quite a bit, will try to run or cmd,.

    type: services.msc scroll through, double click on one, properties, clear the value or manual start. Manual start

    Are available on request. Also, open the event viewer, get the details of the operating system, looking for event/warning,.

    R.Click, Properties. Also streaming video uses a lot of pc resources.

  • WUAUSERV takes up 50% of my CPU all the time

    Separated from this thread.

    I have the same problem as the OP, I ran track for 60 seconds during high cpu/memory/fan use and in the end, I stopped wuauserv to show the normal state of my pc. Then saved... Here is a link to the newspapers

    https://drive.Google.com/folderview?ID=0BxySCTCnRImDc1BiNnFpNFdjdVE&USP=sharing

    I have separated you in your own thread because your problem is slightly different.

    This is no doubt WU using about 25%.  I see where when you killed he went down to nothing.

    There's a good thread on it here

    https://blogs.technet.Microsoft.com/asiasupp/2007/05/29/automatic-update-causes-Svchost-exe-high-CPU/

    If the above is not enough, you can reset the windows update service is reading how here

    http://www.tenforums.com/tutorials/24742-Windows-update-reset-Windows-10-a.html

    I would also like to launch a file system check (& DISM) for the status of the operating system

    Please run a check of system files (SFC) & DISM if you're on win 8 or higher 

    All instructions are in our Wiki article below... If you have any questions please ask us.

  • stats from cpu ESXTOP expand/rollup

    Hello

    I use esxi 4.1, SSH'd in there. I'm trying to drill holes in the cpu stats a virtual machine that has multiple worlds by pressing 'e' in the screen of the CPU. When I do this, he invites you to GID the virtual machine. However, it will accept only 7 characters. The GID is 8 characters. Invariably, he tells me that impossible to find GID.

    any ideas?

    Thank you

    Hello.

    See if Ko 1031145 is no help.

    Good luck!

  • ESXi 4.1 statement incorrect CPU Count - IBM 3850

    I tried looking for it, but had no luck so there goes!

    I have an IBM 3850 M2 that has processors Xeon 7450 (4) with 6 cores each.

    In ESXi, he reports it as 8 processors with 3 hearts of each.

    What the devil?

    The full version is ESXi 4.1 Update 1 (IBM flavor).

    Hardware monitoring works very well. Funny is that the number of core is really good, just the physical CPU number is double what it should be.

    Anyone else run into this?

    Welcome!

    check if help http://communities.vmware.com/message/1625442?tstart=0

    Please, do not forget the points of call of the "useful" or "correct" answers

    Mauro Bonder - moderator

  • Get-stat cpu.avg.usage - sets the time window over a month

    Is it possible to retrieve the stats from cpu to a listening period per day more than a month?

    For example, I have virtual machines that are under the maximum load of 10:00 to 23:00 Monday to Friday, but do not load outside these hours and not on the weekends. This seems very complicated to me, and I can't wrap my head around it.

    I tried to adjust the beginning and find values of finishing at these times, who will work for one day.

    Yes, this is the way to do it, you can include anything you want in the loop.

    Simply add the properties of the object that you create inside the loop.

  • AWR TIME STATISTICS

    Hello everyone,

    I need an answer everything into question of my mind.

    I have an example of awr report and I wonder on below...

    How is it 'execute sql elapsed time' and "DB CPU" are both is greater than the total duration of DB. Or the sum of all statisctics are greate than the total duration of DB.

    I knew that TIME DB = DB CPU + sql execute elapsed time + analysis elapsed time...

    But all of them are greater than 100, how and why.

    Statistics name time (s) per cent of the time Total of DB

    ---------------------------------------- -------- ------------------------

    DB time 124 564

    Execute SQL time elapsed 95 118 853

    DB 27 033 22 CPU

    analysis time elapsed 12 15 552

    12-14-868 elapsed hard analysis

    elapsed time of bottom 6 7 804

    hard analysis (sharing criteria) elapsed ti 4 5 198

    me



    PL/SQL 3 3 272 elapsed execution

    time 2 2 546 background cpu



    Statistics name time (s) per cent of the time Total of DB

    ---------------------------------------- -------- ------------------------

    hard analysis (bind incompatibility) passed 1 1 672

    PL/SQL compilation elapsed 1 1 050

    elapsed time of connection management call 178 0

    sequence of time charge 141 0

    Time cpu RMAN (backup/restore) 38 0

    repeated bind passed 13-0

    could not parse elapsed 3 0

    entering the time of PL/SQL rpc 0 0

    881931 wrote:
    Thank you my friend,

    I saw this response drinking I did not understand, Tom explained sql out of time, but I want to learn "why all are 100% grater."

    Thank you very much

    The simple reason why the statistics add up to more than 100% is because the statistics are not designed to be added together in the way that you add statistics. Statistics of time DB is just the CPU and wait event total time for the sessions of the user, so it was a logical choice as a divider for all statistics. Most of the time model statistics contributes to the statistic of time DB, but there is overlap between the statistics - for example, time CPU DB is required to run SQL statements (these two are listed statistics). Also included in the report of statistics that are not components of the statistics of time DB, as background the elapsed time, time background and RMAN (backup/restore) time cpu - cpu but the report still divides these statistics of statistics of time DB, probably just so that you have a common point of reference.

    Time model statistics should be seen in a tree that represents the parent relationships and the child between the statistics. The following article shows the directory structure and how you would interpret the statistics:
    http://hoopercharles.WordPress.com/2010/01/13/working-with-Oracle-time-model-data/

    If you take another look at your statistics:

    Statistic Name                           Time (s) Percent of Total DB Time
    ---------------------------------------- -------- ------------------------
    DB time                                   124,564
    sql execute elapsed time                  118,853                       95
    DB CPU                                     27,033                       22
    parse time elapsed                         15,552                       12
    hard parse elapsed time                    14,868                       12
    background elapsed time                     7,804                        6
    hard parse (sharing criteria) elapsed ti    5,198                        4
    PL/SQL execution elapsed time               3,272                        3
    background cpu time                         2,546                        2
    hard parse (bind mismatch) elapsed time     1,672                        1
    PL/SQL compilation elapsed time             1,050                        1
    connection management call elapsed time       178                        0
    sequence load elapsed time                    141                        0
    RMAN cpu time (backup/restore)                 38                        0
    repeated bind elapsed time                     13                        0
    failed parse elapsed time                       3                        0
    inbound PL/SQL rpc elapsed time                 0                        0
    

    You can make certain assumptions as follows:
    27 033 CPU seconds spent doing the work for user sessions. Because 124 564 seconds are indicated by the statistics of time DB, you can determine that about 124 564-27 033 seconds were spent in the events of waiting for user sessions. Sessions spent 15 552 seconds, the analysis of the SQL statements (note that some time CPU would be also consumed during analysis) and 14 868 seconds of this hard time parsing SQL statements, so sessions consume 15 552-14 868 seconds soft analysis of SQL statements. 14 868 seconds past hard analysis, 5 198 seconds were caused by sharing criteria and that 14 868-5 198 seconds were probably due to the unique SQL statements being submitted to the database. And so on.

    Charles Hooper
    Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
    http://hoopercharles.WordPress.com/
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • AWR show this sql as more CPU consuming sql. Is - this need for sql tunning?

    Hello

    Awr showing this sql as the consumer of CPU above reports

    Please consider me as a newbie and help me understand this.

    Thanking you...
    SQL ordered by CPU Time            DB/Inst:  Snaps:  
    -> Resources reported for PL/SQL code includes the resources used by all SQL
       statements called by the code.
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    
        CPU      Elapsed                  CPU per  % Total
      Time (s)   Time (s)  Executions     Exec (s) DB Time    SQL Id
    ---------- ---------- ------------ ----------- ------- -------------
         2,658      2,665            1     2658.18     5.7 5aawbyzqjk8by
    select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, ta
    s_site ts where trp.tsa_id = tti.tsa_id and tti.status = 1 and ts.site_id = trp
    .site_id and (tti.max_install != trp.pushed_rsn and ((tti.max_install = 0 and
    (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :1) or (tti.max_install
    SQL full = >
    select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, tas_site
    ts 
    where 
    trp.tsa_id = tti.tsa_id 
    and tti.status = 1 
    and ts.site_id = trp.site_id  
    and
    (
    tti.max_install != trp.pushed_rsn 
    and  (
           (tti.max_install = 0 and 
               (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :1
           ) or  
           (tti.max_install > 0 and 
               (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :2
           ) or   
           (tti.max_install = trp.pushed_rsn and
           tti.max_install <> 0 
           ) 
         )
    ) or 
    (trp.pushed_time != 
    (
    to_date(tti.created_date,'dd-MON-yyhh24:mi:ss') + (1/24/60) * ts.workahead_time
    ) and  
    (
      (
    to_date(sysdate,'dd-MON-yyhh24:mi:ss') + (1/24/60) * :3
      ) > trp.pushed_time
    )
    )
    get the plan of the explain for the above sql command = >
    QL> SELECT plan_table_output FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('g6c8y31xr06vp',0,'ALL'));
    
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  g6c8y31xr06vp, child number 0
    -------------------------------------
    select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, tas_site
    ts  where trp.tsa_id = tti.tsa_id and tti.status = 1 and ts.site_id = trp.site_id  and
    (tti.max_install != trp.pushed_rsn and  ((tti.max_install = 0 and (trp.pushed_rsn -
    trp.curr_rsn) < ts.workahead_count * :1) or  (tti.max_install > 0 and (trp.pushed_rsn -
    trp.curr_rsn) < ts.workahead_count * :2) or   (tti.max_install = trp.pushed_rsn and
    tti.max_install <> 0 )  )) or (trp.pushed_time != (to_date(tti.created_date,'dd-MON-yy
    hh24:mi:ss') + (1/24/60) * ts.workahead_time) and  ((to_date(sysdate,'dd-MON-yy
    hh24:mi:ss') + (1/24/60) * :3) > trp.pushed_time))
    
    Plan hash value: 2862358316
    
    ------------------------------------------------------------------------------------------------
    | Id  | Operation               | Name                 | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT        |                      |       |       |   601K(100)|          |
    |   1 |  HASH UNIQUE            |                      |     4 |   216 |   601K (10)| 02:00:14 |
    |   2 |   CONCATENATION         |                      |       |       |            |          |
    |   3 |    NESTED LOOPS         |                      |   200M|    10G|   579K  (6)| 01:55:52 |
    |   4 |     MERGE JOIN CARTESIAN|                      |  2849 | 99715 |    12   (0)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL  | TAS_SITE             |     7 |    70 |     3   (0)| 00:00:01 |
    |   6 |      BUFFER SORT        |                      |   407 | 10175 |     9   (0)| 00:00:01 |
    |*  7 |       TABLE ACCESS FULL | TAS_RECEIPTS_PROCESS |   407 | 10175 |     1   (0)| 00:00:01 |
    |*  8 |     TABLE ACCESS FULL   | TAS_TSA_INFO         | 70411 |  1306K|   203   (6)| 00:00:03 |
    |*  9 |    HASH JOIN            |                      |     2 |   108 |   203   (2)| 00:00:03 |
    |* 10 |     HASH JOIN           |                      |   407 | 14245 |     7  (15)| 00:00:01 |
    |  11 |      TABLE ACCESS FULL  | TAS_SITE             |     7 |    70 |     3   (0)| 00:00:01 |
    |  12 |      TABLE ACCESS FULL  | TAS_RECEIPTS_PROCESS |   407 | 10175 |     3   (0)| 00:00:01 |
    |* 13 |     TABLE ACCESS FULL   | TAS_TSA_INFO         | 21474 |   398K|   196   (2)| 00:00:03 |
    ------------------------------------------------------------------------------------------------
    
    Query Block Name / Object Alias (identified by operation id):
    -------------------------------------------------------------
    
       1 - SEL$1
       5 - SEL$1_1 / TS@SEL$1
       7 - SEL$1_1 / TRP@SEL$1
       8 - SEL$1_1 / TTI@SEL$1
      11 - SEL$1_2 / TS@SEL$1_2
      12 - SEL$1_2 / TRP@SEL$1_2
      13 - SEL$1_2 / TTI@SEL$1_2
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       7 - filter("TRP"."PUSHED_TIME"<TO_DATE(TO_CHAR(SYSDATE@!),'dd-MON-yy
                  hh24:mi:ss')+.000694444444444444444444444444444444444445*:3)
       8 - filter("TRP"."PUSHED_TIME"<>TO_DATE(INTERNAL_FUNCTION("TTI"."CREATED_DATE"),'dd-M
                  ON-yy hh24:mi:ss')+.000694444444444444444444444444444444444445*"TS"."WORKAHEAD_TIME")
       9 - access("TRP"."TSA_ID"="TTI"."TSA_ID")
           filter(("TTI"."MAX_INSTALL"<>"TRP"."PUSHED_RSN" AND (("TTI"."MAX_INSTALL"=0 AND
                  "TRP"."PUSHED_RSN"-"TRP"."CURR_RSN"<"TS"."WORKAHEAD_COUNT"*:1) OR
                  ("TTI"."MAX_INSTALL">0 AND "TRP"."PUSHED_RSN"-"TRP"."CURR_RSN"<"TS"."WORKAHEAD_COUNT"*:2
                  ) OR ("TTI"."MAX_INSTALL"="TRP"."PUSHED_RSN" AND "TTI"."MAX_INSTALL"<>0)) AND
                  (LNNVL("TRP"."PUSHED_TIME"<TO_DATE(TO_CHAR(SYSDATE@!),'dd-MON-yy
                  hh24:mi:ss')+.000694444444444444444444444444444444444445*:3) OR
                  LNNVL("TRP"."PUSHED_TIME"<>TO_DATE(INTERNAL_FUNCTION("TTI"."CREATED_DATE"),'dd-MON-yy
                  hh24:mi:ss')+.000694444444444444444444444444444444444445*"TS"."WORKAHEAD_TIME"))))
      10 - access("TS"."SITE_ID"="TRP"."SITE_ID")
      13 - filter("TTI"."STATUS"=1)
    
    Column Projection Information (identified by operation id):
    -----------------------------------------------------------
    
       1 - "TRP"."SITE_ID"[NUMBER,22]
       2 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22],
           "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22],
           "TRP"."PUSHED_TIME"[DATE,7], "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22],
           "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7]
       3 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22],
           "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22],
           "TRP"."PUSHED_TIME"[DATE,7], "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22],
           "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7]
       4 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22],
           "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22],
           "TRP"."PUSHED_TIME"[DATE,7]
       5 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22]
       6 - (#keys=0) "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22],
           "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7]
       7 - "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22],
           "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7]
       8 - "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22],
           "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7]
       9 - (#keys=1) "TRP"."TSA_ID"[NUMBER,22], "TTI"."TSA_ID"[NUMBER,22],
           "TS"."SITE_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7],
           "TRP"."CURR_RSN"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7], "TTI"."STATUS"[NUMBER,22],
           "TTI"."MAX_INSTALL"[NUMBER,22]
      10 - (#keys=1) "TS"."SITE_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TRP"."TSA_ID"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7], "TRP"."CURR_RSN"[NUMBER,22],
           "TRP"."PUSHED_RSN"[NUMBER,22]
      11 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22],
           "TS"."WORKAHEAD_TIME"[NUMBER,22]
      12 - "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22],
           "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7]
      13 - "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22],
           "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7]
    
    
    105 rows selected.
    sizes of the objects concerned = >
    OWNER           SEGMENT_NAME                   SEGMENT_TYPE         TABLESPACE_NAME      EXTENTS           BYTES_
    --------------- ------------------------------ -------------------- -------------------- ------- ----------------
    AZD_SCHM     TAS_TSA_INFO                   TABLE                TATSU_DATA_TS             22        7,340,032
    AZD_SCHM     TAS_TSA_INFO_PK                INDEX                TATSU_DATA_TS             17        2,097,152
    --------------- ------------------------------ -------------------- -------------------- ------- ----------------
    AZD_SCHM     TAS_RECEIPTS_PROCESS           TABLE                TATSU_DATA_TS              1           65,536
    AZD_SCHM     TAS_RECEIPTS_PROCESS_IDX       INDEX                TATSU_INDEX_TS             1           65,536
    --------------- ------------------------------ -------------------- -------------------- ------- ----------------
    AZD_SCHM     TAS_SITE                       TABLE                TATSU_DATA_TS              1           65,536
    AZD_SCHM     TAS_SITE_NAME_UNQ              INDEX                TATSU_INDEX_TS             1           65,536
    AZD_SCHM     TAS_SITE_PK                    INDEX                TATSU_DATA_TS              1           65,536
    --------------- ------------------------------ -------------------- -------------------- ------- ----------------
    Please suggest how to tune this above SQL

    Above sql plan looks good


    Any comment and help is appreciated highely.

    Thank you and best regards,
    IVW

    Hello
    It is a production system?
    Are you a license to use the AWR?

    concerning

    Alan

Maybe you are looking for