the longest query

Hello

on 11.2.0.4, SE1 (then no CWA) on Win 2008

I'm looking for the longest query.

Can you help me find out who?

I have the following, but I'm not sure what (I'm lost between time and DB):

SELECT * FROM

(SELECT last_load_time, round ((CPU_TIME/executions)) MEAN_TIME, sql_text FROM V$ SQLAREA WHERE)

last_load_time >

SYSDATE - 30 and executions! = 0 and UPPER (PARSING_SCHEMA_NAME) = "SYSADM".

ORDER BY MEAN_TIME DESC)

WHERE rownum < = 10

Thank you.

Hi Francois,.

really thank you. I'll try your query.

Kind regards.

Tags: Database

Similar Questions

  • How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    See if this application works for you > https://itunes.apple.com/us/app/image-size/id670766542?mt=8

  • My safari has locked up with a request for verification of the property query.  What can be done to fix this?

    My safari has locked up with a request for verification of the property query.  What can be done to fix this?

    This is the shit that came.

    Force Quit Safari (cmd-option-esc) then restart Safari by holding down the SHIFT key.

    Sorry, wrong forum... question thought it was an OS X. In any case don't give them any info.

  • find the longest series of equal values in table

    Hello

    I had an array with Boolean values, something like this

    [TTFFFFFFFFFFFFTTFFTTT]

    and I need to find the longest window were the elements of the array is equal, in the above example, I want to find the index 2 and length 12 for longer window F and index 18, length 3 to T. everyone who has an idea how I can do this?

    Hello Tudor,

    There is so far, I don't know any loan service in labview to do what you want. However this seems not really hard to do.

    You can link your table for a loop and to compare with each iteration, the current Boolean value to the previous. If the two are combined, for example, you can increment a counter until one is true and the other false. Then you can record the length in a separate shift register if this length is greater than pre-existing (initialize to 0).

    On the index, you can save the terminal in the County of the foor in a turn loop register when the value N-1 of your table is different from the value of N, the following difference, if the length is the longest, you save this count minus one in another register.

    I hipe this helps you.

    Concerning

  • What is the longest cable that you can use for a webcam If you want to move a piece

    What is the longest cable that you can use for a webcam If you want to move a room, you want to use as a granny cam

    I get up to a cable of length more camera more and then peripheral is not is not recognized. I Yawcam program on my computer which is optimal

    for a web camera to use invisably.

    According to the official FAQ USB. page here:

    http://www.usb.org/developers/usbfaq#cab1 ,

    5 m is the maximum length of a USB cable. A lot of points 3 and 4 on the above page dealing with how to deal with scenarios beyond this length.

    Personally, I have only ever went up to 4.8 m and it was with an external hard drive (which had its own separate power supply).

  • When I pull the select query, but therefore cannot get the data that you check?

    Hello

    When I raised this query without get data then can you help me it's ok?

    DataSource {
                            id: durgSearch_dataSource
                            source: "sql/durg.db"
                            query: "select * from durg_detail where durg_name =" + "\"" + searchTextField.text + "\""
                            onDataLoaded: {
                                durgSearch_dataModel.insertList(data);
                            }
                        }
    

    Glance. I just tested your app and it works correctly. I entered Rock and search button and it returns a Rock record. If you want to get all records that contain a particular letter or Word, you can use the following query:

    "select * from medicin_detail where PharmacyName LIKE '%" + searchTextField.text + "%'"
    
  • Bills of the AP - query gives output in the editor, but no data found when run from a workflow

    Hello

    I am working on a custom workflow related to invoices from the AP and I came across this very odd situation where the below query works perfectly well by operating in any PL/SQL as Toad/SQL Developer editor but when run in an Oracle Workflow custom, the query raises an exception NO_DATA_FOUND.

    I set debugging instructions to capture the values of the parameters (lv_invoice_id and lv_hold_id being retrieved workflow attributes) before and after the SELECT statement and noticed that the values of the parameters are set correctly.

    SELECT type

    IN lv_match_type

    DE ap_invoices_all aia , ap_invoice_lines_all Arnaud , ap_holds_all aha

    ail . invoice_id = lv_invoice_id

    ET line_type_lookup_code = "ITEM"

    ET AIA . invoice_id = garlic . invoice_id

    ET AHA . invoice_id = AIA . invoice_id

    ET AHA . hold_id = lv_hold_id

    ET ROWNUM = 1 ;

    Can anyone suggest what could be wrong with that? Having spent 2 days trying to debug this but without success.

    Any help would be greatly appreciated.

    I added a function of the WorkflowTimeout JOB just before function which becomes the flag Match, and it worked. It appears like the workflow engine is somehow unable to assign values to the query. Putting a WAIT, he probably gave the workflow a second to assign variables with values. Seems very strange, but seems to have solved the problem. Do thorough tests to confirm that it does not break something else. Mike - appreciate all your help with this post until now. You were very prompt in answering my questions. Appreciate it.

  • Add the text of the sql query

    query:

    Select 'COL ' | column_id | ' AS', column_name | ',' from all_tab_columns

    where table_name = 'EMP '.

    order of column_id

    for the output of the above query, I need to add Select at the beginning and removal of , for the last line of the output of the query so the addition of the EMP at the end of the output of the query

    Hello

    do you mean like this

    select
      'SELECT '
      || listagg(column_name ||' AS ' || 'COL' || column_id, ', ' || chr(10)) within group (order by column_id)
      || ' FROM ' || table_name sql
    from all_tab_columns
    where table_name='EMP' and owner = 'SCOTT'
    group by table_name
    ;
    
    SQL
    --------------------------------------------------------------------------------
    SELECT EMPNO AS COL1,
    ENAME AS COL2,
    JOB AS COL3,
    MGR AS COL4,
    HIREDATE AS COL5,
    SAL AS COL6,
    COMM AS COL7,
    DEPTNO AS COL8 FROM EMP
    

    Where you need this kind of logic?

  • Classic report shows wrong "could not parse the SQL query: ORA-00942" error after migrating app to the new environment

    After migrating my APEX 4.1 application to a new environment, one classic report displays a "cannot parse the SQL query: ORA-00942: table or view does not exist" error when the page is displayed. Change the region to report SQL source to somehow (e.g., remove spaces, changing the order of the variables in the WHERE clause) immediately solves the problem, but by returning to the source of the region causes the report error again (the source region valid code without error, however).

    Throw the error message:

    Select v.id,

    v.Col1

    of view_vw v

    where (: P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Do not throw error:

    Select v.id,

    v.Col1

    of view_vw v

    where (:P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Changing the order of column in the report has the same effect; i.e. He arranges, but return back to the original column order causes the error to display.

    It's as if a cached result for the correct select statement used by the report is displayed. However, the application does not use the caching of page/region. Any ideas of what could be the cause?

    He solved. Ultimately, all that was necessary was to clear the DB cache using:

    alter system flush shared_pool;

  • java.lang.NullPointerException when you click on the search query

    java.lang.NullPointerException when you click on the search query:

    There is nothing my project involved code...

    at oracle.adf.model.binding.DCControlBinding.reportException(DCControlBinding.java:201)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.findAttributeDef(JUCtrlValueBinding.java:632)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.findAttributeDef(JUCtrlValueBinding.java:597)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttribute(JUCtrlValueBinding.java:1341)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfAttributeDescriptor.isRequired(FacesCtrlSearchBinding.java:3018)
    at oracle.adfinternal.view.faces.renderkit.rich.query.QueryBehavior.shouldShowInstructionText(QueryBehavior.java:66)
    at oracle.adfinternal.view.faces.renderkit.rich.query.QueryBehavior.refreshInfoFacet(QueryBehavior.java:37)
    at oracle.adfinternal.view.faces.renderkit.rich.QueryRenderer.renderContentRow(QueryRenderer.java:718)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.encodeAll(PanelHeaderRenderer.java:231)
    at
    
    

    Cvele_new_account, good point.

    Maybe you can try to remove the af: query to the page, and then drop it again.

  • Table error ' can not analyze the SQL query!

    Hi all

    I created a view on my database called VIEW_MEMBER_PARTIC_PROJECTS

    If I run a query showing the results of the view:

    SELECT * FROM VIEW_MEMBER_PARTIC_PROJECTS

    I get the following data

    ProjectsParticipants
    131 S
    241
    319
    43
    53
    61
    72

    Now, I wanted to represent this diagram in the APEX so I created a graphic region and entered the Source query generator and the manufacturer produces the following code

    Select null, label projects, value1 Participant link

    of "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    With this code, I get an error:

    Cannot parse the SQL query!

    Select the link null, label projects, value1 "SCHEMANAME Participant." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    Some queries can be run when you run your application, if your query is syntactically correct, you can save your query without validation (see options below the source of the query).

    The code looks OK, but I do not see to save options as the error code is mentioned.

    No one knows how to fix this?

    Thank you

    JaReg wrote:

    I finally found the problem.

    I looked at the code for the view and changed the start of:

    CREATE OR REPLACE FORCE EDITIONABLE VIEW "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS "("Participant","Projects")

    AS

    TO

    CREATE OR REPLACE VIEW "SCHEMANAME." "" VIEW_REPEAT_PARATIC ".

    AS

    And that seemed to fix it. I'm not entirely sure why though.

    The view was created using the quoted identifiers for column names. This makes them sensitive and means that they must always be referenced using double quotes. In the absence of quotation marks, Oracle is not case insensitive and automatically converts all uppercase identifiers. The application of graph:

    Select the link null, label projects, value1 "SCHEMANAME Participant." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    has therefore been interpreted by Oracle:

    SELECT THE LINK NULL, LABEL, VALUE1 "SCHEMANAME PARTICIPANT PROJECTS." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    and PROJECTS and PARTICIPANT columns were not recognized because the columns defined for the view have been 'Participant' and 'projects '. The graphic request should have been:

    Select the link null, the label of "Projects", "Participant" value1 "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    As you have now discovered, quoted identifiers are a source of nothing but obscure bugs and should never be used for database objects. He also pointed out the reason why you should always use a standardized, form tiny, coding style as it is faster to type, easy to read and less prone to errors.

  • How to override the default styleClass for the af:query component?

    In my entire application, I disabled the labels selectOneChoice and selectOneRadio using the default style class,

    TD.af_selectOneChoice_label > label, td.af_selectOneRadio_label > label {}

    display: none;

    }

    Now, for af:query component, I need to display the label. How to replace the above-mentioned styleclass? My version of jdev is 11.1.1.7.0

    Try this-

    AF | {selectOneChoice::label}

    display: none;

    }

    This hides the label of choice list all except those who are inside the af: query


    Ashish

  • Collection of the dynamic query

    Hi All-

    I'm trying to get the value of the collection through the dynamic query but I am facing some problem please let me know that I hurt.

    Created a function like below to run the dynamic query to select statement

    create or replace FUNCTION rfunGetColumnValue (
                  ColumnName VARCHAR2,
                  TableName  VARCHAR2,
                  DefaultValue OUT VARCHAR2,
                  Criteria VARCHAR2)
           RETURN VARCHAR2
    IS
           ReturnValue VARCHAR2 (32767 byte) ;
           Stmt        VARCHAR2 (32767 byte) ;
    BEGIN
           stmt := 'begin        
    select '|| ColumnName || ' into  :1  from table(:2) ' ||NVL
           ( Criteria, ' ') ||
           '       
    Fetch First Row only ;        
    EXCEPTION                                   
    WHEN OTHERS THEN                                          
    :2 := SQLERRM;
    end;'
           ;
           dbms_output.put_line (stmt) ;
           EXECUTE IMMEDIATE stmt USING OUT ReturnValue, OUT DefaultValue;
           --select Valueinto into Returnvalue from dual;
           RETURN ReturnValue;
    END;
    

    Now, I created a folder in the Package

    create or replace PACKAGE Collection_PKG
    is
    type Bank_rec is RECORD
    (
    SNO           NUMBER(10),    
    BANKID        NUMBER(5),    
    BANKNAME       VARCHAR2(50),    
    BANKSC         VARCHAR2(50),    
    ADDEDIT       varchar2(1),    
    COMPID        number(5),    
    ISBULK        number(1),    
    ROWNO         number(10),    
    ERROR         VARCHAR2(500)  
    );
    
    
    TYPE Bank_tbl IS TABLE OF Bank_rec;
    --type Bank_cur is ref cursor return Bank_rec;
    
    
    end Collection_PKG;
    
    end Collection_PKG;
    end Collec
    tion_PKG;
    

    Now, when I'm Trying the code below

    DECLARE
      V_EXECQUERYPARAM XMLTYPE:= XMLTYPE('<QueryParam>
      <BankXML>
        <Bank>
          <BankID>0</BankID>
          <BankSC><![CDATA[RCB]]></BankSC>
          <BankName><![CDATA[Royal challenger Bank]]></BankName>
          <IsBulk>0</IsBulk>
          <AddEdit>A</AddEdit>
        </Bank>
      </BankXML>
    </QueryParam>');
    BEGIN
     Rspbanksave(
        v_SPParamList => V_EXECQUERYPARAM  );
    
    
    END; 
    

    create or replace PROCEDURE rspBankSave (
                  v_SPParamList XMLTYPE DEFAULT NULL)
    IS
           V_Addedit VARCHAR2 (1 CHAR) ;
           Bank_tbl Collection_PKG.BANK_TBL := Collection_PKG.BANK_TBL () ;
    BEGIN
           
           SELECT Row_number () OVER (ORDER BY 1),
                  XT.BankID,
                  XT.BankName,
                  XT.BankSC,
                  XT.AddEdit,
                  v_CompID,
                  XT.IsBulk,
                  CAST (0 AS NUMBER (5)),
                  CASE
                         WHEN MBank.BankID IS NOT NULL
                         THEN
                                CASE
                                       WHEN XT.BankSC     = MBank.BankSC
                                          AND XT.BankName = MBank.BankName
                                       THEN 'R104|Entry Already Exist,R114|Short Code Already Exist'
                                       WHEN XT.BankSC = MBank.BankSC
                                       THEN 'R114|Short Code Already Exist'
                                       WHEN XT.BankName = MBank.BankName
                                       THEN 'R104|Entry Already Exist'
                                END
                         ELSE NULL
                  END Bulk collect
           INTO   Bank_tbl
           FROM   XMLTABLE ('//QueryParam/BankXML/Bank' PASSING v_SPParamList COLUMNS BankID NUMBER (5)
                  PATH 'BankID', BankName                                                    VARCHAR2 (
                  50) PATH 'BankName', BankSC                                                VARCHAR2 (
                  50) PATH 'BankSC', AddEdit                                                 VARCHAR2 (
                  1) PATH 'AddEdit', IsBulk                                                  NUMBER (1)
                  PATH 'IsBulk') XT
           LEFT JOIN MBank
           ON     XT.BankID   != MBank.BankID
              AND v_CompID     = MBank.CompID
              AND (XT.BankSC   = MBank.BankSC
               OR XT.BankName  = MBank.BankName) ;
           v_TotalRowCount    := SQL%ROWCOUNT;
    
    
    
    
    
    
           IF (v_TotalRowCount > 0) THEN
                  
                         BEGIN
                               V_Addedit:=rfunGetColumnValue (ColumnName=> 'Upper(AddEdit)',TableName=>'table(Bank_tbl)',DefaultValue=>'',Criteria =>'');
                         END;
                         --SQL Code here
                  
           END IF;
           
    END rspBankSave;
    
    
    
    
    
    
    
    

    As I've suggested before:

    To get the name of the table the column

    and as others have:

    Type global temporary Tables vs. table

    If you give more context, more information about the bigger picture, more information about what you're trying to do and why you're going down the road you go down, you can return more useful information. But you seem reluctant to do.

    For the moment, your recent posts seem to just raise the same type of question - why are you doing this?

    The normal way to return data to a client is a refcursor.

    It is the most effective way.

    Not through collections that you seem to be put on the must-do approach.

  • How to avoid the report query needs a unique key to identify each line

    Hello

    How to avoid the error below

    The report query needs a unique key to identify each row. The supplied key cannot be used for this query. Please change the report attributes to define a unique key column.

    I have master-detail tables but without constraints, when I created a query as dept, emp table he gave me above the error.

    Select d.deptno, e.ename

    by d, e emp dept

    where e.deptno = d.deptno

    Thank you and best regards,

    Ashish

    Hi mickael,.

    Work on interactive report?

    You must set the column link (in the attributes report) to something other than "link to display single line." You can set it to 'Exclude the column link' or 'target link to Custom.

  • How to call the &lt; af:query &gt; Search feature by clicking on an image?

    Hi all

    I created a test named and I dragged on my page .jspx as "ADF with Table query Panel. I put the display as 'Simple' Mode in the Properties Inspector, who will hide all the default components of < af:query >. Now I use < af:commandImageLink >. My question is how can I call the < af:query > Search feature when the user clicks on an image? Any suggestion would be appreciated.

    Thank U...

    If you want to invoke af:query search by program button, follow these steps:

    1 Select af:query--> Advanced--> connections and bind it to the back bean

      
    

    2. in the .jspx add af:link like this:

    
              
    
    

    3 - runQuerySearchAction should be like this:

      public String runQuerySearchAction()
      {
        QueryDescriptor queryDescriptor = getRichQuery().getValue();
        QueryEvent queryEvent = new QueryEvent(getRichQuery(), queryDescriptor);
        queryEvent.setPhaseId(PhaseId.INVOKE_APPLICATION);
        getRichQuery().queueEvent(queryEvent);
        return null;
      }
    

Maybe you are looking for