How to get top SQLs in a time period

HI, How can identify top SQL over a period of 1-month. Top SQL tab only displays top SQLs in last 24 hours in grid control.
Neeraj

AWR is your answer. Find the snapshots from Month old to current or what ever time you want and create a preserved snapshot set. and then create a report.
That will give you the top 10 sql with in that range.
AWR can be found under Adminstration tab.
Naren

Similar Messages

  • How to Get TOP Sql

    Hi All,
    I need to get TOP sql query in 11g Database.
    I dont know about PT.
    User will carry on some testing activity on the Database, i need to get the top sql from the database.
    There is no access to AWR, ADDM and Entriprise console.
    I need to get the output of the queries by executing some sql.
    Can some body help me in this regards.
    Thanking You
    Pramodh

    >
    Whether it is possible to get the full set of sql, i tried executing this it is gives the report part by part.
    >
    I am not sure what the problem is.
    You get the top 5 SQL statements because of the "<6" part of the code. Would be top 10 if "<11" and so on.
    Maybe you have got to format the output a little in SQL*Plus to get it better readable - I leave that up to you :-)
    Kind regards
    Uwe
    http://uhesse.wordpress.com

  • How to get physical SQL query

    Hi All,
    How to get the physical SQL query for the OBIEE reports.
    Thanks in advance,
    Haree.

    Hi Anitha,
    Thanks for your reply,
    I am getting XML script in log file. (Settings > Administration > Manage Sessions > View Log).
    How to get physical SQL query ?
    Thanks,
    Haree

  • How to get wage type for every time record

    Hi Pros,
          I am using DS 0CA_TS_IS_1, it includes report time type (0REPTT), but not have wage type. in CATSDB, I fied fields for attendance/absence type and wage type. but not every time record has wage type. can you please tell me how to get wage type for every time record? what is relation between reporting time type, attendance/absence type and wage typs?

    Hello,
    Can you talk to your HR/T&E functional consultant if they populate these values in CATSDB table using standard way or if there are custom fields that are in CATSDB OR any other table which can be used to meed the requirements
    Thanks
    Abhishek Shanbhigue

  • How to get the SQL Signon that Agent Jobs "Run As" or "Executed as User"

    How to get the SQL Signon that Agent Jobs "Run As" or "Executed as User"?
    I have an install SQL scripts that creates a Linked Server. I want to put some security on the Linked Server and only grant the Agent Job Signon (the "Run As" or "Executed as User") access to the linked server. I need to retrieve the
    Agent Job Signon (something like "NT SERVICE\SQLAgent$FIDEV360BI02").
    I could query certain jobs and SUBSTRING the Message column - using some form of the query below, which would return "Executed as user: NT SERVICE\SQLAgent$SSDEVBI02. The step succeeded." But that is pretty imprecise.
    use msdb
    SELECT [JobName] = JOB.name,
    [Step] = HIST.step_id,
    [StepName] = HIST.step_name,
    [Message] = HIST.message,
    [Status] = CASE WHEN HIST.run_status = 0 THEN 'Failed'
    WHEN HIST.run_status = 1 THEN 'Succeeded'
    WHEN HIST.run_status = 2 THEN 'Retry'
    WHEN HIST.run_status = 3 THEN 'Canceled'
    END,
    [RunDate] = HIST.run_date,
    [RunTime] = HIST.run_time,
    [Duration] = HIST.run_duration,
    [Retries] = HIST.retries_attempted
    FROM sysjobs JOB
    INNER JOIN sysjobhistory HIST ON HIST.job_id = JOB.job_id
    -- CHANGE THIS
    -- WHERE JOB.name like '%GroupMaster%' or Job.name like '%etlv%'
    ORDER BY HIST.run_date, HIST.run_time

    by default all sql jobs are executed as sql server agent account, unless otherwise a proxy is setup.
    you can get the proxy information as Olaf mentioned, if the proxy_id is null for the step, it implies that the job step was executed as sql server service account and in such case it will be null
    so, if it is null, it ran as sql server agent account.
    so, one work around is get the sql server agent service account and if the proxy is null, that means it ran as sql server agent account, so, use isnull function. the disadvantage would be if the sql server agent account was switched, you might not get the
    accurate information as the new account will show up though the job really ran as old account, to get this information, you need to  get this from the logmessage column as you mentioned above.
     try this code...
    /*from sql 2008r2 sp1, you get the service accounts using tsql,otherwise you have to query the registry keys*/
    declare @sqlserveragentaccount varchar(2000)
    select @sqlserveragentaccount= service_account
    from sys.dm_server_services
    where servicename like '%sql%server%agent%'
    select message,isnull(name,@sqlserveragentaccount) as AccountName
    from sysjobhistory a inner join sysjobsteps b
    on a.step_id=b.step_id and a.job_id=b.job_id
    left outer join sysproxies c on c.proxy_id=b.proxy_id
    Hope it Helps!!

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • How to get top CPU consuming sql oracle 10g

    I can see the top sql by running ASH report. but there is too much infomation. is there a way I can just display TOP SQL section, and filter out other parts? this way I can use it in a shell script, and loop through the database.
    or is there a query can do the ASH job?
    thanks.
    Karl

    Hi,
    What you will do if the EM console bug present?
    As a best pratice, i will do like below
    1) execute the TOP command and you see process consuming high CPU
    2)
    SQL> oradebug setospid <&OSPid>
    SQL> oradebug tracefile_name --This will list the name of tracefile with location
    SQL> oradebug unlimit
    SQL> oradebug Event 10046 trace name context forever, level 12;
    Let it run for 20 mins around
    SQL> oradebug Event 10046 trace name context off;
    SQL> exit
    3) Tkprof with explain plan
    4) check any plan change for that sql
    Kind Regards,
    Rakesh jayappa

  • How to get top 10 employees in BEx Report

    Hi all,
    I am trying to get top 10 employees who have worked over 50 hrs of overtime in any pay period i choose in query.
    How do i get it ??
    right now my report gives me total of over 50hrs overtime in all chosen pay period employees list.
    Any suggestions ??
    Thank You,
    KSmith

    CAN  SOMEONE PLEASE HELP ME SOLVE THIS PROBLEM ??
    Hi all,
    The problem I have is even though i tried condition for top 10 employees who worked more than 50 hrs.
    My report right now shows all employees overtime under "OT" key figure for each pay period. --> I just want to show employees and overtime which is > 50 for each different pay period
    The condition works only if i display just one pay period...and user dont want it that way. they want to get more than one pay period displayed on the report and should have list of employees who work more than 50 hrs over time. HOW DO I GET THAT ??
    Also there is another key figure count meaning if out of those chosen pay periods there are 3 periods when an employee worked more than 50 hrs of over time then it should show "3". if there 2 pay periods when employee work more than 50 hrs count should display 2 ---> right now i am not able to get that also.
    Please can some one suggest something ??
    Thank You,
    KSmith
    Edited by: Keral Smith on Jul 25, 2008 2:49 PM
    Edited by: Keral Smith on Jul 25, 2008 3:08 PM

  • How to get top 10 actively used TFS projects?

    We have 100+ projects inside a TFS collection, how to find the (say to 10 or 15) most actively used projects? Idealy the activities will include any actions like CI/CO, build, member addition, etc.
    Thanks

    Hi Peter,  
    Thanks for your post.
    As far as I know there’s no a default way to get such top 10 actively team projects report. You should create your custom report using TFS API to achieve that, pleas refer to the discussions in this similar post:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/984d1796-e195-4765-9f55-e2a45bc37c80/how-to-get-a-list-of-active-projects-from-tfs-?forum=tfsgeneral. 
    For this scenario, please submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them
    seriously.  
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get full SQL from an SQL HASH_VALUE

    Dear All,
    I am having Oracle 9.2.0.8 RAC on AIX . I am monitoring long running queries through gv$session_longops and also i use Stats Pack report to find the top CPU/ DB time consuming SQL in hourly basis .
    What is the best way to
    1 get full sql from top SQL HASH VALUE, which is from SP report.
    2.get full SQL of a currently running SQL.
    i use some views for the same but not always i get full SQL.
    Many Thanks in Advance
    Regards
    Edited by: user7699943 on Oct 10, 2011 1:49 PM

    user7699943 wrote:
    Dear All,
    I am having Oracle 9.2.0.8 RAC on AIX . I am monitoring long running queries through gv$session_longops and also i use Stats Pack report to find the top CPU/ DB time consuming SQL in hourly basis .
    What is the best way to
    1 get full sql from top SQL HASH VALUE, which is from SP report.
    2.get full SQL of a currently running SQL.
    i use some views for the same but not always i get full SQL.
    Many Thanks in Advance
    Regards
    Edited by: user7699943 on Oct 10, 2011 1:49 PMhave you tried:
    select sql_Text from v$sql where hash_value = &sql_hash_value

  • How to get tables from at a time two database connections

    dear all ,
    i have get two table information these two table are in two diffrent db(like different conncections username ,password,portno... these r differnt)so how to get at a time that two table inforamtions
    Edited by: user13092208 on Dec 28, 2010 10:42 PM

    repost

  • How to get rid of files on time machine that no longer exist

    I replaced my computer several months ago when my old one died. A large amount of data which was in a partition on my old computer is still on my time machine and is taking up a lot of space and forcing time machine to delete backups much sooner than I would like. I don't know how to get rid of it. If I try to delete that folder from an individual backup, I get the message, "The operation can't be completed because backup items can't be modified." Of course, I can't delete it from my new computer because it's not there! Any help appreciated.
    Marion

    The best method is to archive the contents of the TC to a disk.. archive is available via the airport utility.
    Simply plug in a USB drive large enough to store all the material presently on the TC, 1TB or 2TB or 3TB.. whichever model it is.
    Archive I have drawn red box around.
    Once the archive has completed ..
    Use the Erase disk.. just the Quick erase is ok.. takes a couple of min and then you have a nice empty drive to start loading TM backups on.

  • How to get top 10 records for each option in table prompt?

    Hi,
    I have created one report in which my requirement is to get top 10 highest salaries for each departments. I have created one table prompt which contains the names of all departments. On the salary column I have applied one filter i.e. TOP 10. Currently I am having 3 departments. I want to show the top 10 salaries for each department, but I am getting top 3 from first, 4 from second and 3 from third.They are calculating top 10 salaries based on all departments, not on individual department. How can I get top 10 salaries for each department?

    Hi,
    Use TopN function in your column formula.
    Ex: TOPN("Sales ,5 BY department)
    Thanks,
    Satya

  • How to get the SQL queries based on SQL_ID.

    Hi Experts,
    I want to get the SQL queries based on SQL_ID.
    I have tried the following query,but I am not getting full query.
    [code]SET linesize 132 pagesize 999
    column sql_fulltext format a60 word_wrap
    break on sql_text skip 1
    SELECT   REPLACE (TRANSLATE (sql_text, '0123456789', '999999999'), '9', ''),sql_id
    FROM   dba_hist_sqltext s
    WHERE   s.sql_id = '7tvurftg8zryb';[/code]
    One of my friend said use grid to get full query text.
    Can you please help me how to use grid ,else any other method to get the full query based on SQL_ID.
    Please help me.
    Thanks in advance.

    You have these many options to set, if sql_text is really huge. But better use a tool(TOAD) as it's really helpful and easy to use instead! (See my previous comment).
    column sql_text format A10000
    set echo off
    set head off
    set feed off
    set verify off
    set termout off
    set lines 10000
    set long 1000000
    set trimspool on
    set pages 0
    Thanks!

  • How to get the SQL statement

    I cannot figure how to get the text(SQL statement) from a system view(i guess it is in a system view... but witch??). 'Till now i have the sql_address and the sql_hash_value..
    I know it is possible.. EM does it ... so i should be able to do the same..
    ps:I use 9.2

    v$sql ?

Maybe you are looking for