Query Critical Issues

Hi Gurus,
I got a big problem here with the querys where clause, when I put specific values, the query works fine, but when I try to execute it without where clause or an generic where clause, it shows me this message error: 01476. 00000 - "divisor is equal to zero"
what can I do to have a succesful query execution, please help gurus!!! I need your help!
heres the textual query
this way run fine:
SELECT ROUND(SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) / SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END) * 100 )AS APEGO,
tp.tienda
FROM xxta_control_enc_answers a
INNER JOIN xxta_control_visitas v ON (v.doc_id = a.doc_id)
INNER JOIN cnt_tiendas_x_plaza_v tp ON (v.cr_tienda = tp.cr_tienda)
INNER JOIN cnt_distritos_x_plaza_v p ON (p.plaza = v.cr_plaza)
INNER JOIN xxta_encuestas e ON (e.enc_id = a.enc_id)
WHERE e.enc_name = '5´s 1'
AND p.plaza = '10RYN'
AND p.id_distrito = 34
AND a.tienda_end_date BETWEEN '01/11/2010' AND '31/01/2011'
GROUP BY tp.tienda ORDER BY apego, tp.tienda
and these 2 ways runs with error
SELECT ROUND(SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) / SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END) * 100 )AS APEGO,
tp.tienda
FROM xxta_control_enc_answers a
INNER JOIN xxta_control_visitas v ON (v.doc_id = a.doc_id)
INNER JOIN cnt_tiendas_x_plaza_v tp ON (v.cr_tienda = tp.cr_tienda)
INNER JOIN cnt_distritos_x_plaza_v p ON (p.plaza = v.cr_plaza)
INNER JOIN xxta_encuestas e ON (e.enc_id = a.enc_id)
WHERE e.enc_name = '5´s 1'
AND p.plaza IN (SELECT x.plaza FROM cnt_distritos_x_plaza_v x)
AND p.id_distrito IN (SELECT x.id_distrito FROM cnt_distritos_x_plaza_v x)
AND a.tienda_end_date BETWEEN '01/11/2010' AND '31/01/2011'
GROUP BY tp.tienda ORDER BY apego, tp.tienda
SELECT ROUND(SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) / SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END) * 100 )AS APEGO,
tp.tienda
FROM xxta_control_enc_answers a
INNER JOIN xxta_control_visitas v ON (v.doc_id = a.doc_id)
INNER JOIN cnt_tiendas_x_plaza_v tp ON (v.cr_tienda = tp.cr_tienda)
INNER JOIN cnt_distritos_x_plaza_v p ON (p.plaza = v.cr_plaza)
INNER JOIN xxta_encuestas e ON (e.enc_id = a.enc_id)
WHERE e.enc_name = '5´s 1'
AND a.tienda_end_date BETWEEN '01/11/2010' AND '31/01/2011'
GROUP BY tp.tienda ORDER BY apego, tp.tienda
Please !!! I really hope you can help me as soon as possible you can..
have an excellent day, best Regards
Mentor

You are missing a ,1 at the end of the greatest...
SELECT ROUND(SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) / GREATEST(SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END)) * 100 )AS APEGO,change it like so...
SELECT ROUND(SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) / GREATEST(SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END), 1) * 100 )AS APEGO,Also, you can verify which numbers are zero with
SELECT  SUM(CASE WHEN a.answer = 1 THEN 1 ELSE 0 END) sum_1,
        SUM(CASE WHEN a.answer IN (0,1) THEN 1 ELSE 0 END) sum_2,
        tp.tienda
FROM xxta_control_enc_answers a
INNER JOIN xxta_control_visitas v ON (v.doc_id = a.doc_id)
INNER JOIN cnt_tiendas_x_plaza_v tp ON (v.cr_tienda = tp.cr_tienda)
INNER JOIN cnt_distritos_x_plaza_v p ON (p.plaza = v.cr_plaza)
INNER JOIN xxta_encuestas e ON (e.enc_id = a.enc_id)
WHERE e.enc_name = '5´s 1'
AND a.tienda_end_date BETWEEN '01/11/2010' AND '31/01/2011'
GROUP BY tp.tienda ORDER BY apego, tp.tienda David
Edited by: Bravid on Aug 18, 2011 4:21 PM

Similar Messages

  • Resolve SharePoint Central Administration Critical Issues

    In the photo I have tried to fix the critical issues, but have had no luck.
    The top three issues are the most important ones i want to get rid of.
    Please provide steps to resolving these issues permanently. 
    "One or more servers not responding" is a stop/start timer issue with SPTimerV4 which is relating to a specific server of mine (Portal10A). I go to this server to start SPTimerV4 in the cmd. When I start the timer, this critical
    issue goes away. However, the SPTimerV4 randomly stops again (4 hours later to a day later). Just starting the SpTimerV4 is only a temporary solution, until the SPTimerV4 stops again and I have to restart. 
    Thank you!

    1. Ensure that SharePoint 2010 Timer Service is in Started mode under Start > Services.
    2. Ensure your SharePoint 2010 Timer Service is running under your Farm Account. This Farm Account must be part of your admin group and ensure that this account has admin permissions to run services.
    The farm account is also referred to as the database access account and is used
    as the application pool identity for Central Administration, and as the process account for the Microsoft SharePoint Foundation 2010 Timer service.
    Plan for
    administrative and service accounts in SharePoint (This article is also applicable to 2010 version)
    3. If both of above is already done and issue not resolved yet then restart the SharePoint 2010 Timer Service.
    4. If all above does not resolves your issue then please re-run SharePoint Configuration Wizard and restart your SharePoint Application Server.
    Please remember to click 'Mark as Answer' if the reply answers your query or 'Upvote' if it helps you.

  • Critical Issue - Locking Error - Stateless BC4J Application

    Hi,
    We are using "Stateless" mode in our BC4J project. Our View form done with Datawebbeans, Edit Form and Submit Edit Form done with Datatags. We are using Jdeveloper 3.2.
    In multi-user environment, we are noticing that if two users open the same record at the same time, for editing, it is allowing both the users to edit the same record. We expect the second user to get an error message something like "Row Has been Changed - Re-query to see the change". But its not the case.
    This is a very critical issue for us and any help from JDEV team is appreciated.
    Thank you in advance
    Virinchi
    null

    The following information from Jdeveloper 3.1 Help (User Guides - Developing Business Components - Understanding Transactions - About Application Modules and Transactions) might be useful:
    Client applications connect to databases and manage transactions by using the oracle.jbo.Transaction interface. Some useful methods of the Transaction interface with regard to Application Modules are:
    commit - Commit the transaction; saves all changes to the database. If the database connection is established, the transaction is implicitly started.
    connect - Attempt to establish a connection to the given database URL.
    disconnect - Disconnect the server from the database.
    **getLockingMode** - Get the preferred locking mode for this transaction. Currently the locking mode defaults to LOCK_PESSIMISTIC.
    rollback - Rollback the transaction; discard all changes.
    setLockingMode - Set the preferred locking mode for this transaction. Changing the locking mode affects only subsequent locks that are placed
    If you have an Application Module and DataSource defined with Data Tags like this:
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule configname="dbproject3.Dbproject3Module.Dbproject3ModuleLocal"
    id="Dbproject3Module" username="db" password="project" />
    <jbo:DataSource id="ds" appid="Dbproject3Module" viewobject="BlChangesView" >
    </jbo:DataSource>
    Then you can access the Application Module, using Java Code like this:
    jsp:useBean class="oracle.jbo.html.databeans.RowsetNavigator" id="rsn" scope="page" >
    <%
    rsn.setReleaseApplicationResources(false);
    rsn.initialize(pageContext,"JSPFrame_dbproject3_Dbproject3Module.BlChangesView");
    oracle.jbo.Row row = rsn.getRowSet().last();
    oracle.jbo.domain.Number num = ((oracle.jbo.domain.Number)row.getAttribute("ChangeCode"));
    ccode = num.intValue();
    out.println("<h2>Change Code, by webbean is: " + ccode);
    %>
    </jsp:useBean>
    Use:
    ApplicationModule am =rsn.getRowSet().getApplicationModule()
    then get the transacton with
    am.getTransaction()
    Hope this helps.
    null

  • Critical issue with Connection.setReadOnly on WebLogic

    Hi All,
    We've just hit a critical issue while running on WebLogic.
    After establishing a connection from a connection pool, we set the ReadOnly status to true on the Connection.
    (We do this so user entered SQL can be executed)
    In testing, we put in a DELETE FROM TEST_TABLE_NAME command, and the code is actually performing the delete.
    (Updates the same)
    I've connected a remote debugger and seen that the ReadOnly flag is set to true inside the connection Object.
    This is how my connection pool is configured........
    driver class name: oracle.jdbc.OracleDriver
    properties:
    user=V42_ISMART_DEMO_USER
    ejb=sisPool
    class=oracle.jdbc.pool.OracleConnectionPoolDataSource
    protocol=thin
    xa-location=jdbc/xa/sisPool
    Transaction is using One-Phase commit.
    database is 11.1.0.7.0
    Weblogic 10.3
    Java 1.6
    Any pointers in the right direction would be greatly appreciated, as this is currently blocking a product release.
    Thanks,
    Ronan

    Do tell us more about the product release and how this issue has come to
    block it. How does the behavior you see differ from anything earlier in your
    development cycle!
    You have already taken WebLogic out of the equation be confirming that
    the read-only setting is passed to the driver's connection object, so this is
    only a driver issue. You could take it up in the JDBC forum, but the main
    issue is probably that you have not investigated the specified semantics of
    setReadOnly(). From a user perspective, it sounds like it might be intended
    to stop any user SQL from altering the DBMS, though with deeper thought
    on the issue, that could only be implemented at the DBMS itself. The driver
    could never know if a stored procedure you call or a trigger on a select
    query you make altered the DBMS.
    The spec for the call, however, carves out a totally different and vastly
    less interesting meaning to the method:
    "Puts this connection in read-only mode as a hint to the driver to enable
    database optimizations. "
    This allows the driver to totally ignore the input in cases where it does not
    enable any 'dbms optimizations' which it does not in this case, so the driver
    does ignore the setting, except to helpfully return it to you later if you should
    call getReadOnly()... ;)
    HTH,
    Joe

  • Simultaneous read and write to a cube - critical issue

    Hello xperts,
    I am facing a critical issue.
    I have Cube A which has loads of data in it. I need to take the data of CubeA to a new CubeB as a backup purpose.This activity will take a lot of time.
    Concern1 - In the night we have the master data job which runs including the attribute change run job. Will this have any effect on the load happening from Cube A to Cube B.
    Concern 2 - After master data job finishes in the system , we then run the transaction data jobs which would update Cube A with the delta data. Now the issue is can this delta load happen  to Cube A while there is data load going on from Cube A to Cube B??
    Please help me out with this ASAP.
    Thanks & Regards
    Rohit

    Rohit,
    Attribute change runs will get affected only when you drop or rebuild the indices - this activity locks the cube - any activity that locks the cube will affect attribute change run - reads on a cube will not lock the cube.
    However when you are loading data into your new cube - you cannot load data into the cube - for the very fact that when you load data into the cube - you will drop indices - this will affect the data load into the new cube.
    Arun

  • Critical Issue - 500- Internal Server Error for request in User's Inbox

    Hi,
    We have developed and deployed SOA composite and custom task flow (For Customized Email notifications).[30.7.1.1 Creating a Task Flow with a Router - http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_designtf.htm#SOASE744]
    When a request is generated it goes for an approval. In Approver's inbox in identity console you can see request is pending. When Approver clicks on that link to see request details error is displayed - "500- Internal Server Error "
    In OIM logs I can see this:
    oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/oracle/iam/ui/soa/tfs/remote-taskdetails-tf.xml'.
            at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getMetadataObjects(MdsMetadataResourceProvider.java:466)
            at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.loadUnmutalbeMetadataResources(MdsMetadataResourceProvider.java:367)
            at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getResources(MdsMetadataResourceProvider.java:179)
            at oracle.adfinternal.controller.metadata.MetadataServiceImpl.getTaskFlowDefinition(MetadataServiceImpl.java:209)
            at oracle.adfinternal.controller.util.SecurityUtils.invokeURLAllowed(SecurityUtils.java:33)
            at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:210)
            at oracle.adfinternal.controller.application.RemoteTaskFlowCallRequestHandler.invokeTaskFlowByUrl(RemoteTaskFlowCallRequestHandler.java:99)
            at oracle.adfinternal.controller.application.RemoteTaskFlowCallRequestHandler.doCreateView(RemoteTaskFlowCallRequestHandler.java:64)
            at oracle.adfinternal.controller.application.BaseRequestHandlerImpl.createView(BaseRequestHandlerImpl.java:57)
            at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.createView(ViewHandlerImpl.java:95)
            at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:831)
            at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:422)
            at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128)
            at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
            at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
            at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
            at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
            at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
            at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.bpel.services.workflow.client.worklist.util.WorkflowFilter.doFilter(WorkflowFilter.java:175)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.bpel.services.workflow.client.worklist.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:70)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
            at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
            at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
            at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
            at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/WEB-INF/oracle/iam/ui/soa/tfs/remote-taskdetails-tf.xml"
            at oracle.mds.core.MetadataObject.getBaseMO(MetadataObject.java:1408)
    Screenshot of Error in Inbox:
    This is critical issue for us and is showstopper for Go-Live. So any kind of help is highly appreciated.
    Thank you,
    Tanmay

    If its Java only error then there wont be any dump in ST22.
    Strange issue for you, in general if we get 500 error, there should be details of it in the same page.
    You said this issue is occuring for only one user, is it getting replicated every time?
    You are also seeing the same error when u login as that particular user?
    Do one thing, assign him the Content Admin role and then do the preview of this iView form content admin and see if ur still seeing this error.
    Regards
    Yugandhar Reddy

  • Critical Issue: Availabilty check & alternative BOM selction issue

    During the upgradation project I'm working facing the following critical issues:
    1)While creating the sales order, system carries out the availability check in APO.In material master checking group Z5 is defined.
        Actually I want to know hw the system carries out the search in APO & what are the settings in R/3 or APO we have to make?
    2)Suppose there are 3 alternative BOM's of a finished product.A requirement is while creating the sales order availabilty check should be carried out & system should check the availability of components on the required date.If the component is not avalable system should go & check the second alternative...third alternative until it gets the confirmation of component availability.
         How we can set this functionality & what are the prerequisites or customisation settings we needs to make?
        Would appreciate providing your inputs on this critical issue.
    Thanks,
    Nilesh<b></b>

    Before you understand how the APO Availability Checking concept works, I would suggest you understand about the regular R3 availability checking. As this is the core for the SD and APO GATP. Refer help.sap.com
    Question 1:
    <b>Settings in R3:</b> You have the ATP integration model in CFM1 transaction. You need to activate this just one time and never again. what this does is basically transfer all your availability checking customizing to APO.
    All the settings for the Availability Checking group ( Z5, etc) are already maintained in R3 and they get transferred to APO by the integration model. You donot need to anything else.
    <b>Settings in APO:</b>
    If you are using <b>Product Allocation Concept</b>, You have to maintain the Check Instructions.... Otherwise there are no other settings in APO
    <b>Availability Check in APO :</b>
    ( see the following blog for the requirements class( Name in R3) or check mode( Name in APO) determination http://solution-timezone-issue.blogspot.com/ )
    The check mode and the business event( These are hardcode internally in R3 - For SD- A) are determined from the order and based on this in APO it follows the following order
    (1) Reads the check instructions settings in APO
    For example say the following have been determined from the SD Order : Check Mode 041 and  Business Event A
    Say we have maintained in APO that the first step is Availability Check and all the other two steps we havent maintained or left blank ( Product Allocation and Forecast)
    Look for the customizing in APO
    SPRO>APO>GATP>General Settings>Maintain Check Instructions ****
    (2) Carries out availability Checking same as in R3 and no different
    From the masterial master considers the availability checking group ( Ex: Z1) and the business event( SD transactions- A)
    Very Important and the core of availability checking which is similar in R3 and APO***
    Against these 2 combinations, the settings are checked which define what stock and in/outward movements are to be considered during the availability check
    For customzing settings in APO
    SPRO>APO>GATP>Maintain Check Control>
       For Customizing in R3
    SPRO>Sales and Distribution>Basic Functions>Availability Check and transfer of requirements>Availability check with ATP logic or planning>Carry out control for availability check
    This is the answer to your first question.
    Your second question would need some time  and I will try to answer it as well.
    Hope this helps you..

  • In testing 9 and X, "Compare Docs" we have a critical issue and really need help!

    For years we have used Acrobat 7 to do PDF compares and we love it!  However, the company recently advised we must upgrade to 9 and then eventually to X.  In testing 9 and X, Compare Docs we have a critical issue and really need help.  Our PDFs are produced by IT in a batch process and one of our main, critical functions is to compare previous PDFs to current PDFs;  however, in using 9 the Compare screen automatically sets the Doc Description for our PDFs to "Scanned Doc" and does not produce any differences! If you try to change the setting to Reports --it totally shuts down both documents without running!  Version 7 runs the compare of the same PDFs  beautifully, pointing out all the differences, as usual!  Has this every happen to anyone?  Do you know what we can do to our PDFs to allow version 9 to do the compare and produce results?  Why is 9 treating these non-scanned PDF docs as such?  Thanks so much for any help or insight you can give me on this issue! 

    (Moved the discussion to the correct forum)

  • Query Performance Issues

    Hi Gurus,
    I m woking on performance tuning at the moment and wants some tips
    regarding the Query performance tuning,if anyone can helpme in that
    rfrence.
    the thing is that i have got an idea about the system and now the
    issues r with DB space, Abap Dumps, problem in free space in table
    space, no number range buffering,cubes r using too many aggrigates,
    large IC,Large ODS, and many others.
    So my questionis that is anyone can tell me that how to resolve the
    issues with the Large master data tables,and large ODS,and one more
    importnat issue is KPI´s exceding there refrence valuses so any idea
    how to deal with them.
    waiting for the valuable responces.
    thanks In advance
    Redards
    Amit

    Hi Amit
    For Query performance issue u can go for :-
    Aggregates : They will help u a lot to make ur query faster becuase query doesnt hits ur cube it hits the aggregates which has very less number of records in comp to ur cube
    secondly i wud suggest u is use CKF in place of formulaes if any in the query
    other thing is avoid upto the extent possible the use fo nav attr . if u want to use them use it upto the minimal level reason i am saying so is during the query exec whn ever there is nav attr it provides unncessary  join to ur MD and thus dec query perfo
    be specifc to rows and columns if u r not sure of a kf or a char then better put it in a free char.
    use filters if possible
    if u follow these m sure ur query perfo will inc
    Assign points if applicable
    Thanks
    puneet

  • SQL query performance issues.

    Hi All,
    I worked on the query a month ago and the fix worked for me in test intance but failed in production. Following is the URL for the previous thread.
    SQL query performance issues.
    Following is the tkprof file.
    CURSOR_ID:76  LENGTH:2383  ADDRESS:f6b40ab0  HASH_VALUE:2459471753  OPTIMIZER_GOAL:ALL_ROWS  USER_ID:443 (APPS)
    insert into cos_temp(
    TRX_DATE, DEPT, PRODUCT_LINE, PART_NUMBER,
    CUSTOMER_NUMBER, QUANTITY_SOLD, ORDER_NUMBER,
    INVOICE_NUMBER, EXT_SALES, EXT_COS,
    GROSS_PROFIT, ACCT_DATE,
    SHIPMENT_TYPE,
    FROM_ORGANIZATION_ID,
    FROM_ORGANIZATION_CODE)
    select a.trx_date,
    g.segment5 dept,
    g.segment4 prd,
    m.segment1 part,
    d.customer_number customer,
    b.quantity_invoiced units,
    --       substr(a.sales_order,1,6) order#,
    substr(ltrim(b.interface_line_attribute1),1,10) order#,
    a.trx_number invoice,
    (b.quantity_invoiced * b.unit_selling_price) sales,
    (b.quantity_invoiced * nvl(price.operand,0)) cos,
    (b.quantity_invoiced * b.unit_selling_price) -
    (b.quantity_invoiced * nvl(price.operand,0)) profit,
    to_char(to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS'),'DD-MON-RR') acct_date,
    'DRP',
    l.ship_from_org_id,
    p.organization_code
    from   ra_customers d,
    gl_code_combinations g,
    mtl_system_items m,
    ra_cust_trx_line_gl_dist c,
    ra_customer_trx_lines b,
    ra_customer_trx_all a,
    apps.oe_order_lines l,
    apps.HR_ORGANIZATION_INFORMATION i,
    apps.MTL_INTERCOMPANY_PARAMETERS inter,
    apps.HZ_CUST_SITE_USES_ALL site,
    apps.qp_list_lines_v price,
    apps.mtl_parameters p
    where a.trx_date between to_date('2010/02/01 00:00:00','yyyy/mm/dd HH24:MI:SS')
    and to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS')+0.9999
    and   a.batch_source_id = 1001     -- Sales order shipped other OU
    and   a.complete_flag = 'Y'
    and   a.customer_trx_id = b.customer_trx_id
    and   b.customer_trx_line_id = c.customer_trx_line_id
    and   a.sold_to_customer_id = d.customer_id
    and   b.inventory_item_id = m.inventory_item_id
    and   m.organization_id
         = decode(substr(g.segment4,1,2),'01',5004,'03',5004,
         '02',5003,'00',5001,5002)
    and   nvl(m.item_type,'0') <> '111'
    and   c.code_combination_id = g.code_combination_id+0
    and   l.line_id = b.interface_line_attribute6
    and   i.organization_id = l.ship_from_org_id
    and   p.organization_id = l.ship_from_org_id
    and   i.org_information3 <> '5108'
    and   inter.ship_organization_id = i.org_information3
    and   inter.sell_organization_id = '5108'
    and   inter.customer_site_id = site.site_use_id
    and   site.price_list_id = price.list_header_id
    and   product_attr_value = to_char(m.inventory_item_id)
    call        count       cpu   elapsed         disk        query      current         rows    misses
    Parse           1      0.47      0.56           11          197            0            0         1
    Execute         1   3733.40   3739.40        34893    519962154           11          188         0
    total           2   3733.87   3739.97        34904    519962351           11          188         1
    |         Rows Row Source Operation
    | ------------ ---------------------------------------------------
    |          188 HASH JOIN (cr=519962149 pr=34889 pw=0 time=2607.35)
    |          741 .TABLE ACCESS BY INDEX ROWID QP_PRICING_ATTRIBUTES (cr=519939426 pr=34889 pw=0 time=2457.32)
    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)
    |          741 ....NESTED LOOPS (cr=50042 pr=7230 pw=0 time=11.37)
    |          741 .....NESTED LOOPS (cr=48558 pr=7229 pw=0 time=11.35)
    |          741 ......NESTED LOOPS (cr=47815 pr=7223 pw=0 time=11.32)
    |         3237 .......NESTED LOOPS (cr=41339 pr=7223 pw=0 time=12.42)
    |         3237 ........NESTED LOOPS (cr=38100 pr=7223 pw=0 time=12.39)
    |         3237 .........NESTED LOOPS (cr=28296 pr=7139 pw=0 time=12.29)
    |         1027 ..........NESTED LOOPS (cr=17656 pr=4471 pw=0 time=3.81)
    |         1027 ...........NESTED LOOPS (cr=13537 pr=4404 pw=0 time=3.30)
    |          486 ............NESTED LOOPS (cr=10873 pr=4240 pw=0 time=0.04)
    |          486 .............NESTED LOOPS (cr=10385 pr=4240 pw=0 time=0.03)
    |          486 ..............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_ALL (cr=9411 pr=4240 pw=0 time=0.02)
    |        75253 ...............INDEX RANGE SCAN RA_CUSTOMER_TRX_N5 (cr=403 pr=285 pw=0 time=0.38)
    |          486 ..............TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCOUNTS (cr=974 pr=0 pw=0 time=0.01)
    |          486 ...............INDEX UNIQUE SCAN HZ_CUST_ACCOUNTS_U1 (cr=488 pr=0 pw=0 time=0.01)
    |          486 .............INDEX UNIQUE SCAN HZ_PARTIES_U1 (cr=488 pr=0 pw=0 time=0.01)
    |         1027 ............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_LINES_ALL (cr=2664 pr=164 pw=0 time=1.95)
    |         2063 .............INDEX RANGE SCAN RA_CUSTOMER_TRX_LINES_N2 (cr=1474 pr=28 pw=0 time=0.22)
    |         1027 ...........TABLE ACCESS BY INDEX ROWID RA_CUST_TRX_LINE_GL_DIST_ALL (cr=4119 pr=67 pw=0 time=0.54)
    |         1027 ............INDEX RANGE SCAN RA_CUST_TRX_LINE_GL_DIST_N1 (cr=3092 pr=31 pw=0 time=0.20)
    |         3237 ..........TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=10640 pr=2668 pw=0 time=15.35)
    |         3237 ...........INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_U1 (cr=2062 pr=40 pw=0 time=0.33)
    |         3237 .........TABLE ACCESS BY INDEX ROWID OE_ORDER_LINES_ALL (cr=9804 pr=84 pw=0 time=0.77)
    |         3237 ..........INDEX UNIQUE SCAN OE_ORDER_LINES_U1 (cr=6476 pr=47 pw=0 time=0.43)
    |         3237 ........TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=3239 pr=0 pw=0 time=0.04)
    |         3237 .........INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=2 pr=0 pw=0 time=0.01)
    |          741 .......TABLE ACCESS BY INDEX ROWID HR_ORGANIZATION_INFORMATION (cr=6476 pr=0 pw=0 time=0.10)
    |         6474 ........INDEX RANGE SCAN HR_ORGANIZATION_INFORMATIO_FK2 (cr=3239 pr=0 pw=0 time=0.03)Please help.
    Regards
    Ashish

    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)There is no way the optimizer should choose to process that many rows using nested loops.
    Either the statistics are not up to date, the data values are skewed or you have some optimizer parameter set to none default to force index access.
    Please post explain plan and optimizer* parameter settings.

  • Critical Issues During SAP Implementation or After Golive

    Can anybody tell me one of  the most critical/ challenging issues During SAP Implementation or After Golive
    in these modules:-
    MM implementation
    PP implementation
    SD implementation
    FI/CO implementation
    PS implementation
    QM implementation
    HR implementation
    BI implementation
    XI implementation
    Thanks and regards
    RS

    hi,
    I will list out few of critical issues in
    Implementation :
    1 . Ensure 100% mapping of business process for all modules with SAP(avoid customization in support phase)
    2.  Unit & Integeration testing should be through with all validations
    3.  Master datas(Vendor,Customer) care must be taken will uploading datas thru LSMW,
    If there are common vendors for all plants,Create a vendor for a plant extend it to other plants
    4. Check tax procedures are customized according to requirements.
    5. Complete all print document customizations before go live
    6. Complete end user training(2 or more cycles) should be top priority before go live(This will avoid
    cancellation/reversal of documents after post go live)
    7. Ready with standard MIS reports & customized reports for business decision making
    8. Excise opening balance updation in tables for RG1 register in tables(Note 951955) on go live
    9. Check all tables datas are updating correctly
    10. Declare go live to SAP Support
    11. Check All user authorization should be correct according to their roles.
    12. Centeralize all master datas creation(avoid duplication)
    13. Create transaction variants to avoid entires in unnecessary fields & make certain fields mandatory.
    14. Ensure document numbering is completed for all documents
    15. Validate accounting entries are hit properly according to requirement in quality client with FI CTM(Core team member).
    After Go live :
    1. Missing authorization for users will play key part here,For ex : PGI while doing delivery,Excise capture & post in MIGO/J1IEX.
    2. Do internal audit every month,identify transactions if there will possibility for misuse or wrong entries,requires validation,identify users weak in certain areas.
    3. Identify there is enhancements to be done in transaction process(By step-2)
    4. Prepare a list of month & year end activities to be performed for all modules give to users
    5. Prepare  a list of frequently used transaction codes module wise give it to users
    6. If there is subcontracting,ensure challan creation,GR,reconcillation should be done regulary(monthly)
    7. Train the users,take reports in respective modules.
    8. Additonal customization might be done in print documents.
    9. Instruct users/CTM's to adapt SAP Standard practise
    10. Update excise tax rates after every indian budget
    Hope it helps.
    Edited by: Jeyakanthan A on Apr 29, 2010 6:48 PM

  • Critical Issues on CRM

    Hi, all can any one send me some critical issues related to crm marketing and internet sales and basecustomization. Plz send urgently.
    thanks in advance
    [email protected]

    Hi Vasanth,
    If you want to see the issues related to Marketing or Internet Sales.
    Just click on Search forum in SDN as Marketing or Internet Sales you can see the related issues questioned by various consultants.
    Regards,
    Johnny.

  • Critical issues in support

    hello
    please any body  send me some critical  issues and their solutions  which u faced in support desk. please kindly sent me its urgent
    thanks in advance
    guru
    [email protected]

    Hi Guru
    All the questions posted in the forum are practical issues only . You can select some of them sub module wise and present them to the interviewers.
    Good luck

  • Can any one share with me any two critical issues in DP support project

    Hello friends,
    I am new  to DP support project in SCM5.0 version,can any one share with  me my queries
    1.what is my support rolles and responsiblities .in DP
    2.can any one share with me any two critical issues in DP and how can you resole it

    Hi Sivaram,
    1. As a DP functional consultant you need to resolve all the incidents raised in APO DP module( Forecasting, lifecycle planning, master data in APO DP, Planning books, macros , release to APO SNP or R/3 or other systems, CVC maintenance etc) which will also include BW part of  SCM -APO related to DP, like data extraction and back up into and from infocubes. You will also support all the interfaces realted to APO DP , for the APO related part of the interface.
    You need to reoslve these incidents in the time frames defined by SLAs for the support project.
    You will have to also carry out problem management of some of the critical incidents so that incidents do not re-occur.
    Further you will have to support Release  /Change managment support( if it is part of your contract of Support project).
    This willl involve testing changes in quality system, before these are moved to production system.
    2 I found 2 crtical issues in APO DP support as below:
    2.1  Sales history extraction  data interafces from BW system used to have problems : technical problems of interface / jobs in BW running late, functional problems: sales history extract in BW not correct because various reasons 
      This used to lead to delayed job runs in APO and finally delayed forecasting and ptehr DP processes .
    By proactive monitoring by BW team and taking appropriate actions for master data issues, this issue occurance frequency was reduced , but not completely eliminated.
    2.2 Another major issue was related to back up process of APO DP planning data into infocubes. Finally by splitting the jobs as per daily, weekly and monthly bakc up procedure , we were able to resolve the issue.
    I hope I have answered your queries.
    Pleasse check and confirm.
    Regards
    Datta

  • Can u please give me two critical issues in app

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. >
    can u please tell me two critical issues in app and explain me how i can solve that critical issues.
    and also tell me two critical issues in account receivables or g/l accounting  and explain me how i can solve that critical issues

    There are no refunds.
    You can try contacting itunes support and asking for an exception:
    http://www.apple.com/support/contact/

Maybe you are looking for

  • Using 'Edit in' - Photoshop CC 2014, the program opens, but the file doesn't appear. Help!

    I have Adobe CC Photography (great value!).  I need to do some Photoshop editing of my pictures - principally Levels 0 and so use the 'Edit in' functionality. This has worked in the past; but today, Photoshop opens, but the file doesn't appear in the

  • How can I tackle error 4960 while downloading Master Collection CV5?

    I'm using a Macbook Pro. It took some 40 hours over 3 days to download CS5 (thorugh wifi) and at the end of it...it showed me the following error.... The following disc images could not be opened Image                                Reason MasterColl

  • Transferring Pages document to iWeb as a blog

    I have created a 3 page 'blog' in Pages 09 using 'Informal newsletter'; 'Photo collage'; and 'Insert 2 columns with sidebar' for successive sheets. I then tried to 'send to iWeb' using 'Pages' . A My blog icon appeared with Pages title & ipsum laurem

  • Can i use ipad wi-fi +cellular for phone calling?

    can i use ipad wi-fi +cellular for phone calling?

  • IPhone 4 issues

    I have been having some minor issues with my phone and I was trying to see if anyone else gets it. One is sometimes usually on my first text message to someone when the text enters the sent box the bubble will blink. Also sometimes when I send a text