Query executing taking time

Hi All,
I am using jdev 11.1.2.0
I am having a VO and VC. when i am executing View criteria .There is no error in it. That query is executing within seconds in TOAD.But in application it is taking lot of time.
And after some time web logic got crashed and message came that query didnt not executed with in 600 seconds or something.
Can we increase server time out for query execution. How to resolve this issue?

Hi All,
I am getting this error.Don't know why?Any help
Referer: http://127.0.0.1:7101/OMSApp/faces/InspectionTaskHome.jspx?_adf.ctrl-state=120t0k0j42_3
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: JSESSIONID=kkpvRYybkvsTypwLp1q2lfMtqHlk8LZ8XdCksSlKT5Z2xH6hdhrq!679123754
]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
     java.net.SocketInputStream.socketRead0(Native Method)
     java.net.SocketInputStream.read(SocketInputStream.java:129)
     oracle.net.nt.MetricsEnabledInputStream.read(TcpNTAdapter.java:718)
     oracle.net.ns.Packet.receive(Packet.java:295)
     oracle.net.ns.DataPacket.receive(DataPacket.java:106)
     oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:317)
     oracle.net.ns.NetInputStream.read(NetInputStream.java:262)
     oracle.net.ns.NetInputStream.read(NetInputStream.java:187)
     oracle.net.ns.NetInputStream.read(NetInputStream.java:104)
     oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:126)
     oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:82)
     oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1177)
     oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1153)
     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:312)
     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
     oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
     oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
     oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
     oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
     oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
     oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
     oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
     oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
     weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:135)
     oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1228)
     oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:893)
     oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:7154)
     oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1227)
     oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1413)
     oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1319)
     oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1304)
     oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7083)
     oper.model.module.AppModuleAMImpl.executeInstanceNoVc(AppModuleAMImpl.java:857)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:597)
     oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
     oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2161)
     oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3051)
     oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
     oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
     oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2168)
     oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
     oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
     oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
     oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
     oper.view.PreInspectionBean.ShowSRInstance(PreInspectionBean.java:127)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:597)
     com.sun.el.parser.AstValue.invoke(Unknown Source)
     com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
     org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
     org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1535)
     org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
     org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)
     org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:279)
     oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:145)
     oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:479)
     oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
     oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:111)
     oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
     oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
     oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
     oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:105)
     oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1129)
     oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:353)
     oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:204)
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
     weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:121)
     org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
     org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
     org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
     java.security.AccessController.doPrivileged(Native Method)
     oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
     oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
     oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
     oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
     weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
     weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
     weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Similar Messages

  • Using Materilaized view in a query .. query is taking time????

    Hi I have a query :-
    SELECT rownum as id, u.last_name, u.first_name,u.phone phone, u.empid,u.supervisor id
    FROM emp_view u -- using view
    CONNECT BY PRIOR u.empid = u.supervisor_id
    START WITH u.sbcuid = 'ph2755';
    here emp_view is a view .
    ------ The above query is taking 3 sec to execute.
    Then I created Materialuized view emp_mv and the the MV query is same as emp_view view query.
    After this i executed following sql
    SELECT rownum as id, u.last_name, u.first_name,u.phone phone, u.empid,u.supervisor id
    FROM emp_mv u -- using materialized view
    CONNECT BY PRIOR u.empid = u.supervisor_id
    START WITH u.sbcuid = 'ph2755';
    this query is taking 15 sec to execute..... :(
    can anyone please tell me why MV query is taking time????

    Hi,
    In your first case you query a view, meaning that you query the underlying tables. These probably have indexes and stats are updated.
    In you second case you query a materialized view, meaning that you query the underlying base table of that mview.
    This probably do not have the same indexes to support that query.
    But of course, I'm just guessing based on the little information provided.
    If you want to take this further, please search for "When your query takes too long" and "How to post a tuning request".
    These two threads holds valuable information, not only on how to ask this kind of question, but also how to start solving it on your own.
    Regards
    Peter

  • SQL Query Executing longer time

    Hi , The below SQL query executing longer time . Please help to Improve the query performance. The query continuously running for more than 24 hours and failing with roolback segment error. Not getting the final output. Most of the tables are having milions of records.
    Select distinct
    IBS.ADSL_ACCESS_INFO,
    IBS.LIJ ,
    regexp_substr(OBVS.REFERENTIE_A,'[[:digit:]]+') as O_NUMBER,
    DBS.CKR_NUMMER_CONTRACTANT,
    DBS.DNUMBER
    FROM CD.IBS,
    CD.OIBL,
    CD.IH,
    CD.ODL,
    CD.OH,
    CD.DBS,
    CD.OBVS
    Where IBS.END_DT = To_Date('31129999', 'ddmmyyyy')
    AND OIBL.END_DT = to_date('31129999', 'ddmmyyyy')
    AND DBS.END_DT = to_date('31129999', 'ddmmyyyy')
    AND OBVS.END_DT = to_date('31129999', 'ddmmyyyy')
    AND OBVS.REFERENTIE_A LIKE 'OFM%'
    AND OIBL.INFRA_KEY = IH.INFRA_KEY
    AND OIBL.ORDERS_KEY = OH.ORDERS_KEY
    AND IBS.INFH_ID = IH.INFH_ID
    AND ODL.ORDH_ID = OH.ORDH_ID
    AND DBS.DEBH_ID = ODL.DEBH_ID
    AND OBVS.ORDH_ID = ODL.ORDH_ID
    Order By IBS.LIJ
    All the columns which are present in the where condition are having either Index/key (Primary/unique) except END_DT column.
    Please Advise

    Predicate pushing can help when it greatlly restricts the number of rows - you must experiment - might not work with all predicates pushed (as shown here)
    select distinct
           ibs.adsl_access_info,
           ibs.lij,
           obvs.o_number,
           dbs.ckr_nummer_contractant,
           dbs.dnumber
      from (select infh_id,adsl_access_info,lij
              from cd.ibs
             where end_dt = to_date('31129999','ddmmyyyy')
           ) ibs,
           (select infra_key,orders_key
              from cd.oibl
             where end_dt = to_date('31129999','ddmmyyyy')
           ) oibl,
           (select ordh_id,regexp_substr(obvs.referentie_a,'[[:digit:]]+') as o_number
              from cd.obvs
             where end_dt = to_date('31129999','ddmmyyyy')
               and referentie_a like 'OFM%'
           ) obvs,
           (select debh_id,ckr_nummer_contractant,dnumber
              from cd.dbs
             where end_dt = to_date('31129999','ddmmyyyy')
           ) dbs,
           cd.ih,
           cd.odl,
           cd.oh
    where oibl.infra_key = ih.infra_key
       and oibl.orders_key = oh.orders_key
       and ibs.infh_id = ih.infh_id
       and odl.ordh_id = oh.ordh_id
       and dbs.debh_id = odl.debh_id
       and obvs.ordh_id = odl.ordh_id
    order by ibs.lijRegards
    Etbin

  • How to know which sql query is taking time for concurrent program

       Hi sir,
    I am running concurrent program,that is taking time to execute ,i want to know which sql query causing performance
    Thanaks,
    Sreekanth

    Hi,
    My Learning: Diagnosing Oracle Applications Concurrent Programmes - 11i/R12
    How to run a Trace for a Concurrent Program? (Doc ID 415640.1)
    FAQ: Common Tracing Techniques in Oracle E-Business Applications 11i and R12 (Doc ID 296559.1)
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs (Doc ID 726039.1)
    How To Trace a Concurrent Request And Generate TKPROF File (Doc ID 453527.1)
    Regards
    Yoonas

  • Query executation taking somuch time

    Hi
    I have created query on Inventory Cube(Copied from 0IC_C03).
    In cube maintainance i have changed the 'maintain non cumulative values' from calday and plant to only calday,
    because to get the correct data on day basis
    The query is based on material and vendor.
    it is taking so much time like 50 min to execute.
    I am thinking this is because of changing the 'maintain non cumulative values' in cube maintainance.
    But if i don't do that i can't get the correct values.
    Hope i explained the pbm very clearly.
    can anybody help me on this issue.
    I appreciate if anybody help me.
    Thanks
    Madhu

    HI,
    Have you tried other performance tuning activites, like creating aggregates, checked indices on the cube, etc.
    Also, did you give any filter criteria when running the query in the selection screens. If not do that as well.
    Suggest you run tcode ST03 in expert mode to check and see where the time is being taken and if needed run the query in debug mode using RSRT to see how best you can tune it further.
    Cheers,
    Kedar
    Cheers,
    Kedar

  • MY QUERY IS TAKING TIME WHILE EXECUTING IN WAD

    HI BW GURUS
    If i execute the report(using query with variables) which contains 8,50,000 records in WAD then its taking more than 900 seconds and say Connection timed out at the end.
    If i execute the same query in Query designer using Web browser then it will take 400 seconds to show all the data in hierarchy or tabular view.
    I've done tuning using RSRT on query read mode and persistent mode etc..
    Can you please help me?

    Execution plan depends on many factors, statistics status of the objects, system statistics if you are using, init.ora parameters like mulitblock_read_count, parallellism, etc.
    If you want to use same execution plan for all database, you should refer stored_outline. In 10g you can try sql profiling.
    Ashok

  • OLAP Query is Taking Time. Please give me the Solution.

    Hi Geof,
    I am new to this AW Cubes and all. I am facing with a problem. After reading u r responses and all I am asking u this question. I hope u will solve my problem.
    I trying to get the data out of cube using the below statement at SQL prompt.
    SELECT CONSTITUTION,ACTIVE_CODE,CLASSIFICATION,BR_CODE,CASTE,INTEREST_RATE,TOT_COUNT,OUTSTANDING_BAL FROM TABLE(OLAP_TABLE('MIS.KBL_REPORTS_AW DURATION SESSION',
    'DIMENSION CONSTITUTION AS varchar2(100) FROM AW_CUSTOMER_DIM1
    DIMENSION ACTIVE_CODE AS varchar2(50) FROM AW_ACTIVITY_DIM1
    DIMENSION CLASSIFICATION AS varchar2(50) FROM AW_PRODUCT_DIM1
    DIMENSION BR_CODE AS varchar2(50) FROM AW_BRANCH_DIM1
    DIMENSION CASTE AS varchar2(50) FROM AW_CASTE_DIM1
    DIMENSION INTEREST_RATE AS varchar2(50) FROM AW_INTEREST_DIM1
    MEASURE TOT_COUNT AS number(5) FROM KBL_REPORTS_CUBE1_COUNT_MEASURE
    MEASURE OUTSTANDING_BAL AS number(10) FROM KBL_REPORTS_CUBE1_BALANCE_MEASURE
    where CONSTITUTION like '%INDIVIDUAL%' and ACTIVE_CODE like '%010101';
    It is taking too much of time. Can u give the solution to me ???
    Regards,
    S.Vamsi Krishna

    Hi,
    What release are you using? You should use 10.2.0.2 if possible. The documentation references in this reply assume the 10.2.0.2 versions of the documentation.
    You may be able to add an empty MODEL clause to your query which has the paradoxical effect of speeding up most OLAP queries. See chapter 11 (OLAP_TABLE) in the Oracle OLAP Reference. But if performance is very poor, this is unlikely to improve matters enough.
    We need to figure out where the time is being spent. We can use Oracle trace files and the tkprof utility to do that. I'll describe the basics, but there is a lot more information in chapter 20 (Using Application Tracing Tools) of the Oracle Database Performance Tuning Guide.
    First, let's enable some configuration parameters that will cause the RDBMS to write some useful information to the trace file. Assuming that you have a SQL script that executes the query, you can add these commands to the beginning of the script:
    alter session set sql_trace=true
    alter session set timed_statistics=true
    alter session set "_olap_continuous_trace_file"=true
    alter session set "_olap_table_function_statistics"=true
    alter session set tracefile_identifier=perftest
    exec dbms_aw.execute('dotf tracefile');
    Now run the script with the query.
    Next we have to find the trace file. Trace files are written to the directory named by the configuration parameter user_dump_dest. As a privileged user, execute this command:
    SQL> show parameter user_dump_dest;
    Now look in that directory for a file whose name includes the string that we specified in the tracefile_identifier setting above (you can change this if you want):
    $ ls <user_dump_dest dir>/*perftest*.trc
    Having located the tracefile, run the tkprof utility:
    $ tkprof <trace file name> <tkprof output file name> aggregate=no
    Now edit the generated <tkprof output file name> and look for your query. It will be followed by a mini explain plan that includes a line for each subquery. You'll be able to see how much time is spent in each subquery and how many rows are returned to the enveloping query. The innermost subqueries will be the ones that query AW data. Your goal is to push as much of the work into the AW as possible, so that the AW engine return a minimal number of rows.
    You can get more detail from the trace file itself. If you are at all familiar with the OLAP DML, look for LIMIT commands and see that they roughly correspond to hierarchy selections and WHERE clause predicates in the SQL SELECT statement. OLAP DML comamnds have timestamps in the trace file, so you can get an idea of how long things are taking. You can find table function statistics by looking for XSTF and XSTABFUN in the trace file.
    Geof

  • Urgent Need: Query is taking time

    Hi,
    I have a query which is taking lots of time.Please help me in this regard...
    select subscripti0_.RENTAL_ID as RENTAL1_101_0_, movieprodu1_.product_id as product1_45_1_, moviepacka2_.PACKAGE_ID as PACKAGE1_47_2_, movietitle3_.TITLE_ID as TITLE1_48_3_, subscripti0_.LOGICAL_QUEUE_POSITION as LOGICAL2_101_0_, subscripti0_.STATUS as STATUS101_0_, subscripti0_.RENT_CODE as RENT4_101_0_, subscripti0_.IS_VISIBLE_FLAG as IS5_101_0_, subscripti0_.SHIP_DATE as SHIP6_101_0_, subscripti0_.DATE_CHECK_IN as DATE7_101_0_, subscripti0_.SET_NBR as SET8_101_0_, subscripti0_.ALLOCATION_DATE as ALLOCATION9_101_0_, subscripti0_.USPS_SHIP_DATE as USPS10_101_0_, subscripti0_.CENTRAL_CHECKIN_DATE as CENTRAL11_101_0_, subscripti0_.ESTIMATED_ARRIVAL_DATE as ESTIMATED12_101_0_, subscripti0_.CREATED_BY as CREATED13_101_0_, subscripti0_.CREATED_DATE as CREATED14_101_0_, subscripti0_.UPDATED_BY as UPDATED15_101_0_, subscripti0_.UPDATED_DATE as UPDATED16_101_0_, subscripti0_.SUBSCRIPTION_ID as SUBSCRI17_101_0_, subscripti0_.MOVIE_ID as MOVIE18_101_0_, movieprodu1_.ONLINE_RELEASE_DATE as ONLINE2_45_1_, movieprodu1_.PRODUCT_TITLE as PRODUCT3_45_1_, movieprodu1_.PACKAGE_ID as PACKAGE4_45_1_, movieprodu1_1_.AVAILABILITY_BAND as AVAILABI2_46_1_, movieprodu1_1_.TOTAL_RENTABLE_INVENTORY as TOTAL3_46_1_, NVL(movieprodu1_.ONLINE_FLAG, 0) as formula0_1_, NVL(movieprodu1_.PRIMARY_PRODUCT, 0) as formula1_1_, moviepacka2_.TITLE as TITLE47_2_, moviepacka2_.dvd_release_date as dvd3_47_2_, moviepacka2_.FORMAT as FORMAT47_2_, moviepacka2_.PACKAGE_MPAA as PACKAGE5_47_ 2_, moviepacka2_.T_ARTICLE as T6_47_2_, moviepacka2_.TITLE_ID as TITLE7_47_2_, movietitle3_.TITLE as TITLE48_3_, movietitle3_.THEATRICAL_RELEASE as THEATRICAL3_48_3_, movietitle3_.TITLE_MPAA as TITLE4_48_3_, movietitle3_.LEGACY_ID as LEGACY5_48_3_, movietitle3_.AVERAGE_USER_RATING as AVERAGE6_48_3_, movietitle3_.RUNNING_TIME as RUNNING7_48_3_, movietitle3_.PRIMARY_PACKAGE_ID as PRIMARY8_48_3_, movietitle3_1_.BUY_NEW as BUY2_49_3_, movietitle3_1_.BUY_USED as BUY3_49_3_, movietitle3_1_.RENT_DOWNLOAD as RENT4_49_3_, movietitle3_1_.BUY_DOWNLOAD as BUY5_49_3_, NVL(movietitle3_.HAS_RENTABLE_PRODUCTS, 0) as formula3_3_ from SUBSCRIPTION_RENTAL subscripti0_ inner join ACTIVE_MOVIE_PRODUCT movieprodu1_ on subscripti0_.MOVIE_ID=movieprodu1_.product_id left outer join PRODUCT_AVAILABILITY movieprodu1_1_ on movieprodu1_.product_id=movieprodu1_1_.MOVIE_ID inner join ACTIVE_MOVIE_PACKAGE moviepacka2_ on movieprodu1_.PACKAGE_ID=moviepacka2_.PACKAGE_ID inner join ACTIVE_MOVIE_TITLE movietitle3_ on moviepacka2_.TITLE_ID=movietitle3_.TITLE_ID left outer join MOVIE_TITLE_ATTRIBUTES movietitle3_1_ on movietitle3_.TITLE_ID=movietitle3_1_.TITLE_ID where subscripti0_.SUBSCRIPTION_ID=:1 and subscripti0_.DATE_CHECK_IN>:2 and (subscripti0_.DATE_CHECK_IN is not null) order by subscripti0_.DATE_CHECK_IN DESC
    Explain Plan for this query:
    OPERATION OBJECT_NAME OPTIMIZER COST BYTES CARDINALITY CPU_COST IO_COST
    SELECT STATEMENT ALL_ROWS 148 1570 5 10090819 147
    SORT 148 1570 5 10090819 147
    NESTED LOOPS 147 1570 5 1237900 147
    NESTED LOOPS 142 1530 5 1191042 142
    NESTED LOOPS 141 1470 5 1174111 141
    NESTED LOOPS 129 1398 6 1073114 129
    NESTED LOOPS 117 1062 6 968996 117
    PARTITION HASH 111 732 6 911328 111
    TABLE ACCESS SUBSCRIPTION_RENTAL ANALYZED 111 732 6 911328 111
    INDEX INDX_SUB_RENTAL_SUB ANALYZED 3 10 43164 3
    TABLE ACCESS MOVIE_PRODUCT ANALYZED 1 55 1 9611 1
    INDEX PK_MOVIE_PRODUCT ANALYZED 0 1 1900 0
    TABLE ACCESS MOVIE_PACKAGE ANALYZED 2 56 1 17353 2
    INDEX PK_MOVIE_PACKAGE ANALYZED 1 1 9021 1
    TABLE ACCESS MOVIE_TITLE ANALYZED 2 61 1 16833 2
    INDEX PK_MOVIE_TITLE ANALYZED 1 1 9021 1
    TABLE ACCESS MOVIE_TITLE_ATTRIBUTES ANALYZED 1 12 1 9331 1
    INDEX PK_MOVIE_TITLE_ATTRIBUTES ANALYZED 0 1 1900 0
    TABLE ACCESS PRODUCT_AVAILABILITY ANALYZED 1 8 1 9371 1
    INDEX PRODUCT_AVAILABILITY_PK ANALYZED 0 1 1900 0
    I need the help very urgently. Kindly give me the solution immediately.
    Edited by: msora on Feb 10, 2009 3:19 AM

    msora wrote:
    Thanks Ozy,
    The query is using joins instead of subquery. The statistics are latest. the query is using indexes too.the optimzer_mode is all_rows.
    Now, you tell me what hint i should use to optimize this query?
    Thanks and Regards,
    MSORAHmm, urgent, immediately, its not Support MSORA. Be patient while asking for help or if its really urgent, open an SR with support.
    Your query is not able to be read. Format it using the { code }( without spaces) and post it. Also there is no such thing that you can just put any hint and query will be tuned. Trace your query with 10046 trace( search this forum for that) and paste its output here.
    Aman....

  • Query executing multiple times

    All,
    This question has been come up quite often in the OTN forum and i have not managed to get the answer. The issue is when i enable the logs i can see query getting fired multiple times :
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> ----[Exec query for VO=Kpi, RS=<Default>]----
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> ----[Exec COUNT query for VO=Kpi]----
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> VODef =com.xxx.model.uiView.KpiVO
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> SELECT
    kpi.kpi,
    kpi.kpi_desc,
    kpi.target,
    kpi_pkg.get_kpi_main (kpi.kpi, kpi.sale_type, :bSelectedSalesExecutiveId, :bSelectedBranchId ,:bOperatingUnitId, :bUserRole, :bPersonId, :bKpiRefresh) achieved,
    kpi.percentage,
    kpi.sale_type
    FROM    tableName kpi   
    WHERE  kpi.sale_type = NVL (:bSaleType, kpi.sale_type)
    ORDER BY tag
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> BindVars:(bUserRole=SE,bOperatingUnitId=81,bPersonId=31458,bSaleType=RETAIL,bSelectedBranchId=224,bSelectedSalesExecutiveId=31458,bKpiRefresh=Y)
    <TracingViewObjectSqlQueryExecution> <getQueryHitCount> ***** Query Hit Count = 6 *****
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> VODef =com.xxx.model.uiView.KpiVO
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> SELECT
    kpi.kpi,
    kpi.kpi_desc,
    kpi.target,
    kpi_pkg.get_kpi_main (kpi.kpi, kpi.sale_type, :bSelectedSalesExecutiveId, :bSelectedBranchId ,:bOperatingUnitId, :bUserRole, :bPersonId, :bKpiRefresh) achieved,
    kpi.percentage,
    kpi.sale_type
    FROM    tableName kpi   
    WHERE  kpi.sale_type = NVL (:bSaleType, kpi.sale_type)
    ORDER BY tag
    <TracingViewObjectSqlQueryExecution> <logQueryStatementAndBindParameters> BindVars:(bUserRole=SE,bOperatingUnitId=81,bPersonId=31458,bSaleType=RETAIL,bSelectedBranchId=224,bSelectedSalesExecutiveId=31458,bKpiRefresh=Y)This is one such case. These repetitive nature of the queries getting executed is making my application slow. On the logs i can see the first time query getting executed then waiting for it to finish then the same for the second time. Can any one give some inputs on this ?
    thnks
    Jdev 11.1.1.5

    thnks Frank for your reply.
    Ideally this query is supposed to run when the page is loaded however it has a complex calculation which takes 28 secs to complete. In order to load the page fast we dragged and dropped the collection as a table and added a button which executes the query. So the query gets executed on page load with a condition set as false so that no data is fetched - to speed the page load. However when we press the Refresh button the query gets re executed but as you can see 2 times. I can see the same effect on a nos of tables.

  • When was the Query executed last time - SQ01

    Hi All,
    We have an ECC 6.0 System running on Oracle and os is SUN OS . When i go to TCODE SQ01 i see
    many queries. I need to know when were the Queries run on the system. Is there any way to figure
    this out.
    Any pointers would be helpful
    Thanks & Regards,
    Ershad Ahmed

    Not by default. There are several ways:
    - You can use ST03N to find out which queries are executed (select a big timeframe)
    - you can enable auditing (SM19/SM20) and track "AQ*" programs
    - you can book an SLO service to find the exact number (http://service.sap.com/slo)
    Markus

  • Select query taking time

    THe following query is taking time. Is there anyway better to write this query.
    SELECT PROGRAM_NAME_ID ,PROGRAM_NAME,sum(balance)"Unpaid Balance"
        FROM (
    SELECT DISTINCT
    PROGRAM_NAME_ID ,PROGRAM_NAME,
    t.billing_key billing_key,
    (TUFF_GENERIC_PKG.GET_TOTAL(t.billing_key,t.program_key)+
    nvl(PENALTY_INTEREST(t.billing_key,t.program_key,b.company_id,b.report_period ),0))
    -PAYMENT_AMOUNT(B.COMPANY_ID,T.PROGRAM_KEY,B.REPORT_PERIOD) Balance,
    Report_period,company_id
    FROM  BILLING B,
    PROG_SURCH T ,
    mv_program_dict P
    WHERE
    B.BILLING_KEY=T.BILLING_KEY
    AND  p.program_key= t.program_key(+)
    and company_id=:p3_hide_comp
    and b.SUBMIT_STATUS='S'
    union
    SELECT DISTINCT
    PROGRAM_NAME_ID ,PROGRAM_NAME,
    t.billing_key billing_key,
    (TUFF_GENERIC_PKG.GET_TOTAL(t.billing_key,t.program_key)+
    nvl(PENALTY_INTEREST(t.billing_key,t.program_key,b.company_id,b.report_period ),0))
    -PAYMENT_AMOUNT(B.COMPANY_ID,T.PROGRAM_KEY,B.REPORT_PERIOD) Balance,
    Report_period,company_id
    FROM  MV_BILLING B,
    MV_PROG_SURCH T ,
    mv_program_dict P
    WHERE
    B.BILLING_KEY=T.BILLING_KEY
    AND  p.program_key= t.program_key(+)
    and company_id=:p3_hide_comp
    order by report_period,program_name_id )
    where balance>=0
    GROUP BY PROGRAM_NAME_ID,PROGRAM_NAME
    ORDER BY PROGRAM_NAME_ID

    Hi,
    This is totally right.
    >
    Being one such call. The price for calling pl/sql functions in SQL can be quite high. I'd highly recommend you find a way to incorporate the pl/sql code into the SQL query.
    >
    but, try with this query. I hope would help you and return the rows you want.
    SELECT   program_name_id, program_name,
               SUM (  tuff_generic_pkg.get_total (billing_key, program_key)
                    + NVL (penalty_interest (billing_key,
                                             program_key,
                                             company_id,
                                             report_period
                           0
             - payment_amount (company_id, program_key, report_period) balance
        FROM (SELECT program_name_id, program_name, t.billing_key, t.program_key,
                     b.company_id, b.report_period
                FROM billing b, prog_surch t, mv_program_dict p
               WHERE b.billing_key = t.billing_key
                 AND p.program_key = t.program_key(+)
                 AND company_id = :p3_hide_comp
                 AND b.submit_status = 'S'
              UNION
              SELECT program_name_id, program_name, t.billing_key, t.program_key,
                     b.company_id, b.report_period report_period, company_id
                FROM mv_billing b, mv_prog_surch t, mv_program_dict p
               WHERE b.billing_key = t.billing_key
                 AND p.program_key = t.program_key(+)
                 AND company_id = :p3_hide_comp) sub
       WHERE   (  tuff_generic_pkg.get_total (billing_key, program_key)
                + NVL (penalty_interest (billing_key,
                                         program_key,
                                         company_id,
                                         report_period
                       0
             - payment_amount (company_id, program_key, report_period) >= 0
    GROUP BY program_name_id, program_nameObviosly I cannot testing.
    HTH -- johnxjean --

  • Query is taking more time to execute

    Hi,
    Query is taking more time to execute.
    But when i execute same query in other server then it is giving immediate output.
    What is the reason of it.
    thanks in advance.

    'My car doesn't start, please help me to start my car'
    Do you think we are clairvoyant?
    Or is your salary subtracted for every letter you type here?
    Please be aware this is not a chatroom, and we can not see your webcam.
    Sybrand Bakker
    Senior Oracle DBA

  • Query is taking more time to execute in PROD

    Hi All,
    Can anyone tell me why this query is taking more time when I am using for single trx_number record it is working fine but when I am trying to use all the records it is not fatching any records and it is keep on running.
    SELECT DISTINCT OOH.HEADER_ID
    ,OOH.ORG_ID
    ,ct.CUSTOMER_TRX_ID
    ,ool.ship_from_org_id
    ,ct.trx_number IDP_SHIPMENT_ID
    ,ctt.type STATUS_CODE
    ,SYSDATE STATUS_DATE
    ,ooh.attribute16 IDP_ORDER_NBR --Change based on testing on 21-JUL-2010 in UAT
    ,lpad(rac_bill.account_number,6,0) IDP_BILL_TO_CUSTOMER_NBR
    ,rac_bill.orig_system_reference
    ,rac_ship_party.party_name SHIP_TO_NAME
    ,raa_ship_loc.address1 SHIP_TO_ADDR1
    ,raa_ship_loc.address2 SHIP_TO_ADDR2
    ,raa_ship_loc.address3 SHIP_TO_ADDR3
    ,raa_ship_loc.address4 SHIP_TO_ADDR4
    ,raa_ship_loc.city SHIP_TO_CITY
    ,NVL(raa_ship_loc.state,raa_ship_loc.province) SHIP_TO_STATE
    ,raa_ship_loc.country SHIP_TO_COUNTRY_NAME
    ,raa_ship_loc.postal_code SHIP_TO_ZIP
    ,ooh.CUST_PO_NUMBER CUSTOMER_ORDER_NBR
    ,ooh.creation_date CUSTOMER_ORDER_DATE
    ,ool.actual_shipment_date DATE_SHIPPED
    ,DECODE(mp.organization_code,'CHP', 'CHESAPEAKE'
    ,'CSB', 'CHESAPEAKE'
    ,'DEP', 'CHESAPEAKE'
    ,'CHESAPEAKE') SHIPPED_FROM_LOCATION --'MEMPHIS' --'HOUSTON'
    ,ooh.freight_carrier_code FREIGHT_CARRIER
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('FREIGHT',ct.customer_trx_id,ct.org_id),0)
    + NVL(XX_FSG_NA_FASTRAQ_IFACE.get_line_fr_amt ('FREIGHT',ct.customer_trx_id,ct.org_id),0)FREIGHT_CHARGE
    ,ooh.freight_terms_code FREIGHT_TERMS
    ,'' IDP_BILL_OF_LADING
    ,(SELECT WAYBILL
    FROM WSH_DELIVERY_DETAILS_OE_V
    WHERE -1=-1
    AND SOURCE_HEADER_ID = ooh.header_id
    AND SOURCE_LINE_ID = ool.line_id
    AND ROWNUM =1) WAYBILL_CARRIER
    ,'' CONTAINERS
    ,ct.trx_number INVOICE_NBR
    ,ct.trx_date INVOICE_DATE
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('LINE',ct.customer_trx_id,ct.org_id),0) +
    NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('TAX',ct.customer_trx_id,ct.org_id),0) +
    NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('FREIGHT',ct.customer_trx_id,ct.org_id),0)INVOICE_AMOUNT
    ,NULL IDP_TAX_IDENTIFICATION_NBR
    ,NVL(XX_FSG_NA_FASTRAQ_IFACE.get_invoice_amount ('TAX',ct.customer_trx_id,ct.org_id),0) TAX_AMOUNT_1
    ,NULL TAX_DESC_1
    ,NULL TAX_AMOUNT_2
    ,NULL TAX_DESC_2
    ,rt.name PAYMENT_TERMS
    ,NULL RELATED_INVOICE_NBR
    ,'Y' INVOICE_PRINT_FLAG
    FROM ra_customer_trx_all ct
    ,ra_cust_trx_types_all ctt
    ,hz_cust_accounts rac_ship
    ,hz_cust_accounts rac_bill
    ,hz_parties rac_ship_party
    ,hz_locations raa_ship_loc
    ,hz_party_sites raa_ship_ps
    ,hz_cust_acct_sites_all raa_ship
    ,hz_cust_site_uses_all su_ship
    ,ra_customer_trx_lines_all rctl
    ,oe_order_lines_all ool
    ,oe_order_headers_all ooh
    ,mtl_parameters mp
    ,ra_terms rt
    ,OE_ORDER_SOURCES oos
    ,XLA_AR_INV_AEL_SL_V XLA_AEL_SL_V
    WHERE ct.cust_trx_type_id = ctt.cust_trx_type_id
    AND ctt.TYPE <> 'BR'
    AND ct.org_id = ctt.org_id
    AND ct.ship_to_customer_id = rac_ship.cust_account_id
    AND ct.bill_to_customer_id = rac_bill.cust_account_id
    AND rac_ship.party_id = rac_ship_party.party_id
    AND su_ship.cust_acct_site_id = raa_ship.cust_acct_site_id
    AND raa_ship.party_site_id = raa_ship_ps.party_site_id
    AND raa_ship_loc.location_id = raa_ship_ps.location_id
    AND ct.ship_to_site_use_id = su_ship.site_use_id
    AND su_ship.org_id = ct.org_id
    AND raa_ship.org_id = ct.org_id
    AND ct.customer_trx_id = rctl.customer_trx_id
    AND ct.org_id = rctl.org_id
    AND rctl.interface_line_attribute6 = to_char(ool.line_id)
    AND rctl.org_id = ool.org_id
    AND ool.header_id = ooh.header_id
    AND ool.org_id = ooh.org_id
    AND mp.organization_id = ool.ship_from_org_id
    AND ooh.payment_term_id = rt.term_id
    AND xla_ael_sl_v.last_update_date >= NVL(p_last_update_date,xla_ael_sl_v.last_update_date)
    AND ooh.order_source_id = oos.order_source_id --Change based on testing on 19-May-2010
    AND oos.name = 'FASTRAQ' --Change based on testing on 19-May-2010
    AND ooh.org_id = g_org_id --Change based on testing on 19-May-2010
    AND ool.flow_status_code = 'CLOSED'
    AND xla_ael_sl_v.trx_hdr_id = ct.customer_trx_id
    AND trx_hdr_table = 'CT'
    AND xla_ael_sl_v.gl_transfer_status = 'Y'
    AND xla_ael_sl_v.accounted_dr IS NOT NULL
    AND xla_ael_sl_v.org_id = ct.org_id;
    -- AND ct.trx_number = '2000080';
    }

    Hello Friend,
    You query will definitely take more time or even fail in PROD,becuase the way it is written. Here are my few observations, may be it can help :-
    1. XLA_AR_INV_AEL_SL_V XLA_AEL_SL_V : Never use a view inside such a long query , becuase View is just a window to the records.
    and when used to join other table records, then all those tables which are used to create a view also becomes part of joining conition.
    First of all please check if you really need this view. I guess you are using to check if the records have been created as Journal entries or not ?
    Please check the possbility of finding it through other AR tables.
    2. Remove _ALL tables instead use the corresponding org specific views (if you are in 11i ) or the sysnonymns ( in R12 )
    For example : For ra_cust_trx_types_all use ra_cust_trx_types.
    This will ensure that the query will execute only for those ORG_IDs which are assigned to that responsibility.
    3. Check with the DBA whether the GATHER SCHEMA STATS have been run atleast for ONT and RA tables.
    You can also check the same using
    SELECT LAST_ANALYZED FROM ALL_TABLES WHERE TABLE_NAME = 'ra_customer_trx_all'.
    If the tables are not analyzed , the CBO will not be able to tune your query.
    4. Try to remove the DISTINCT keyword. This is the MAJOR reason for this problem.
    5. If its a report , try to separate the logic in separate queries ( using a procedure ) and then populate the whole data in custom table, and use this custom table for generating the
    report.
    Thanks,
    Neeraj Shrivastava
    [email protected]
    Edited by: user9352949 on Oct 1, 2010 8:02 PM
    Edited by: user9352949 on Oct 1, 2010 8:03 PM

  • Query taking time to execute

    Hello,
    i have created one query based on inventory cube 0IC_C03. when i am executing the infocube based on a particular date i am able to see the output but when i am executing the query on the basis of that particular date given while executing the cube the query is taking long time to execute and throwing a message of time limit exceed.
    could anyone suggest me why the query is showing such nessage along with resolution.
    Thanks,
    Kumkum
    Edited by: kumkum basu on Nov 29, 2010 2:33 PM

    Hi,
    There can be number of reason.
    What you can do is:-
    put the unwanted characteristics in Free Characteristics
    Remove unwanted cell reference
    Try using partitions in cubes
    Use aggregates for summarised data.
    f the above options doesnt work, then try pre-caching.This will definitely help!
    Use proper selections to get small subset of data.
    Goto RSRT>> type your query name>> Query properties>> select cache mode=4
    In addition to RSRT, ST05 (sql trace), SE30 (runtime analysis) and system statistics (ST03) may help you in identifying performance issues with a report.
    Thanks,.
    Saveen Kumar

  • When query is taking too long time

    When query is taking too long time,Where and how to start tuning it?
    Here i've listed few things need to be considered,out of my knowledge and understanding
    1.What the sql is waiting for(wait events)
    2.Parameter modification need to be done at system/session level
    3.The query has to be tuned (using hints )
    4.Gathering/deleting statistics
    List out any other things that need to be taken into account?
    Which approach must be followed and on what basis that approach must be considered?

    When query is taking too long time,Where and how to start tuning it?explain plan will be good start . trace also
    Here i've listed few things need to be considered,out of my knowledge and understanding
    1.What the sql is waiting for(wait events)When Oracle executes an SQL statement, it is not constantly executing. Sometimes it has to wait for a specific event to happen befor it can proceed.
    Read
    http://www.adp-gmbh.ch/ora/tuning/event.html
    2.Parameter modification need to be done at system/session levelDepend on parameter , define parameter , trace done on session level for example
    3.The query has to be tuned (using hints )Could be help you but you must know how to use .
    4.Gathering/deleting statisticsDo it in non working hours , it will impact on database performance , but its good
    List out any other things that need to be taken into account?Which account ?
    Which approach must be followed and on what basis that approach must be considered?you could use lot of tools , Trace , AWR

Maybe you are looking for