How to monitor worst performing sql statements

Hi,
I am new to oracle 9i release 2. I come from the Windows world, where we used sql server.
When we performanced tested our product, we always monitor the worst performaning sql statement using the sql profiler. At the end of a 24 hour test, the profiler will list the sql statement with the longest execution time. What is the equivalent Oracle 9i tools that will allow me to monitor the worst performaning sql during a test that lasts between 10 to 24 hours?
Thanks,
Paul0al

Besides statspack and OEM you have a few other options.
If an SQL statement had been identified as performing poorly or a job that you can extract the SQL from then you have the option of explaining all the SQL statements and just reviewing the plans for reasonableness. You can also trace actual execution of the task or individual statemnts (alter session set sql_trace = true for basic 10046 event).
When the SQL has not been identified in advance you can query the shared pool SQL areas for SQL statements that have relatively high physical, logical, or combined IO counts. Then you can perform tuning activities for these statements.
HTH -- Mark D Powell --

Similar Messages

  • How to examine the generated SQL statement in Receiver JDBC Adapter

    I have been searching this forum how to display te generated sql statement (by the jdbc receiver adapter).
    The only suggestion is to use RWB, but I was unable to find any details about how to do so.
    Any help is appreciated

    Hi,
    To add, u can see the SQL Statements in Audit log of RWB.
    Select Message Monitoring-> Adapter Engine. choose ur entry and click on Details option button, u can see the SQL Statements in Audit Log.
    Regards,
    Sudharshan
    Message was edited by:
            Sudharshan Aravamudan

  • How could I find the SQL statement who get this message ?

    ORA-01555 caused by SQL statement below (Query Duration=11191 sec, SCN: 0x0854.723b9c32)
    ... How could I find the SQL statement who got this message ?
    Thanks, Paul

    ORA-01555 means that the UNDO/ROLLBACK space is not large enough.
    This occurs because the SELECT statement is attempting to read the UNDO, but the UNDO has been released (transactions have committed or rolled back) and reused.
    The following are SOME of the reasons I have seen this to occur:
    1) Updates in a loop, with commits happening in the same loop
    - this will mark the UNDO available quickly and quickly reuse it. Then when the SELECT wants to rebuild a block, the UNDO used to rebuild the block has been reused (solution, make the UNDO bigger)
    2) A SELECT cursor used to control a loop in which updates are performed, and a 'done' flag is marked against the current cursor record, and commits are performed at the end of each loop, prior to fetching the next record
    - same problem as above, but it hits the current process. Same solution
    3) A 'month end' activity spike occurs, and all sorts of transactions create updates. There is a report that reports the activity - amusingly it needs to start at the beginning of all the work and updates periodically by doing a huge SELECT up front. This is then used to drive a loop which attempts to get information from the various transactions that have been updated and committed. After a while, the SELECT gets an ORA-01555
    - same problem as above and same solution. Get a bigger UNDO segment.
    You say this only happens once a month. That should give a hint.
    I wouldn't bother with which SELECT statement, as much as which APPLICATIONs are being run when it happens.
    One way around this - use 10g and set the guaranteed retention period. All sorts of other things will break, by no more 1555. <g>

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • How to monitor SERVER performance

    hello,
    how to monitor the performance of the server,whether it is hit ratio is high or not
    can u please send the query
    regards

    Database Performance Monitoring is a little more complicate than running a query to get ratio. And different version of Oracle has different tools and utilities to help you.
    Strongly recommend you read Oracle® Database Performance Tuning Guide

  • How to monitor the performances of VMs & Hyper-v Cluster host node running on SCVMM Cluster.

    hello...,
    How to monitor the performances of VMs & Hyper-v Cluster hosts node running on SCVMM Cluster from SCOM so that we can
    Identify the highest utilized(CPU and Memory ) VM on that from cluster  hyper-v host.
    Identify the lowest utilized (CPU and Memory )Hyper-v Host in the Cluster .
    After identifies VMs and Hyper-v cluster  host on SCVMM , so that we  can  proceed to do migrate the Highest Utilized VM to Lowest Utilized
    Hyper-v cluster host. 
    To identified and implement above ,what are the things I need to do or configured on SCOM.
    Thanks
    RICHA KM

    hello...,
    How to monitor the performances of VMs & Hyper-v Cluster hosts node running on SCVMM Cluster from SCOM
    so that we can
    Identify the highest utilized(CPU and Memory ) VM on that from cluster  hyper-v
    host.
    Identify the lowest utilized (CPU and Memory )Hyper-v Host in the Cluster .
    After identifies VMs and Hyper-v cluster  host on SCVMM , so that we  can  proceed
    to do migrate the Highest Utilized VM to Lowest Utilized Hyper-v cluster host. 
    To identified and implement above ,what are MPs i need to installed on SCOM for implementing
    this.
    Thanks
    RICHA KM

  • How can I write a SQL statement which checks if a table exists?

    How can I write a SQL statement which tells me whether a table exists?

    execute an sql query: select * from <tablename>
    catch the exception n check whether the erroe code
    matches the one that occurs for table doesn't exist
    that's itHow is your answer any different from the one given in the first reply?
    It isn't.
    As WorkForFood says DatabaseMetaData has a bunch of methods for getting information about tables but this is more useful when you don't know the names of any of the tables.. it sounds like you do so I would concur SELECT from table is probably the quickest way to go. If it helps the Xopen error should be either S1000 or 42S01 (I think) but I would try and see if there is a specific vendor code for table not found/not exists error and check for that.

  • How to monitor the performance of EBS iAS?

    Hello All,
    I am looking for your advise on how to monitor the performance of EBS (11i/R12) iAS
    How to measure iAS worload during a certain period?
    How to know the number of iAS hits/requests?
    How to the iAS response time?
    Regards,
    Tareq

    Thanks EBSDBA and Helios for your time.
    Are there any scripts/reporting tool that helps me monitor iAS performance other than OEM for EBS?
    Note:370583.1 is very helpful in monitoring JDBC connections. Are there any similar Notes/scripts that can answer my questions:
    How to measure iAS workload during a certain period?
    How to know the number of iAS hits/requests?
    How to the iAS response time?
    Appreciating your cooperation,
    Tareq

  • Monitor real time sql statement.

    Hii All,
    I am working on win 7 machine using oracle 11gR2 with tool sql developer.
    I am accessing database using VPN from some xyz location.
    I want to monitor the sql statements like insert, update when somebody performs operation using front end.
    I have done this before in case of oracle forms via toad's sql monitor.
    But I can't use toad now, only sql developer.
    So please let me know how i can do this.
    Thank you.
    Aamir

    Hi,
    Following query will give you currently running SQLs,
    select sesion.sid,
    sql_text
    from v$sqltext sqltext, v$session sesion
    where sesion.sql_hash_value = sqltext.hash_value
    and sesion.sql_address = sqltext.address
    and sesion.username is not null
    order by sqltext.piece;
    This should help you.
    Thanks,
    Sundaram.

  • How to audit alter user sql statements in Oracle 11g.

    I want to audit all the alter user sql statements that show who is altered with what sql stment including the connections performed by sys and system.
    Ex: If I use the command : alter user xxx quota 50 GB on users;
    Then how can i grab this sql stement and who performed it with the timings.

    Pl post OS and database versions.
    What have you learned from the documentation ?
    http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_4007.htm#SQLRF01107
    http://download.oracle.com/docs/cd/E11882_01/network.112/e16543/guidelines.htm#DBSEG508
    What have you tried to implement so far ?
    HTH
    Srini

  • How to set client within SQL statement without using another pl/sql stmt.

    I have a following select statement
    SELECT SUM (w.prior_forecasted_costs + w.prior_committed_costs)
    FROM xxsuf.job_cost_summary_table w,
    apps.pa_periods p,
    pa.pa_resources bz,
    pa.pa_resource_list_members cz,
    pa.pa_tasks dz
    WHERE w.project_id = z.project_id
    AND w.task_id = dz.task_id
    AND dz.task_number '98000'
    AND w.resource_list_member_id = cz.resource_list_member_id
    AND cz.resource_id = bz.resource_id
    AND NOT EXISTS (SELECT NULL
    FROM pa.pa_tasks zz
    WHERE zz.parent_task_id = dz.task_id)
    AND w.resource_list_member_id != 1000
    AND p.period_name = w.pa_period
    AND p.current_pa_period_flag = 'Y'
    Above select statement uses pa_periods view which only works when I set my client using "exec DBMS_Application_Info.set_client_info(83);" in Toad or SQL*Plus session.
    I was wondering how can I achieve it within select statement. so that I don't have to use another PL/SQL statement to set my client. Is there anyway to set client with my org id within above select statement ?
    Please advise.
    --Rakesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can simply create a function which calls dbms_application_info and use that in your sql statement as in
    SQL> create or replace function set_client_info (i_info varchar2)
       return varchar2
    as
    begin
       dbms_application_info.set_client_info (i_info);
       return i_info;
    end set_client_info;
    Function created.
    SQL> create or replace view v_emp
    as
      select * from emp where empno = to_number(sys_context('userenv','client_info'))
    View created.
    SQL> select ename from v_emp where set_client_info(7788) is not null
    ENAME    
    SCOTT    
    1 row selected.
    SQL> select ename from v_emp where set_client_info(7900) is not null
    ENAME    
    JAMES    
    1 row selected.

  • How to tune the following sql statements which has two unions in oracle 10g

    It takes a long time to run the following sql statement in 10g. Each select brings back about 4 million rows and there will be about 12 million rows. When I run each select statements seprately in sqlplus I can see the data immedaitely but when I run it as whole with two unions in the select it just takes very very long time? I want to know how to make this run faster? Can we add hints? or is it because of any table space? Any help is appreciated.
    select
    D.EMPLID
    ,D.COMPANY
    ,'CY'
    ,D.CALENDAR_YEAR
    ,D.QTRCD
    ,D.ERNCD
    ,D.MONTHCD
    ,D.MONTHCD
    ,D.GRS_MTD
    ,D.GRS_QTD
    ,D.GRS_YTD
    ,D.HRS_MTD
    ,D.HRS_QTD
    ,D.HRS_YTD
    from PS_EARNINGS_BAL D
    where D.SPCL_BALANCE = 'N'
    union
    select
    D.EMPLID
    ,D.COMPANY
    ,'FY'
    ,(case when D.MONTHCD > '06' then D.CALENDAR_YEAR + 1 else D.CALENDAR_YEAR end)
    ,ltrim(to_char(to_number(D.QTRCD) + decode(sign(3-to_number(D.QTRCD)),1,2,-2),'9'))
    ,D.ERNCD
    ,ltrim(to_char(to_number(D.MONTHCD) + decode(sign(7-to_number(D.MONTHCD)),1,6,-6),'09'))
    ,D.MONTHCD
    ,D.GRS_MTD
    ,D.GRS_QTD
    ,(select sum(F.GRS_MTD) from PS_EARNINGS_BAL F where
    F.EMPLID = D.EMPLID and
    F.COMPANY = D.COMPANY and
    F.ERNCD = D.ERNCD and
    F.SPCL_BALANCE = D.SPCL_BALANCE and
    (case when F.MONTHCD < '07' then F.CALENDAR_YEAR -1 else F.CALENDAR_YEAR end)
    = (case when D.MONTHCD < '07' then D.CALENDAR_YEAR -1 else D.CALENDAR_YEAR end)
    and to_number(F.MONTHCD) + decode(sign(7-to_number(F.MONTHCD)),1,6,-6)
    <= to_number(D.MONTHCD) + decode(sign(7-to_number(D.MONTHCD)),1,6,-6))
    ,D.HRS_MTD
    ,D.HRS_QTD
    ,(select sum(F.HRS_MTD) from PS_EARNINGS_BAL F where
    F.EMPLID = D.EMPLID and
    F.COMPANY = D.COMPANY and
    F.ERNCD = D.ERNCD and
    F.SPCL_BALANCE = D.SPCL_BALANCE and
    (case when F.MONTHCD < '07' then F.CALENDAR_YEAR -1 else F.CALENDAR_YEAR end)
    = (case when D.MONTHCD < '07' then D.CALENDAR_YEAR -1 else D.CALENDAR_YEAR end)
    and to_number(F.MONTHCD) + decode(sign(7-to_number(F.MONTHCD)),1,6,-6)
    <= to_number(D.MONTHCD) + decode(sign(7-to_number(D.MONTHCD)),1,6,-6))
    from PS_EARNINGS_BAL D
    where D.SPCL_BALANCE = 'N'
    union
    select
    D.EMPLID
    ,D.COMPANY
    ,'FF'
    ,(case when D.MONTHCD > '09' then D.CALENDAR_YEAR + 1 else D.CALENDAR_YEAR end)
    ,ltrim(to_char(to_number(D.QTRCD)+decode(sign(4-to_number(D.QTRCD)),1,1,-3),'9'))
    ,D.ERNCD
    ,ltrim(to_char(to_number(D.MONTHCD)+decode(sign(10-to_number(D.MONTHCD)),1,3,-9),'09'))
    ,D.MONTHCD
    ,D.GRS_MTD
    ,D.GRS_QTD
    ,(select sum(F.GRS_MTD) from PS_EARNINGS_BAL F where
    F.EMPLID = D.EMPLID and
    F.COMPANY = D.COMPANY and
    F.ERNCD = D.ERNCD and
    F.SPCL_BALANCE = D.SPCL_BALANCE and
    (case when F.MONTHCD < '10' then F.CALENDAR_YEAR -1 else F.CALENDAR_YEAR end)
    = (case when D.MONTHCD < '10' then D.CALENDAR_YEAR -1 else D.CALENDAR_YEAR end)
    and to_number(F.MONTHCD)+decode(sign(4-to_number(F.MONTHCD)),1,9,-3)
    <= to_number(D.MONTHCD)+decode(sign(4-to_number(D.MONTHCD)),1,9,-3))
    ,D.HRS_MTD
    ,D.HRS_QTD
    ,(select sum(F.HRS_MTD) from PS_EARNINGS_BAL F where
    F.EMPLID = D.EMPLID and
    F.COMPANY = D.COMPANY and
    F.ERNCD = D.ERNCD and
    F.SPCL_BALANCE = D.SPCL_BALANCE and
    (case when F.MONTHCD < '10' then F.CALENDAR_YEAR -1 else F.CALENDAR_YEAR end)
    = (case when D.MONTHCD < '10' then D.CALENDAR_YEAR -1 else D.CALENDAR_YEAR end)
    and to_number(F.MONTHCD)+decode(sign(4-to_number(F.MONTHCD)),1,9,-3)
    <= to_number(D.MONTHCD)+decode(sign(4-to_number(D.MONTHCD)),1,9,-3))
    from PS_EARNINGS_BAL D
    where D.SPCL_BALANCE = 'N'
    Edited by: user5846372 on Mar 11, 2009 8:55 AM

    Hi,
    What i observed is that your table name and where clause is same in all the thress SELECTs whereas columns having some manipulations that is not going to be unique. I guess you can easily replace UNION with UNION ALL.
    from PS_EARNINGS_BAL D
    where D.SPCL_BALANCE = 'N'Note: I am not aware of your data and business requirement. Please test the result before removing. It is just a suggetion
    Cheers,
    Avinash

  • How to get the real SQL statement from a preparedstatement?

    Hi,
    I am trying to log the actual SQL sent to database by the preparedStatement. Since the original SQL I used to prepare the statement has a lot of "?" in it, after setting all the parameters in the preparedStatement, I want to get the final SQL statement executed. Is there a way to get it? Probably the SQL will depend on different drivers.
    Thanks in advance.

    Thanks, changhsu. I tried the tracing technique. But it only prints out the original SQL statement sent to the preparedStatement. The following is part of the log file:
    ======================================================================
    --------NetDirect JSQLConnect Version:2.2708--------
    2002-04-10 14:23:54.818 (1) Connection attempt number 1 Connection ID:1 for host:perseus
    2002-04-10 14:23:55.429 (1) JSQLConnect(2.2708) Trial license - expires on:Thu Apr 25 17:47:32 CDT 2002, unlimited connections
    2002-04-10 14:23:55.449 (2) Connection allocated from pool ID:2
    2002-04-10 14:23:55.72 (2) [Thread[Thread-6,5,main], IO:88cb4, Dbc:1346]] SELECT SHARED_DRIVES FROM EPM_PREFS WHERE PRODUCT='PE'
    2002-04-10 14:23:57.913 (2) Connection closed and returned to connection pool ID:2
    2002-04-10 14:23:58.193 (3) Connection attempt number 2 Connection ID:3 for host:perseus database:epm20 SQL6.5:false
    2002-04-10 14:23:58.203 (3) [Thread[Thread-6,5,main], IO:88cb3, Dbc:1347]] use epm20 set quoted_identifier,ansi_null_dflt_on,ansi_padding on set textsize 2147483647 set transaction isolation level read committed set implicit_transactions off
    2002-04-10 14:24:00.356 (4) Connection allocated from pool ID:4
    2002-04-10 14:24:01.168 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] PreparedStatement::prepare stmt:SELECT PASSWD FROM RESOURCE_INFO WHERE USER_ID=? AND DELETE_FLG IS NULL
    2002-04-10 14:24:01.448 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_prepare
    2002-04-10 14:24:01.488 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_execute
    =======================================================================
    I did not try to trace in SQL Server 7. I will have to find out how to do that first.
    Thanks again.

  • How can I execute Dynamic SQL statement in Forms?

    Hi All,
    I have to execute dynamic SQL statement from Forms
    Below statement I have to execute
    "EXECUTE IMMEDIATE v_stmt INTO v_return;".
    Googled for the same got results saying, Better use Database function or procedures to execute these Dynamic Statements but We want to execute in forms only.
    Can any one help me..
    Thanks,
    Madhu

    So in short you are trading code obfuscation for maintainability and the ability to share code between tools? If from somewhere else you need a procedure already implemented in database PL/SQL (and now ported to forms) this would mean you'd need to implement it in every other tool. In times where you might want to integrate your forms with $other_technology and putting stuff on the database is the first step to share functionality you just go the opposite way? And all that because someone is afraid that somebody might steal your source code? I am sorry to be blunt, but this is just plain stupid.
    Leaving aside that some things like Analytic Functions, Bulk processing or execute immediate are not even available in forms your software consists of how many LOC? How long does it take to bring a new developer up to speed with your source code? Imagine how long that would take for a developer who doesn't have coleagues who know their way around.
    And just so you know: I work for a ISV selling a closed-source product as well. We have 200+ customers all over the planet. We are well aware that wrapped packages can be reverse engineered. The premise is: stored procedures can be reused in every tool we have, if it makes sense to put stuff on the database by all means do it. If someone would want to reverse engineer our software I'd wish him good luck as some parts are implemented in such a hilarious complicated way I have troubles understanding them (and quite frankly I refuse to understand certain parts, but that's another story). I do work for almost 10 years for that ISV.
    In any case the possible solutions have already been mentioned: you have exec_sql, create_group_from_query and forms_ddl to execute dynamic SQL in forms whereas forms_ddl is a one way street and most certainly not the thing you need or want. Take a look at the documentation for the other 2 things.
    cheers

  • How should I pass complicated sql statements to a function ?

    Hello
    Some built-in functions, such as dbms_advisor.quicktune accepts sql statements as in parameters. Those parameters are treated as varchar2, but if the sql statement is complicated and contain " ' " characters then its hard to pass those params, Sometimes they arent parsed correctly.
    How should I pass a complicated statement (with subqueries, strings and so) to a function ?
    Thanks
    Guy

    user11973359 wrote:
    Hello
    Some built-in functions, such as dbms_advisor.quicktune accepts sql statements as in parameters. Those parameters are treated as varchar2, but if the sql statement is complicated and contain " ' " characters then its hard to pass those params, Sometimes they arent parsed correctly.
    How should I pass a complicated statement (with subqueries, strings and so) to a function ?
    Thanks
    GuyWhats your db verzion. To over come the single quotes issue in string you can use q'[]' representation of string.
    select q'[Karthick's]' from dual

Maybe you are looking for

  • Can i repartition an extended hard drive?

    I partitioned a 1TB Seagate exHD so i could back up with Time Machine and use the partition for other stuff.Well, i never used the other side but, now the partition i used for TM is filled. So, what i want to know is whether i can repartition the unu

  • Trying to restore from computer backup...says its not saved???

    Hello I went to the genius bar to have a problem solved. It was suggested I back up (which I did to my computer) restore back to factory setting (which I did) and then hook up to iTunes and choose restore from back up (and choose the back up I want f

  • 2004s - Users in LDAP,

    I have modified the UME xml file, and am now pulling my users from our (readonly) ldap server(s). The users apppear to be successfully imported - I can login with a UME DB user, and search for users that exist only in LDAP. I can also login with an L

  • Rendering Images from a s:Arraylist and datagroup

    Ok, I have one last problem that is perplexing me.  I am seeing the following when I run my application: In my code I have main.mxml: <fx:Declarations>           <!--<mx:HTTPService id="mediaData" url="http://www.serco-hrc.com/SNAmedia/pictures.xml"

  • Unknown file error when capturing in FCP 6

    I capturing from a DVD, using AJA Kona card, component in. I can preview the video in Log & Capture, but when I try to Capture Now, I get an unknown file error and cannot capture. Just a regular DVD, analog capture. I've tried creating new projects.