query to find bad queries that are taking place

I write a job that takes place each a work hour.the will execute the query, the query will select identifiers of bad queries sql which is need for queries that have long been and always in running currently.we will run this work every time some sort of query has bad queries that perform queries currently.the o/p will be inserted into a table.i query to choose bad queries that is currently running

something like that? (Instead of setting long-term work I would simply sort by time)

SELECT sql_id

executions

elapsed_time

TO_CHAR (buffer_gets, '999G999G999G999G999') buffer_gets

, "percent overall.

TO_CHAR (buffer_ex, '999G999G999G999') buffer_ex

TO_CHAR (rows_ex, '999G999G999G999') rows_ex

TO_CHAR (buffer_gets_row, '999G999G999G999') buffer_gets_row

sql_text

FROM (SELECT sql_id

executions

elapsed_time

sql_text

buffer_gets

, ROUND ((buffer_gets) ratio_to_report () * 100) '% overall.

, buffer_gets / buffer_ex of executions

, rows_processed / rows_ex of executions

, buffer_gets / DECODE (rows_processed, 0, 1, NULL, 1, rows_processed) buffer_gets_row

V $ sql

WHERE executions > 0

AND buffer_gets > 0

Sql_id AND to (select sql_id in session $ v where status = 'ACTIVE'))

WHERE the "Total %" > = 5

OR buffer_ex > 1000

OR buffer_gets_row > 8

ORDER BY DESC elapsed_time;

(I guess you can't use v$ sql_monitor, otherwise the answer.)

Tags: Database

Similar Questions

  • SQL query to find approved projects that are open

    Hello

    Can anyone provide a SQL query which will display only the approved projects that are open.

    Thank you

    Titas

    Try this

    Select project NAME of pa_projects_all
    where project_status_code = 'APPROVED '.
    and NVL (CLOSED_DATE, SYSDATE + 1) > SYSDATE

    Thank you
    Pradeep

  • Need to query to find stored procedures that takes great execution time

    Hi all

    I use the oracle version below:

    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    is it possible to find the name of stored procedure that take too long to run, I need those optimized all SPs.

    Is there a query as top queries that are used to find queries albums that have great time for execution...

    or y at - it another way to find the names of MS. I try with AWR report but showing only used the names of MS.

    Thank you

    No, it not there no such request as far as I know.

    or y at - it another way to find the names of MS.

    Just listen to complaints from the user...

  • When I opened my project and it is unable to locate the files. I find the files that are 'missing' and open the project.

    Hi im quite new for first pro and I'm having a problem when I opened my project and it is unable to locate the files. I find the files that are 'missing' and open the project. Everytime I open the project everything I see is all that media have these red, pink, blue, green, yellow lines, where pictures should be. And there is also the title of my pictures in the upper left corner. No one knows what it is and how I could fix this?

    [title published by mod]

    [Please do not double post, deleted the other]

    Right-click on the images in the project window: recharge or replace it.

  • Is it possible to find all photos that are not in a collection?

    Is it possible to find all photos that are not in a collection? I want to find images that do not already belong to a specific collection, but should.

    Hi blue,

    Please take a look at the article, it should be useful: http://www.lightroomsecrets.com/blog/2008/01/selecting-images-not-in-a-collection

    Kind regards

    Tanuj

  • Unable to find the models that are supposed to come with...

    Cannot find the models that are supposed to come with Dreamweaver.

    On this page: http://www.adobe.com/devnet/dreamweaver/articles/css_page_layout_basics.html
    It is said to "Dreamweaver makes it easy for you to build pages with CSS layouts by providing over 30 predefined page layouts that work in different browsers."

    Where are they? I have the CS3 and CS4 Design Premium. I'm trying to dig deeper in the CSS by using some of the tutorials. These models would be helpful. :)

    I think I found them. We find them by going to 'new document '. Sorry ' end that.

  • SQL queries that are stored in an array of sql pl

    I wonder if it is possible to have the SQL queries stored in a table in Oracle DB? I searched in google, but it seems that I'm bad key words to find the answer.

    I am trying to build sql queries in a certain place as a package or a procedure, and the logic would be completely out of the object sql queries in a table and the table to run each sql query in a loop.

    The version of oracle database is 11g.

    Thank you
    Martine

    Martine wrote:
    I see. I thought this would be a common practice. Thanks for your comments.

    Oh don't get me wrong... This is quite common.

    Makes him no better good :) It is not yet the "right" way to do things in 95% of the places that he did.

  • How can I find the images that are not in the catalogue?

    I imported about 600 photos of a friend of Wakeboarding in Lightroom. I then analyzed quickly through them and remove those who were not good.

    I wanted to delete these photos in the album. However, in about 10 cases I accidentally their removed from the catalog, not from disk.

    All photos of the wakeboard are in the same folder; There are no other images in this folder.

    Is there a way to find out what images are in this folder, but are not in the Lightroom Catalog?

    Rotaluclac

    Probably the easiest way would be to reimport them in their folder (make sure that the box Import suspected duplicates is enabled).

    Those who imported will be reflected in import previous "collection." In the grid view, select all and press the delete key. Click the appropriate button on the box that appears.

    HAL

  • Find the columns that are partitioned.

    Hello guys,.

    use views DBA_TAB_PARTITIONS, USER_TAB_PARTITIONS, ALL_TAB_PARTITIONS, we can find what are the partition names, number of rows in each partition etc. How we can find on the columns that are partitioned. I tried, but couldn't. help please.

    user_part_key_columns

  • How to find the media that are listed under the heading "Current project" but is no longer used in the timeline?

    Good day everyone.

    Been working on a fun project for a while now and overtime, I added the audio, images and YouTube videos in my project that later, I decided not to use in the timeline panel.  These media (for example, a specific song or image) are always loaded when I load the project and are included in the assets of the project, of course.  The reason being, I never deleted from the project.

    Now, I probably have about 30 to 40 cases.  It is time to clean house and I want to know if there is a command or a way to get the first (ss12) to highlight, gold banner somehow let me know which media, well listed and loaded, is not used in the timeline panel.

    Any chance this feature exist?

    Best.

    Love_Green_Turtles

    For your consideration... Try on a new mini test project before using it on a project of 'true '...

    Open an active project

    Click on the Options tab of Control Panel

    In the Panel Options Select display

    Select in the List View view

    In list view all files that are in the current project and the timeline will have a green dot in the used column.

    If you delete a file from the timeline, the green dot next to the involved file will disappear.

    You should be able to go through the list of assets/open project view and clear all entries that do not have a green dot next to them.

    Another safety net to consider... make a copy of the 'real' project and try the above on the copy.

    Please let us know if we have targeted your question and if the works above for you.

    Thank you.

    RTA

  • Cannot find the songs that are on my ipod on itunes

    I see them on my ipod and I can play them, but when I sync it with itunes I can't find certain songs in my music library.  I deleted them at some point because I'm trying to get them OFF my ipod, but after that I removed the iTunes and sync my ipod they songs always stayed on my ipod.

    Copy of sync from the computer to the device, it is not copy content off the coast. If they're iTunes purchases, you should be able to copy their return via file > devices > transfer purchases

  • Cannot find my apps that are hidden

    Cannot find my games and apps on my iPad

    Hello

    Be they in nested folders.

    You can use Spotlight to search for items on your iPad.

    1. Of any page of your iPhone or iPad home screen, tap the screen with your finger and slide down to reveal the Spotlight search field.
    2. Type what you are looking for and click search.
  • How to find the queries that I've already posted

    How to find previously posted queries?

    osxYosemite10

    Click / tap your user name, and then on the tab "Content" as below.

    RADSTOCK

  • Query to find data conneting that intersect each other.

    Hello

    I have a table like road_point_ids (script is below). Basically, this table have road_id with its start and its end point.

    I'm looking for a query that actually will connect each ID path beginning or end points.

    create the table road_point_ids

    (

    road_id number (10),

    start_point number (10),

    Number of end_point (10)

    );

    insert into road_point_ids

    values (1001, 10, 20);

    insert into road_point_ids

    values (1002, 20, 30);

    insert into road_point_ids

    values (1003, 30, 40);

    insert into road_point_ids

    values (1004, 40, 50);

    insert into road_point_ids

    values (1005, 50, 10);

    insert into road_point_ids

    values (1006, 70, 75);

    insert into road_point_ids

    values (1007, 30, 50);

    insert into road_point_ids

    values (1008, 10, 40);

    insert into road_point_ids

    values (1009, 80, 70);

    insert into road_point_ids

    values (1010, 90, 95);

    insert into road_point_ids

    values (1011, 50, 60);


    commit;

    SQL > select * from road_point_ids by 2;

    ROAD_ID START_POINT END_POINT

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

    1001               10                    20

    1008               10                    40

    1002               20                    30

    1007               30                    50

    1003               30                    40

    1004               40                    50

    1011               50                    60

    1005               50                    10

    1006               70                    75

    1009               80                    70

    1010               90                    95

    11 selected lines

    In the example above only seven road_ids intersect at TWO points corresponding to start or end point.

    Output desired must be as...

    ROAD_IDSTART_POINTEND_POINT
    10011020
    10022030
    10033040
    10044050
    10055010
    10073050
    10081040

    7 selected lines

    I tried to use a lot of operator AND with the OR operator but sent to an incorrect result. Could someone provide me please help.

    Thanks in advance

    Saaz

    Hi, Saaz,

    How is this problem differs from your original problem?

    If it's just that the data is now contained in 2 tables (a few lines in a table, a few lines in the other) instead of a table, you can change my original solution by using a UNION to combine the two tables into one:

    WITH road_point_ids AS

    (

    SELECT road_id, start_point, end_point OF road_point_ids_1 UNION ALL

    SELECT road_id, start_point, end_point FROM road_point_ids_2

    )

    SELECT DISTINCT road_id, start_point, end_point

    OF road_point_ids

    WHERE CONNECT_BY_ISCYCLE = 1

    CONNECT BY NOCYCLE start_point = PRIOR end_point

    ;

    The WITH clause is new; the main request is that I posted earlier.

  • How to find the tables that are used in a procedure

    Hello
    I need to write a SQL to find (user_source) procedures or triggers (from user_triggers), whose code contains the registerd tables in a table X.
    In other words, I have a table X with files having a column containing tables. I want to write a SQL to obtain these (proc, package and triggers) container objects or use the tables inside
    Can you help me?
    Thank you!

    Mark1970 wrote:
    Hello
    I need to write a SQL to find (user_source) procedures or triggers (from user_triggers), whose code contains the registerd tables in a table X.
    In other words, I have a table X with files having a column containing tables. I want to write a SQL to obtain these (proc, package and triggers) container objects or use the tables inside
    Can you help me?
    Thank you!

    I don't know if I understand your problem, but have you had a glance at the data dictionary views USER_DEPENDENCIES or ALL_DEPENDENCIES?

    It has classified hard dependencies of objects.
    If a table is used directly (not in dynamic SQL code in a string) in an object PL/SQL, the dependency is available in the stated points of view.

Maybe you are looking for

  • Hi, can export you emails from the other Thunderbird e-mail client?

    Hello I am currently using incredimail but unhappy with it. Can I import all my emails from it for Thunderbird? I use the desktop with windows 7.Thank you.

  • Should we care AceDeceiver Malware?

    Should I be concerned that a Malware called seductive ACE?

  • Connection Wifi Brighthouse problems

    I always have problems connecting to the messaging with Brighthouse Wifi.  I got my Gmail put in place with other providers of Internet services in other places, but it may take 15-20 minutes to connect with Brighthouse - if it connects to all.  Anyo

  • "Backup file" appears in the title bar.

    Hello I've written a VI that crashed recently, but I could get it back using the backup file. However 'Backup file' now appears in the title as shown in the picture bar, I have attached with this post and I would like to get rid of the 'Backup' file

  • CANNOT install sp3 in windows xp HELP.

    I can't install the sp3 for windows xp, when I try to install and reboot a black screen appears with, various messages to, starting in the last known configuration starting in the last known good configuration, start with network etc etc, I have to u