Trying to find a specific SQL statement to determine its cost

If an sql statement is executed will it ALWAYS show up in the awrrpt report? (10g)
I am a developer DBA and was handed an SQL statement by the production DBA as being a problem during a specific timeframe within the past hour.
That statement does not show up in v$LongOps (although other older ones are) nor does it appear in v$sqltext and is not in the awrrpt even when I run the report for the entire day.
Any other ideas or can I safely broach the Production DBA without looking like an idiot?!!
Thanks

I am not using awrrpt report but for sure if your statement has been executed it must have been in v$sqltext but maybe it did not stay very long because it has been rarely executed and replaced in the shared pool by other SQL statements that have been more executed.
You could setup a copy of your production database on a similar host and run the statement several time in single user mode to check at least its performance in single user with sql_trace=TRUE and tkprof.
If your statement is SELECT your could also execute it in your production database and check at the sametime v$sqltext and also v$sqlarea, especially for:
DISK_READS      NUMBER      Sum of the number of disk reads over all child cursors
BUFFER_GETS      NUMBER      Sum of buffer gets over all child cursors
USER_IO_WAIT_TIME      NUMBER      User I/O Wait Time (in microseconds)
CPU_TIME      NUMBER      CPU time (in microseconds) used by this cursor for parsing, executing, and fetching
ELAPSED_TIME      NUMBER      Elapsed time (in microseconds) used by this cursor for parsing, executing, and fetching

Similar Messages

  • SQL Tuning Advisor on a specific SQL statement

    Hi all,
    How can I used SQL Tuning Advisor in Oracle EM Database Control to tune a specific SQL statement; i.e. the statement is not any of: Top SQL, SQL Tuning Sets, Snapshots Preserved Snapshot Sets.
    Thanks in advance,
    Ahmed B.

    Hi,
    You can use either the automatic SQL tuning features that are accessible from Enterprise Manager Database Console on the "Advisor Central" page or trough SQL*PLUS using the DBMS_SQLTUNE pakage:
    -- creating the tuning task
    set serveroutput on
    declare
      l_sql_tune_task_id  varchar2(100);
    begin
      l_sql_tune_task_id := dbms_sqltune.create_tuning_task (
                              sql_id      => '<your_sql_id>',
                              scope       => dbms_sqltune.scope_comprehensive,
                              time_limit  => 60,
                              task_name   => '<your_tuning_task_name>',
                              description => 'tuning task for statement your_sql_id.');
      dbms_output.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    end;
    -- executing the tuning task
    exec dbms_sqltune.execute_tuning_task(task_name => '<your_tuning_task_name>');
    -- displaying the recommendations
    set long 100000;
    set longchunksize 1000
    set pagesize 10000
    set linesize 100
    select dbms_sqltune.report_tuning_task('<your_tuning_task_name>') as recommendations from dual;For more information, take a look at link provided by Jaffy.
    Cheers
    Legatti

  • Where to find information about SQL States ?

    Hello,
    I'm trying to find information about X/OPEN SQL States explanation. Can anyone help me. ?

    SQLStates are part of the SQL standard and so you can read up on them from any vendor's site.Here is an IBM explanation that talks about the SQLStates class (first two chars) and subcode.
    http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2924/index.htm?info/rzala/rzalaint.html

  • Trying to find out the sql for the below 3 values

    HI Experts,
    I am trying to find the sql that can give me the values for the below three values. can some one Help me out getting these ?
    Free buffer waits (%)
    Local write wait (%)
    Latch: cache buffer chains (%)
    Actually these are the metrics which are available in OEM for the DB releases up to 9i. Post 9i releases , these metrics are obsoleted.
    So, trying to find the sql for these and use them as an UDM for the 10g and 11g DB's
    Thanks in Advance.
    Thanks,
    Naveen kumar.

    And is there any why to find using what sql the metrci is formed ?

  • Query to find the the sql statements

    Hi,
    Oracle Version: 10.2.0.3
    Can any one please help me how to find which sql statements generate the error "OPEN CURSORS EXCEED ".
    Thanks & Regards,
    Poorna Prasad.S

    1) export the table, drop the table, create the table definition in the new
    tablespace, and then import the data (imp ignore=y).
    2) Create a new table in the new tablespace with the "CREATE TABLE x AS
    SELECT * from y" command:
    CREATE TABLE temp_name TABLESPACE new_tablespace AS SELECT * FROM real_table;
    Then drop the original table and rename the temporary table as the original:
    DROP TABLE real_table;
    RENAME temp_name TO real_table;
    3) Use the one mentioned in previous reply.
    After #1 or #2 is done, be sure to recompile any procedures that may have been
    invalidated by dropping the table.

  • Finding the issued SQL statement

    Hi All,
    A user has issued this:
    DROP USER user CASCADE;
    and after a while it got hung up.
    Since all database users are using the same schema, I can not find the sid/serial # to kill it. There are many users in active and inactive status are found but could not identify the user who issued the above sql.
    I know I can extract sid,serial# through v$session view. How can I join this view with other views to identify the sql statement?
    Do you know how?
    Thanks,

    To get the SID and SERIAL # please execute the SQL below:
    set lin 500
    col username format a15
    col terminal format a15
    col program format a40
    col machine format a25
    select s.paddr, p.spid, s.sid,s.serial#,s.terminal,s.machine,s.username,s.status,s.process,s.program,s.module,s.action, s.server from v$session s, v$process p
    where p.addr=s.paddr
    order by s.sid
    To get the SQL Statement you have to get the SID and SERIAL # from above statement and execute the SQL below:
    select x.sql_text from v$sql x, v$session y
    where x.hash_value = y.sql_hash_value
    and x.address = y.sql_address
    and y.sid = &sid
    /

  • Find all the sql statements that are executed in a database

    Hi
    I would like to get all the sql statements that have been executed till now on the database. Also, i need the session and user details who has executed the statement.
    I know this can be done after enabling auditing.
    I would like to get the details without enabling the auditing option.
    I am using oracle 9i and oracle 10g.
    Regards,
    Vamsi

    You can use {noformat}{noformat} tags to preserve the SQL format. Below is an example of how to use it.
    <place your code here>\When your do that your code may look like this.select
         substr(sid || ',' || serial#,0,15) sid,
         USERNAME,
         PROGRAM,
         MACHINE,
         OSUSER,
         TERMINAL,
         sql_text Query
    from
         v$sqltext,
         v$session
    where
         address=sql_address
         and hash_value=sql_hash_value
         and status='ACTIVE'
    order by LOGON_TIME,sid,piece
    This one is more readable to everyone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Sql statement to determine if amm or ASSM is being used

    is there a SQL statement I can use to determine if a DB is using AMM or ASSM. Any examples would be greatly appreciated

    As I understand it,
    select name, isdefault, display_value  from v$parameter where name in ( 'memory_target' , 'sga_target', 'statistics_level') order by name;
    If memory_target is set non-zero, you are using Automatic Memory Management See Managing Memory
    Else if sga_target is set non-zero and statistics_level is TYPICAL or ALL, you are using Automatic Shared Memory Management See Managing Memory and Configuring and Using Memory
    I don't know the Linux memory setup, so I can't comment on the huge pages interaction with AMM and ASSM.
    Regards,
    David

  • Specific SQL statements for custom report?

    I am trying to create a custom report that gives me the System Name, Operating System, Manufacturer, Model, and Last HW Scan. I am not a SQL expert, but which statements would I need to select when I am in SCCM Console and creating a new report? It lists
    hundreds of them. Any help is appreciated, thanks in advance.

    This query will get you started.
    http://smsug.ca/blogs/garth_jones/archive/2008/02/04/basic-all-in-one.aspx
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • Trying to find a specific message alert tone.

    Hi all,
    Firstly, I'm a bit of a dunce when it comes to things remotely techy lol.
    I recently had a E71 which unfortunatel was lost. I have replaced this with an N97.
    However, my favorite message alert tone on the E71, which I'm pretty sure was "message alert tone 3" is not available on the N97, and frankly, I dont like any of the tones on the N97.
    I have tried in vain to find it on the internet to download, but to no avail.
    Can anybody help please.
    Thanks.

    u can copy your messege tone from ur nokia e71 for this u must have a third party app dr.jukka´s y-browser best for u coz it´s free... then serach the ringtone directory which can b the z: drive or it can b differ depend on the phone... on my e55 the location of tones are z:\data\sounds\digital. try it on ur mobile. after finding that u can send it through ur mobile bluetooth. for this u must have installed bluetooth utility which is also free from jukka´s.
    downoad from here
    Message Edited by imx2 on 24-Dec-2009 07:09 PM
    ¨Arm yourself because no one else here will save you¨

  • Trying to find a specific app - help please!

    i am looking for an app, i have searched and searched but there are so many out there, i know someone has had to come up with this, i want an app that will child proof my phone. that will lock out most everything but the games. I have a 2 yr old that loves my phone but calls people and stuff. Is there an easier way to search? i did child or kid and there are SOOO many

    You can stop looking, there is no app that will do what you want.
    If you want to suggest this to Apple, go here: http://www.apple.com/feedback/iphone.html

  • I am getting sick of trying to find a specific area to solve a problem with version 4. If this continues I will not continue with FIREFOX!!!!

    I updated to version 4 and Roboform which worked fine with the previous version which is unknown to me. I have lost things which I used to use and don't know how to access them, I can't say what they were but when I want them that will become apparent. One thing I can bring to mind is my virus protection indicator which was below the main taskbar and should appear automatically.

    If you are using the '''Full RoboForm Toolbar''', install the Roboform adapter for '''Firefox 3.0 - 4 beta X''' from here: <br />
    http://www.roboform.com/firefox.html
    Scroll down that page, you want the one shown under: <br /> '''Additional Full RoboForm Toolbar Information''' <br />
    '''RoboForm Installer Installs Adapter Automatically into Firefox''' <br />
    Or, you can install it from this link: <br />
    http://www.roboform.com/dist/roboform-firefox-3-4-frozen.xpi
    As far as the '''virus protection indicator''', without the exact name of that security tool all I can do is to recommend that you contact the developer of that toolbar extension to see of they have an updated version available for Firefox 4.0.

  • How do I locate my lost ipod 4th gen. if I tried using find my iphone app and it says its offline?? How do i find it??

    Plz help

    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have to iPod play a sound via iCloud.
    - If not shown/or shown as oof-line, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing without a court order                         
    Reporting a lost or stolen Apple product                              
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • SQL statement/ DB Object beling call in last 1 Hour

    Hi,
    Can anyone help me i.e. How to find specific sql statement or database objects being used in last one hr or 24 hrs in Oracle 10.2.0.4?
    Thanks

    Hello,
    To find out specific SQL statement you can used following query  and to find information about object you need to enable object level auditing like select,update,insert and delete.
    SELECT e.SID,
    SUBSTR(osuser,0,7) osuser,
    SUBSTR(username,0,8) username,
    substr(status,1,1) status,
    SUBSTR(machine,0,11) machine,
    TO_CHAR(ROUND(value/1024),9999) || ' KB' memory,
    TO_CHAR((sysdate-logon_time)*24*60,999999.99) minutes,
    q.sql_text
    FROM
    v$session e,
    v$sesstat s,
    v$statname n,
    v$sql q
    WHERE s.statistic# = n.statistic#
    AND n.name = 'session uga memory max'
    AND e.sid = s.sid
    AND q.hash_value(+) = e.sql_hash_value
    order by
    machine,minutes;
    Hope this help.

  • How to find redo generated per each SQL Statement?

    Database version is 10.2.0.4. OS is AIX.
    We have excessive redo generation during specific time of a day. We would like to identify which statement is contributing to this excessive redo.
    ADDM shows this as first finding
    Waits on event "log file sync" while performing COMMIT and ROLLBACK operations were consuming significant database time.
    Is it possible to find out which sql statement is generating how much redo in bytes during a specific time?
    Thank You
    Sarayu

    user11181920 wrote:
    Is it possible to find out which sql statement is generating how much redo in bytes during a specific time?It will not help you.
    For example, you will see bunch of UPDATE,DELETE,INSERT statements issued by apps. So? What you going to do with them? If you can modify the app to eliminate unnecessary DMLs - it would be great of course. But it is unlikely.From what I've seen, namely developers putting way more commits in than the business rules would justify, it is not so unlikely.
    >
    Also when DML statements generate Redo, the do not cause too many waits of "log file sync", because buffer Log writer flushes buffer as soon as it fills more than 30% or after some time, or on Commit/Rollback. This may or may not be true, as there can be several reasons for log file sync: insufficient I/O (which is the only one you are addressing); CPU starvation (because the cpu ultimately controls i/o requests, and even fixing some unrelated sql that hogs the cpu could change this); lgwr priority (on some systems it makes sense to simply raise the priority, it can vary widely as to whether this makes sense); and other things like private redo, file option flags and the IMU relationships with undo that can be too complicated to put in a partial sentence.
    >
    Waits on event "log file sync" while performing COMMIT and ROLLBACK operations were consuming significant database time.So the root cause can be too many commits, which you should evaluate and fix if possible. You can also use Tanel Poder's snapper script, including on lgwr to see more closely what it is waiting on. See page 28: http://files.e2sn.com/slides/Tanel_Poder_log_file_sync.pdf
    >
    Right. It is because Log Writer writes here synchronously, reliably, it waits until HDD writes data down and responds its written OK.
    And HDDs are not the fastest things in computer. They are mechanical - that is why.
    I would recommend you :
    1. Place redo log files on fast HDDs that used preferably dedicated for this purpose only. If other I/O will frequently disturb these drives they will cause heads change tracks which causes longest HDD waits.
    2. Consider to use faster technology like SAN or SSD.Read this instant classic: http://www.pythian.com/news/28797/de-confusing-ssd-for-oracle-databases/

Maybe you are looking for

  • Help in generating the same random numbers each time of the program executi

    dear friends i am facing a problem that the random numbers generated at time of each exectuion of the program are not the same, i want to generate the same random numbers every time time i run the program. i need your help. i am giving the code in c+

  • HCM F&P:Agent determination  without Rule 17900012 .

    Hi experts, I am doing TRANSFER process. In my workflow , I am using Rule 17900012 for agent determination . So the workflow is executing successfully. Now I dont want to use that rule. Instead I tried to give the variable as the EXPRESSION for agent

  • How to create HTML fragment and PHP file for CONTACT FORM?

    Hello! I need to add a contact form to my website. I don't want to use wufoo or similar. Can someone write a code to have a form: NOME: MAIL: MESSAGGIO: and file .php ? Regards. Thanks a lot.

  • Change AutoScroll Bounds in JTextPane

    I cannot figure this out for the life of me. I would like to CHANGE the bounds for the autoscroll on a JTextPane that resides inside a JScrollPane when the user selects text and moves the mouse outside of the "autoscroll bounds". The normal bounds fo

  • Safari acting odd, 70% of time, some page contents vanish when browsed over

    Hi there, & bear w/ me. It always hard to describe a problem when you've become confused, and run down lots of blind alleys. Safari has been having increasing trouble opening pages, often -- but not always __ hanging in midload much longer then I'm u