Query taking too much time when running through discover

Hi
I have created report with sql query by creating custom folder in oracle discover desktop. Query is using parameter with sys_context. When report is executed from discover it takes more than 5 minutes and same query is executed in 30 seconds when executed in database through toad.
Pls. let me know what could be the reason for this?
Thanks

Hi,
The first thing to check is whether the query is running to completion in TOAD. By default, TOAD just selects the first 50 rows, where as Discoverer must return all the rows before displaying results if a crosstab report is used.
Secondly, check that the queries and the explain plans are the same in Discoverer and Toad. Although, Discoverer shows the SQL in the SQL inspector this isn't necessarily the SQL actually sent to the database. Use TOAD to interogate the Discoverer session to determine the actual SQL and compare this SQL and explain plan to SQL you ran in TOAD.
Thirdly, check that the session context is the same in both cases. So check that any custom contexts and the USER_ENV context is the same, and if any security packages or VPD policies are used in the SQL that these have been initialised the same.
If you still cannot determine the difference then trace both sessions.
Rod West

Similar Messages

  • Report is taking too much time when running from parameter form

    Dear All
    I have developed report in oracle reports bulider 10g. while running it from report builder data is coming very fast.
    But, If it is running from parameter form it is taking too much time to format report in PDF.
    Please suggest any configuration or setting if anybody is having Idea.
    Thanks

    Hi,
    The first thing to check is whether the query is running to completion in TOAD. By default, TOAD just selects the first 50 rows, where as Discoverer must return all the rows before displaying results if a crosstab report is used.
    Secondly, check that the queries and the explain plans are the same in Discoverer and Toad. Although, Discoverer shows the SQL in the SQL inspector this isn't necessarily the SQL actually sent to the database. Use TOAD to interogate the Discoverer session to determine the actual SQL and compare this SQL and explain plan to SQL you ran in TOAD.
    Thirdly, check that the session context is the same in both cases. So check that any custom contexts and the USER_ENV context is the same, and if any security packages or VPD policies are used in the SQL that these have been initialised the same.
    If you still cannot determine the difference then trace both sessions.
    Rod West

  • Simple APD is taking too much time in running

    Hi All,
    We have one APD created on our developement system which is taking too much time in running.
    This APD is fetching data from a Query having only 1200 records and directly putting into a master attribute.
    The Query is running fine in RSRT transaction and giving output within 5 seconds but in APD if I do display data over Query it is taking too much time.
    The APD is taking arrount 1.20 hours in running.
    Thanks in advance!!

    Hi,
    When a query runs in APD it normally takes much, much longer than it takes in RSRT. Run times such as what you are saying (5secs in RSRT and >1.5 hrs in APD) are quite normal; I've seen them in some of my queries running for several hours in APD as well.
    You just have to wait for it to complete.
    Regards,
    Suhas

  • Delete query taking too much time

    Hi All,
    my delete query is taking too much time. around 1hr 30 min for 1.5 lac records.
    Though I have dropped mv log on the table & disabled all the triggers on it.
    Moreover deletion is based on primary key .
    delete from table_name where primary_key in (values)
    above is dummy format of my query.
    can anyone please tell me what could be other reason that query is performing that slow.
    Is there anything to check in DB other than triggers,mv log,constraints in order to improve the performance?
    Please reply asap.

    Delete is the most time consuming operation, as the whole record data has to be stored at the undo segments. On the other hand, there is a part of the query used to select records to delete that probably is adding an extra overhead to the process, the in (values) clause. It would be nice on your side to post another dummy from this (values) clause. I could figure out this is a subquery, and in order for you to obtain this list you have to run a inefficient query.
    You can gather the execution plan so you can see where the most heavy part of th query is. This way a better tuning approach and a more accurate diagnostic can be issued.
    ~ Madrid.

  • Query taking too much time with dates??

    hello folks,
    I am trying pull some data using the date condition and for somereason its taking too much time to return the data
       and trunc(al.activity_date) = TRUNC (SYSDATE, 'DD') - 1     --If i use this its takes too much time
      and al.activity_date >= to_date('20101123 000000', 'YYYYMMDD HH24MISS')
       and al.activity_date <= to_date('20101123 235959', 'YYYYMMDD HH24MISS') -- If i use this it returns the data in a second. why is that?
    How do i get the previous day without using the hardcoded to_date('20101123 000000', 'YYYYMMDD HH24MISS'), if i need to retrieve it faster??

    Presumably you've got an index on activity_date.
    If you apply a function like TRUNC to activity_date, you can no longer use the index.
    Post execution plans to verify.
    and al.activity_date >= TRUNC (SYSDATE, 'DD') - 1
    and al.activity_date < TRUNC (SYSDATE, 'DD')

  • Why is query taking too much time ?

    Hi gurus,
    I have a table name test which has 100000 records in it,now the question i like to ask is.
    when i query select * from test ; no proble with responce time, but when the next day i fire the above query it is taking too much of time say 3 times.i would also like to tell you that everything is ok in respect of tuning,the db is properly tuned, network is tuned properly. what could be the hurting factor here ??
    take care
    All expertise.

    Here is a small test on my windows PC.
    oracle 9i Rel1.
    Table : emp_test
    number of records : 42k
    set autot trace exp stat
    15:29:13 jaffar@PRIMEDB> select * from emp_test;
    41665 rows selected.
    Elapsed: 00:00:02.06 ==> response time.
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=24 Card=41665 Bytes=916630)
    1 0 TABLE ACCESS (FULL) OF 'EMP_TEST' (Cost=24 Card=41665 Bytes=916630)
    Statistics
    0 recursive calls
    0 db block gets
    2951 consistent gets
    178 physical reads
    0 redo size
    1268062 bytes sent via SQL*Net to client
    31050 bytes received via SQL*Net from client
    2779 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    41665 rows processed
    15:29:40 jaffar@PRIMEDB> delete from emp_test where deptno = 10;
    24998 rows deleted.
    Elapsed: 00:00:10.06
    15:31:19 jaffar@PRIMEDB> select * from emp_test;
    16667 rows selected.
    Elapsed: 00:00:00.09 ==> response time
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=24 Card=41665 Bytes=916630)
    1 0 TABLE ACCESS (FULL) OF 'EMP_TEST' (Cost=24 Card=41665 Bytes=916630)
    Statistics
    0 recursive calls
    0 db block gets
    1289 consistent gets
    0 physical reads
    0 redo size
    218615 bytes sent via SQL*Net to client
    12724 bytes received via SQL*Net from client
    1113 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    16667 rows processed

  • Query taking too much time!!!!!

    Sorry for posting without format. I will post an another question with the use of your format blog.
    Edited by: San on 22 Feb, 2011 3:18 PM

    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting

  • Crystal Report Query taking too much time

    Hi,
    We are developing one report based on SQL Server 2008 in Crystal Report. There are around 50,000 valid combination in database. Based on dynamic filter we need to bring few records in report. Since these filters are at report level, and crystal report is using microcube, it is taking more than 15 mins to execute.
    Is there any option to fetch record based on filter applied at report level.
    Regards
    Baby

    HI,
    First of all , thank you very much.
    Since having cascading prompt, we never thought in this way.
    Details:-
    For our report we have 4 prompts.
    1. category->family-brand (cascading- mandatory)
    2. season(madatory)
    3.collection (madatory)
    4.owner(not mandatory)
    previously we set all these filters at record level.
    Now we set season and collection at query level and brand, owner at report level. Report only query for selected season and collection only.
    Thanks once again.
    Regards
    Baby

  • 0HR_PT_3 Load is taking too much time when i execute the Info package

    Dear All,
    i am working on HR Module.
    i am extracting data from 0HR_PT_3 from R/3 PRD system through info package its taking long time to load data.
    I have checked in RSA3 in R/3 PRD system whenever i extract "0HR_PT_3"  instead of showing records  its showing this error message "Infotype 2002 not read due to lack of authorization" .
    could you please let me know any one have resolve this issue.
    Thanks,
    Venkat.
    Edited by: venkatnaresh7 on Jul 12, 2011 11:49 AM

    hi
    I am facing same issue. did you able to fix this?

  • Insert Query taking too much time (5 hrs)

    Hi experts,
    We are using "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi" on our server, and we are trying to execute the SQL script which inserts data into a table from 5 different table.
    Note: The SQL query is been passed directly to the server.
    Need your expertise as to what is causing the script to run so slow.....(It's taking around 5 hrs to execute the script).
    The Script is as follow's;
    Insert /*+ append */ into TABLE1 NOLOGGING
    SELECT DISTINCT /*+ PARALLEL(TABLE1, 4) */ ROW_NUMBER() OVER
    (ORDER BY COL1, COL2, COL3, COL4, COL5, COL6, COL7, COL8, COL9) AS PK_ID, TABLE1.COL1 AS PRODUCT_ID, TABLE1.M_NBR AS M_NBR, TABLE1.P_NBR AS P_NBR, TABLE1.C_ID AS C_ID, TABLE1.TABLE1_SERV_DT AS TABLE1_SERV_DT, TABLE1.C_KEY AS C_KEY, TABLE1.C_DEN AS C_DEN, TABLE1.A_S_DT AS A_S_DT,
    TABLE1.F_ID AS F_ID, TABLE1.L_DT AS L_DT, TABLE1.A_DT AS A_DT, TABLE1.D_DT AS D_DT, TABLE1.C_TYPE AS C_TYPE,
    TABLE1.S_COL AS S_COL, TABLE1.S_TBL AS S_TBL, TABLE4.ME AS ME, TABLE1.ER_YN AS ER_YN
    FROM
    TABLE1,
    TABLE2,
    TABLE3,
    TABLE4,
    TABLE5
    WHERE
    TABLE1.COL1 = TABLE2.COL1
    AND
    TABLE1.COL2 = TABLE3.COL2
    AND
    TABLE1.COL3 = TABLE4.COL3
    AND
    (TABLE1.SERV_DT BETWEEN RY_START AND RY_END)
    AND
    (TABLE1.CLAIM = :"SYS_B_0")
    AND
    (TABLE2.INACTIVATED = :"SYS_B_1")
    AND
    (TABLE2.TABLE1 = :"SYS_B_2")
    AND
    (TABLE2.PRELIM = :"SYS_B_3")
    AND
    (TABLE3.MEASURE = :"SYS_B_4")
    AND
    (TABLE3.EVENTS = :"SYS_B_5");

    In addition to APC, here's some more on the subject:
    EXACT - (Default) Only statements with an exact text match will share the same SQL area.
    SIMILAR - Oracle will substitute bind variable for all literals, thereby increasing the chances of a text match. Oracle will force similar statements to share the SQL area without deteriorating execution plans.
    FORCE - The same as SIMILAR except that execution plans may deteriorate. This option should only be used if the risk of suboptimal plans is outweighed by the increase in cursor sharing .
    Summary from:
    http://www.oracle-base.com/articles/9i/performance-enhancements-9i.php#CursorSharing
    In-depth:
    http://www.oracle.com/technetwork/issue-archive/2006/06-jan/o16asktom-101983.html
    and you can search the docs @ http://www.oracle.com/pls/db112/homepage for more.
    Hope your DBA and you can fix it.
    Keep us posted.

  • Partition Table Query taking Too Much Time

    I have created partition table and Created local partition index on a column whose datatype is DATE.
    Now when I Query table and use index column in the where clause It is scaning all the table (Full scan) . The quey is :
    Select * From mytable
    where to_char(transaction_date, 'DD-MON-YY') = '01-Aug-07';
    I have to use to_char function not to_date due to Front end application problem.

    Before we go too far with this, if you manually query with TO_DATE on the variable instead of TO_CHAR on the column, does the query actually use the index?
    The TO_CHAR on the column will definitely stop Oracle from using any index on the column. If the query will use the index if you TO_DATE the variable, as I see it, you have three options. First, fix the application problem that won't let you use TO_DATE from the application. Second, change the application to call a function returning a ref cursor, get the date string as a parameter to the function, and do the TO_DATE in the function.
    Third, you could consider creating a function-based index on TO_CHAR(transaction_date, 'dd-Mon-yy'). This would be the least desirable option, particularly if you would also be selecting records based on a range of transaction_dates, since it loses a lot of information that the optimizer could use in devising an efficient query plan. It could also change your results for a range scan.
    John

  • Select query taking too much time to fetch data from pool table a005

    Dear all,
    I am using 2 pool table a005 and a006 in my program. I am using select query to fetch data from these table. i.e. example is mentioned below.
    select * from a005 into table t_a005 for all entries in it_itab
                       where vkorg in s_vkorg
                       and     matnr in  s_matnr
                       and     aplp   in  s_aplp
                       and     kmunh = it_itab-kmunh.
    here i can't create index also as tables are pool table...If there is any solutions , than please help me for same..
    Thanks ,

    it would be helpful to know what other fields are in the internal table you are using for the FOR ALL ENTRIES.
    In general, you should code the order of your fields in the select in the same order as they appear in the database.  If you do not have the top key field, then the entire database is read. If it's large then it's going to take a lot of time.  The more key fields from the beginning of the structure that you can supply at faster the retrieval.
    Regards,
    Brent

  • Catbundle.sql taking too much time while running it for CPU-April2011

    Hi ,
    I am on oracle 11.1.0.7.0 and I am applying the CPU patch April 2011.
    OS is Solaris SPARC.
    As part of that , i am running the catbundle.sql.
    currently , for last 180 mins , the catbundle.sql is at this state :
    SQL> PROMPT Processing Oracle Java Supplied Packages...
    Processing Oracle Java Supplied Packages...
    SQL> ALTER SESSION SET current_schema = sys;
    Session altered.
    SQL> @?/rdbms/admin/initcdc.sql
    SQL> Rem
    SQL> Rem $Header: initcdc.sql 15-mar-2006.08:20:07 mbrey Exp $
    SQL> Rem
    SQL> Rem initcdc.sql
    SQL> Rem
    SQL> Rem Copyright (c) 2000, 2006, Oracle. All rights reserved.
    SQL> Rem
    SQL> Rem    NAME
    SQL> Rem      initcdc.sql - script used to load CDC jar files into the database
    SQL> Rem
    SQL> Rem    DESCRIPTION
    SQL> Rem      <short description of component this file declares/defines>
    SQL> Rem
    SQL> Rem    NOTES
    SQL> Rem      script must be run as SYS
    SQL> Rem
    SQL> Rem    MODIFIED   (MM/DD/YY)
    SQL> Rem    mbrey       03/15/06 - bug 5092790 add datapump registration
    SQL> Rem    pabingha    02/25/03 - fix undoc interfaces
    SQL> Rem    wnorcott    03/14/02 - bug-2239726 disable triggers.
    SQL> Rem    wnorcott    01/31/02 - function 'active' return 0 or 1.
    SQL> Rem    wnorcott    01/30/02 - disable CDC triggers, CREATE_CHANGE_TABLE re-enables.
    SQL> Rem    wnorcott    06/26/01 - rid trailing slash.  As per Mark Jungermann
    SQL> Rem    gviswana    05/25/01 - CREATE OR REPLACE SYNONYM
    SQL> Rem    jgalanes    11/17/00 - for Import/Export grant execute on util to
    SQL> REM                           SELECT_CATLOG_ROLE
    SQL> Rem    wnorcott    09/07/00 - new loadjava syntax for performance.
    SQL> Rem    wnorcott    07/18/00 - rid LOGMNR_UID$.clientid
    SQL> Rem    wnorcott    06/28/00 - move logmnr_dict view here
    SQL> Rem    wnorcott    03/28/00 - fix trigger install
    SQL> Rem    wnorcott    03/27/00 - Install change table triggers
    SQL> Rem    mbrey       01/26/00 - script to load CDC jars
    SQL> Rem    mbrey       01/26/00 - Created
    SQL> Rem
    SQL> call sys.dbms_java.loadjava('-v -f -r -s -g public rdbms/jlib/CDC.jar');It has run the @?/rdbms/admin/initcdc.sql script and now its not proceeding next.. I am not sure if its stuck or still running.. How do i find that..
    what should i do ?
    *PS : Ive read this note :Script Fails At Loadjava With ORA-03113 and ORA-03114 [ID 358232.1] But its when it errors out , for me its not erroring out also..*
    Thanks
    Kk
    Edited by: Kk on May 25, 2011 2:41 AM

    just an update :
    I sat watching it for 3 hours.. then i though of stopping it.. pressed CTRL-Z and boom , it just took me to SQL showing that it had completed...
    So , if someone else faces this issue , press CTRL-Z after some 5-10 minutes it will show that its running well.
    Regards
    Kk
    Edited by: Kk on May 25, 2011 3:55 AM

  • Spatial query with sdo_aggregate_union taking too much time

    Hello friends,
    the following query taking too much time for execution.
    table1 contains around 2000 records.
    table2 contains 124 rows
    SELECT
    table1.id
    , table1.txt
    , table1.id2
    , table1.acti
    , table1.acti
    , table1.geom as geom
    FROM
    table1
    WHERE
    sdo_relate
    table1.geom,
    select sdo_aggr_union(sdoaggrtype(geom, 0.0005))
    from table2
    ,'mask=(ANYINTERACT) querytype=window'
    )='TRUE'
    I am new in spatial. trying to find out list of geometry which is fall within geometry stored in table2.
    Thanks

    Hi Thanks lot for your reply.
    But It is not require to use sdo_aggregate function to find out whether geomatry in one table is in other geomatry..
    Let me give you clear picture....
    What I trying to do is, tale1 contains list of all station (station information) of state and table2 contains list of area of city. So I want to find out station which is belonging to city.
    For this I thought to get aggregation union of city area and then check for any interaction of that final aggregation result with station geometry to check whether it is in city or not.
    I hope this would help you to understand my query.
    Thanks
    I appreciate your efforts.

  • Taking too much time in Rules(DTP Schedule run)

    Hi,
    I am Scheduling the DTP which have filters to minimize the load data.
    when i run the DTP it is taking too much time in the "rules" (i can see the  DTP monitor ststus package by pakage and step by step like "Start routine" "rules" and "End Routine")
    here it is consuming too much time in Rules Mapping.
    what is the problem and any solutions please...
    regards,
    sree

    Hi,
    Time taken at "rules" depends on the complexity involved there in ur routine. If it is a complex calculation it will take time.
    Also check ur DTP batch settings, ie how many no. of background processes used to perform  DTP, Job class.
    U can find these :
    goto DTP, select goto menu and select "Settings for Batch Manager".
    In the screen increase no of Processes from 3 to higher no(max 9).
    ChaNGE job class to 'A'.
    If ur DTP is still running , cancel it ie Kill the DTP, delete from the Cube,
    Change these settings and run ur DTP one more time.
    U can observer the difference.
    Reddy

Maybe you are looking for

  • Error on microsoft login page for OpenId authentication using Azure AD

    We have implemented authentication for multi tenant SaaS solution which uses Azure Ad single sign on using OpenIdConnect authentication and its working fine. The problem is when user is logged in in azure management portal with his live account and i

  • Question on unplanned delivery costs need to go to GL account ????

    Hello I have a question regarding unplanned deliver costs. I am a FI analyst  Can you please explain my how I can solve my problem . My user wants unplanned delivery costs to go in to the GL account . In MM account determination GL account is set up

  • Best Solution - 10g

    Hi all, For DeveloperSuite 10g, What is the best way possible to print various "Character-Mode" reports onto dot- matrix printer with pre-printed stationery of different sizes for different reports? Note: I read somewhere that once if you open the re

  • Since upgrade Firefox opens in wrong monitor window.

    Since upgrading yesterday, Firefox ALWAYS opens on Monitor 1 instead of Monitor 2. I have DELETED all add-ons and plug-ins. I have minimized, maximized, moved from Monitor 1 to Monitor 2 without maximizing or minimizing, and Firefox ALWAYS opens in M

  • Font size in Google results page is suddenly enormous

    I have an older PowerPC G4 running Mac OS X 10.4.11 and Safari 4.1.3. Yesterday, without changing or adding nothing at all, font size in the Google results page suddenly became huge. It looks terrible. This does not affect the main Google page, or th