Code for finding CPU utilisation for executing query

Hi, i need code for finding CPU utilisation for executing the particular query.

Use session tracing, then in trace file you can find cpu utilization for particular statement on each phase: parse, execute, fetch and the overall.
Or You can use the dbms_utility.get_cpu_time (if your database is 10g) in pl/sql:
declare
cpt1 pls_integer;
cpt2 pls_integer;
cputime pls_integer;
begin
cpt1:=sys.dbms_utility.get_cpu_time;
<some code here>
cpt2:=sys.dbms_utility.get_cpu_time;
cputime:=cpt2-cpt1;
end;
good luck

Similar Messages

  • Method for finding row count after executing query

    Is there a method for finding the row count from the resultset after executing a query on a database ?

    The best way: read the data from the result set. If you read it into e.g. a LinkedList, size() will tell you how many rows you got. Or you could increment a counter.
    There are other ways, such as variants of ResultSet that do the read loop for you. But since you'll be doing the fetch loop anyway, those just add unnecessary work and moving parts.

  • Error Opening Reports (Cannot find Dimension Scenario, Error executing query: the member null doesn't exist in this application)

    Hello,
    two of our users get the following error message, when opening two specific reports:
    First Report: Cannot find Dimension Scenario.
    Second Report: Error executing query: the member null doesn't exist in this application.
    Other users can access these reports, and the same users where the problem occurs can access other reports in the same folder.
    I set the same rights for me, but i can access the reports without problems.
    Somebody encountered the same problem before?

    Hi there,
    I had the same issue a few weeks ago... not sure how it happened but it was related only with my username.
    In order to fix it:
    1. I created a report which does not require to select the scenario in advance. Try to use the default data-grid that you get when you first create a report for example.
    2. When the user runs the report, try to see if he can see the dimension. Do not use the missing dimension on rows or columns. If he can see the dimension, ask him to select one scenario. This will solve the issue.
    3. If he cannot see the dimension, try to change the layout of the report.
    Regards,
    Thanos

  • Re: Any Transaction Code to Find Configuration Settings for FICO

    Hi Friends,
    I want to know is there any transaction code to identify the configuration made for FICO for a particular company.
    Pleae help me out.
    Regards,
    vivek

    Hai  Vivek,
    The complete configuration can be viewed through EC01. Go to EC01, Press on structure, In the next screen click on navigation. Press enter through all the messages. The next screen would display a tree structure with all company codes under the client. Select ur company and double click. the entire configuration, with the related assignments can be viewed in a tree format.
    In OBY6 u would in a position to look at the assignments pertaining to company code whereas in EC01, you would be in a position to have a complete configuration including the integration with mm and sd.
    This wud definitely solve ur prob.
    <b>Assign points if useful</b>.
    Regards,
    Smruti

  • Looking for a CPU Heatsink for a AM socket motherboard

    I am trying to upgrade my motherboard to a Angelica2.  The support information sheet stated that I can use a Zambezi FX processors.  The list is long so I want put them all down.  I ordered through Amazon the FX-8350 processor.  The processor went in the sockets with no problem.  The heatsink stated that is supported the AM3+sockets.  Well the motherboard did not have the supports around the processor sockets holes for the new heatsink. Here is the problem.  I can not find the heatskink that will support this board.  Please help. I have the parts number which is HP#656333.001.  The HP# for the processor is 657914-011.

    AM3b is also known as AM3+. I am assuming you had another motherboard in the computer before you got this one and you wanted to swap over the old heatsink/cooler. That is why I want to see the old motherboard or maybe just the old fan/heatsink. I think you need a bracket adapter plate or they might be mounts on the old board you can just detach and move over.  http://www.amazon.com/AMD-CPU-Bracket-Base-socket/dp/B006JA9PTC 

  • Cloud Control 12c: no values for "Database CPU Time (%)"  for 9i databases

    Hi ,
    we have several databases in our CloudControl - and for most of them (Oracle release 10g or higher) the value "Database CPU Time (%)" under the tab "Databases" has a value. For databases of version 9i this value always shows up as a "-" sign - and for a few databases of version 10g or 11g, too.
    Is this a known issue of the CloudControl or the agent?
    We are using CloudControl 12.1.0.1.0.
    Any help will be appreciated.
    Rgds
    Jan

    Please post a screen shot. DB time instrumentation was added in DB 10g so that may be why in pre-10g databese, the value is absent. It should show up for 10g and higher databases though as long as they (user calls) have some CPU consumption to report.
    -Mughees

  • CRM Table for finding Partner Function for a Sales Order

    Hello everyone,
    I am trying to retrieve Ship-to-Party Customer Number for a particular Transaction (Sales Order) from a SAP CRM table.
    In SAP SD we have a table VBPA for the same.
    I would like to retrieve the same either from a single table if available or multiple linked tables in SAP CRM.
    I tried to link CRMD_ORDERADM_H & CRDM_PARTNER to retrieve the data .. But it dint work.
    I am new to CRM .. so Gurus, please share ur insight.
    Thanks
    Vin

    Hi,
    Select GUID_SET in table CRMD_LINK where GUID_HI = CRMD_ORDERAMD_H-GUID.
    Use the GUID_SET to select data in table CRMD_PARTNER.
    Best regards,
    Caíque Escaler

  • Good Resource for Finding Java Developer for Startup?

    Not sure if this is the appropriate to place to post but we are looking for an interested Java developer to come onboard our very small (2 man) startup to help us with our networked Java application.
    I have looked around a little online and not found much so does anybody know where is a good place to scout out such persons? Admittedly we are not flush with $ but we do have some and we would be providing equity along with ongoing cash payment. Of course we also understand we won't be getting the best Java guru out there but then we don't really need that either, just someone capable of simple socket programming, swing and basic SQL stuff. Not rocket science, and we would even consider less experienced developers with a keen interest to learn and use this as an opportunity to develop some new real-world skill so their own. We are very laid back.
    Any help appreciated.

    I'd try one of:
    Your local Entrepreneurs meetup
    - there's bound to be one, and people who go along to this sort of thing will either be able to recommend someone or you might even meet the right sort of Java dev there.
    The Joel On Software jobs board
    - because the right sort of people read Joel On Software
    Personal recommendations
    - because that's always best; if you're not asking around like crazy, you should be.

  • Help reqd for finding TAXES & CONDITIONS FOR GIVEN PO IN SAP-SCRIPT

    HI ALL,
             Currently iam working on SAP-SCRIPT developing PO in that i displayed fields like EMATN TYPE EKPO-EMATN,( material no. )
                 TXZ01 TYPE EKPO-TXZ01, ( long text )
                 MEINS TYPE EKPO-MEINS, ( units )
                   MENGE TYPE EKPO-MENGE (quantity)
    now i want to display taxes & conditions for given ematn no.( material no . ) so from which tables i should get the data  how to display. plz help me.
    thanks in advance.
    Regards,
    mahesh dudam

    Hi !!
      for this please study teh following extract :
    All pricing values are maintained in the KONV table for the respective pricing condition . Extract these values from KONV table by passing EKKO-KNUMV values for the Purchase order number from the EKKO purchase order header table .
    ************************************************************************88
    FORM GET_PRICING_DATA  USING    P_KNUMV.
      SELECT * INTO TABLE I_KONV
                FROM KONV
                WHERE KNUMV = WA_EKKO-KNUMV.
      IF SY-SUBRC = 0.
        SORT I_KONV.
      ENDIF.
    ENDFORM.                    " GET_PRICING_DATA
    *&      Form  get_tax_details
    extract Tax item details.
         -->P_EBELp  for purchase order item.
    FORM GET_TAX_DETAILS  USING    P_EBELP.
      DATA : L_OCTROI LIKE KONV-KWERT,
            L_BASE LIKE KONV-KWERT,
            L_OTHERS LIKE KONV-KWERT,
            L_DISCOUNT LIKE KONV-KWERT,
            L_PFORWARD LIKE KONV-KWERT,
            L_INSU LIKE KONV-KWERT,
            L_NUM LIKE I_KONV-KUMZA VALUE 1,
            L_DENO LIKE I_KONV-KUMNE VALUE 1,
            L_KPEIN LIKE KONV-KPEIN VALUE 1,
            L_FRT LIKE KONV-KWERT,
            L_CHAR(15).
    *-- getting numerator and denominator for base value.
      READ TABLE I_KONV  WITH KEY KSCHL = 'PBXX'.
      IF SY-SUBRC = 0.
        L_NUM = I_KONV-KUMZA.
        L_DENO = I_KONV-KUMNE.
        L_KPEIN = I_KONV-KPEIN.
      ELSE.
        READ TABLE I_KONV  WITH KEY KSCHL = 'PB00'.
        IF SY-SUBRC = 0.
          L_NUM = I_KONV-KUMZA.
          L_DENO = I_KONV-KUMNE.
          L_KPEIN = I_KONV-KPEIN.
        ELSE.
          READ TABLE I_KONV  WITH KEY KSCHL = 'P001'.
          IF SY-SUBRC = 0.
            L_NUM = I_KONV-KUMZA.
            L_DENO = I_KONV-KUMNE.
            L_KPEIN = I_KONV-KPEIN.
          ELSE.
            READ TABLE I_KONV  WITH KEY KSCHL = 'P000'.
            IF SY-SUBRC = 0.
              L_NUM = I_KONV-KUMZA.
              L_DENO = I_KONV-KUMNE.
              L_KPEIN = I_KONV-KPEIN.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CLEAR : V_OCTROI,V_OTHERS, V_DISCOUNT,V_PFORWARD,V_INSU,V_FTR.
      LOOP AT I_KONV WHERE KPOSN = P_EBELP.
    *-- Considering the numerator denominator and UOPricing
        IF   I_KONV-KPEIN = 0  .
          I_KONV-KUMZA = 1.     " Numerator
          I_KONV-KUMNE  = 1.    " Denominator
          I_KONV-KPEIN  = 1.    " Unit of pricing
        ENDIF.
       IF NOT I_KONV-KWERT  IS INITIAL .
         IF  I_KONV-KRECH = 'C'  AND  I_KONV-KSCHL <> 'PB00'
           AND I_KONV-KSCHL <> 'PBXX'.
           I_KONV-KWERT  = ( I_KONV-KWERT * I_KONV-KUMZA  )
                           * L_KPEIN / ( I_KONV-KUMNE * I_KONV-KPEIN ).
         ELSEif I_KONV-KRECH = 'C'  AND  I_KONV-KSCHL = 'PB00'
           AND I_KONV-KSCHL = 'PBXX'.
           I_KONV-KWERT  = ( I_KONV-KWERT * L_NUM * L_KPEIN ).
                          / ( L_DENO ).
        elseif I_KONV-KRECH = 'A'  AND  I_KONV-KSCHL = 'PB00'
           AND I_KONV-KSCHL = 'PBXX'.
           I_KONV-KWERT  = ( I_KONV-KWERT * L_NUM * L_KPEIN )
                            / ( l_deno ).
         ENDIF.
       ENDIF.
        CASE I_KONV-KSCHL.
    *-- For base price
          WHEN 'PB00'.
            L_BASE = L_BASE + I_KONV-KWERT.
          WHEN 'PBXX'.
            L_BASE = L_BASE + I_KONV-KWERT.
          WHEN 'P000'.
            L_BASE = L_BASE + I_KONV-KWERT.
          WHEN 'P001'.
            L_BASE = L_BASE + I_KONV-KWERT.
    *-- For octroi
          WHEN 'JOCM'.
            L_OCTROI = L_OCTROI + I_KONV-KWERT  .
    *-- For discount calculation
          WHEN 'ZDT%'.
            L_DISCOUNT = L_DISCOUNT + I_KONV-KWERT .
          WHEN 'ZDN%'.
            L_DISCOUNT = L_DISCOUNT + I_KONV-KWERT.
          WHEN 'ZDTV'.
            L_DISCOUNT = L_DISCOUNT + I_KONV-KWERT .
          WHEN 'ZDNV'.
            L_DISCOUNT = L_DISCOUNT + I_KONV-KWERT.
    *--- For packing forwarding .
          WHEN 'ZPNV'.
            L_PFORWARD = L_PFORWARD + I_KONV-KWERT.
          WHEN 'ZPN%'.
            L_PFORWARD = L_PFORWARD + I_KONV-KWERT.
    *--- For frieght .
          WHEN 'ZFTV'.
            L_FRT  =  L_FRT + I_KONV-KWERT.
          WHEN 'ZFT%'.
            L_FRT  =  L_FRT + I_KONV-KWERT.
          WHEN 'ZFNQ'.
            L_FRT  =  L_FRT + I_KONV-KWERT.
    **-----for others
         WHEN 'ZOTV'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
         WHEN 'ZOT%'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
         WHEN 'ZOTP'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
         WHEN 'ZONV'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
         WHEN 'ZON%'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
         WHEN 'ZONP'.
           L_OTHERS  =  L_OTHERS + I_KONV-KWERT.
    *--- for insurance
          WHEN 'ZINV'.
            L_INSU  =  L_INSU + I_KONV-KWERT.
          WHEN 'ZIN%'.
            L_INSU  =  L_INSU + I_KONV-KWERT.
          WHEN OTHERS.
            CONTINUE.
        ENDCASE.
        CLEAR I_KONV.
      ENDLOOP.

  • Finding Business Objects for Transaction Codes

    Hello,
    How to find out the Business Object for a transaction code. For instance I want to find out the Business Object for Tcode: BP.
    Please guide me!
    Regsrds,
    Khushboo

    Thanks Gerhard!
    But I am looking forward to the PROCESS STEPS to be followed for finding the BO for a TCODE.
    I had quoted TCODE: BP just as an example.
    Regards,
    Khushboo

  • CPU Cost of a Query without executing it?

    Is there any mathematical formula to find CPU cost of a query without executing it? Thanks

    902181 wrote:
    Is there any mathematical formula to find CPU cost of a query without executing it? ThanksAny why do you want the cost? What do you expect it to tell you? How are you planning to apply this in your code? Make sure you understand what cost tells you and what it does not tell you. And use that value in a sane fashion.
    As for an alternative to using EXPLAIN PLAN, you can simply parse a SQL into a cursor without executing it. Then determine the SQL cursor id and address and use DBMS_XPLAN to display its execution plan.
    E.g.
    SQL> create or replace procedure ParseSQL( sqlStatement varchar2 ) is
      2          c       integer;
      3  begin
      4          c := DBMS_SQL.open_cursor;
      5 
      6          DBMS_SQL.parse(
      7                  c,
      8                  sqlStatement,
      9                  DBMS_SQL.native
    10          );
    11 
    12          DBMS_SQL.close_cursor( c );
    13  end;
    14  /
    Procedure created.
    SQL>
    SQL> var sqlID varchar2(100)
    SQL> var childNumber number
    SQL> var sqlText varchar2(4000)
    SQL> begin
      2          ParseSQL( 'select /* TEST1 */  * from emp' );
      3 
      4          select
      5                  sql_text, sql_id, child_number into :sqlText, :sqlID, :childNumber
      6          from    v$sql
      7          where   sql_text like 'select /* TEST1 */%';
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> col PLAN_TABLE_OUTPUT format a50
    SQL> select
      2          rownum, p.plan_table_output
      3  from       TABLE( DBMS_XPLAN.Display_Cursor( :sqlID, :childNumber, 'BASIC,COST' ) ) p;
        ROWNUM PLAN_TABLE_OUTPUT
             1 EXPLAINED SQL STATEMENT:
             2 ------------------------
             3 select /* TEST1 */  * from emp
             4
             5 Plan hash value: 3956160932
             6
             7 -----------------------------------------------
             8 | Id  | Operation         | Name | Cost (%CPU)|
             9 -----------------------------------------------
            10 |   0 | SELECT STATEMENT  |      |     3 (100)|
            11 |   1 |  TABLE ACCESS FULL| EMP  |     3   (0)|
            12 -----------------------------------------------
            13
    13 rows selected.
    SQL> The problem is extracting intelligence from the output as it is raw text. Perhaps not that complex as a where clause can be added to only display line id 0 and then extract the cost value from that line. Regular expressions (not my forte) will likely do this easily.

  • TIP: Clean slate for find/change

    Hi,
    Sharing a little tip I just thought of. Very straightforward and
    obvious, but quite useful, and I haven't noticed it mentioned elsewhere.
    If you're doing a lot of find/replace, you'll repeatedly need to remove
    all selections and start with a clean slate (nothing in the find/replace
    fields, clear all formatting).
    It seemed to me for a while that we're missing a "Clear All" button in
    the find/replace box.
    So the answer is simple: clear everything, all options, etc., and save
    it as a find/replace query.
    Now whenever you need a clean slate for find/save, just select that query.
    It's working nicely for me!
    Happy new year,
    Ariel

    I was going to stay out of this, but find I can't. Sometimes it seems to me that scripters see everything as being better solved through scripting.
    I actually think Ariel's observation about saving a blank query is quite brilliant, and I have to agree that there are times, and plenty of users like me who don't use a KB hortcut to access find change, where users will find having the saved blank query much faster than any other method of clearing the dialog. Both methods have their place, but I find it disingenuous to say that Jongware's scriptlet "solves" the case where you want to keep the old values -- it actually complicates things as you then must remember if you are to run the KB shortcut, or use the menu, to acieve the desired result.
    I think it would be far better to say that this, like many things in ID, can be accomplished in more than one way, and that they way you do it may be different at different times, and that the mehod of choice is exactly that, a choice subject to the user's own preference.

  • Help needed in Finding Download location for Sun One Portal 7

    Hi,
    help needed for finding download location for Sun ONE Portal 7. I tried to find in Oracle Download page ,
    http://www.oracle.com/us/sun/sun-products-map-075562.html, But unable to find.
    Please share the link for download location.
    I am totally new in Sun ONE Portal.
    Thanks,
    Edited by: 945439 on Oct 5, 2012 3:41 AM

    try edelivery.oracle.com under sun products.

  • Pass input to Automator's "Ask for Finder Items"

    Hi,
    I have created an Applescript in Automator, which is  set up to determine a folder location where config files reside.
    I would like to pass this location to "Ask for Finder Items", so that the default config file is selected, but the user can select their own config file if they prefer.
    I can't see any way to reference my location variable in the "Ask for Finder Items" action.
    I've also tried to view the "Ask for Finder Items" sourcecode for a hint, but can't figure out how to do this either.
    Any help greatly would be greatly appreciated!
    Thanks,
    Dan

    Found this approach which is working for me:
    set config_file to choose file with prompt "Locate the config file and click OK" default location MYLOCATIONVARIABLE
    This opens the finder at the correct folder.

  • Syslog logging for zone.cpu-shares ???

    Hi,
    I have defined two zones (zone1 and zone2) and set zone.cpu-shares in global zone.
    I've set also global state for zone.cpu-shares for logging.
    The questions is why I do not get any messagess in "/var/adm/messges.warning" when some zone use more cpu-shares than defined.??
    Configuration follows:
    root@sol10test# prctl -i zone 0 1 2
    zone: 0: global
    zone.cpu-shares
            privileged         20       -   none                                 -
            system          65.5K     max   none                                 -
    zone: 1: zone2
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    zone.cpu-shares
            privileged         10       -   none                                 -
            system          65.5K     max   none                                 -
    zone: 2: zone1
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    zone.cpu-shares
            privileged         70       -   none                                 -
            system          65.5K     max   none                                 -
    root@sol10test# rctladm
    zone.cpu-shares             syslog=warning [ no-basic no-deny no-signal count ]
    root@sol10test# cat /etc/syslog.conf
    *.warning                                       /var/adm/messages.warning
    ...P.S. does not work with syslog=notice either :((

    Hi,
    I have defined two zones (zone1 and zone2) and set zone.cpu-shares in global zone.
    I've set also global state for zone.cpu-shares for logging.
    The questions is why I do not get any messagess in "/var/adm/messges.warning" when some zone use more cpu-shares than defined.??
    Configuration follows:
    root@sol10test# prctl -i zone 0 1 2
    zone: 0: global
    zone.cpu-shares
            privileged         20       -   none                                 -
            system          65.5K     max   none                                 -
    zone: 1: zone2
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    zone.cpu-shares
            privileged         10       -   none                                 -
            system          65.5K     max   none                                 -
    zone: 2: zone1
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    zone.cpu-shares
            privileged         70       -   none                                 -
            system          65.5K     max   none                                 -
    root@sol10test# rctladm
    zone.cpu-shares             syslog=warning [ no-basic no-deny no-signal count ]
    root@sol10test# cat /etc/syslog.conf
    *.warning                                       /var/adm/messages.warning
    ...P.S. does not work with syslog=notice either :((

Maybe you are looking for