OAM 11g R2- Performance issue /oam/auth/cred

Hi Guys,
we are facing issues regarding oam performance we are seeing unusual time delay on load, at submission of /oam/auth/cred to the landing page. we have 2 managed server having 2gb of heap size.
Any pointers will really helpful.
Regards
975200

Hi 975200,
This error occurs during login, if some credentials or request ID is not provided in post data. Your issue is because of performance issue only.
Try increasing cache size: OAM Console --> Access Manager --> Access Manager Settings --> Try increasing Resource Matching cache
Check Session Count: Check number of sessions present while running load run, which gives actual users successfully logging in.
Which tool you are using for performance test?
What are server usages during test? (all servers)
Try to login manually during test and check if you are able to login or not?
Thanks & Regards,
Chinni Ravitheja

Similar Messages

  • Oracle 11g Migration performance issue

    Hello,
    There a performance issue with Migration from Oracle 10g(10.2.0.5) to Oracle 11g(11.2.0.2).
    Its very simple statement hanging for more than a day and later found that query plan is very very bad. Example of the query is given below:
    INSERT INTO TABLE_XYZ
    SELECT F1,F2,F3
    FROM TABLE_AB, TABLE_BC
    WHERE F1=F4;
    While looking at cost in Explain plan :
    on 10g --> 62567
    0n 11g --> 9879652356776
    Strange thing is that
    Scenario 1: if I issue just query as shown below, will display rows immediately :
    SELECT F1,F2,F3
    FROM TABLE_AB, TABLE_BC
    WHERE F1=F4;
    Scenario 2: If I create a table as shown below, will work correctly.
    CREATE TABLE TABLE_XYZ AS
    SELECT F1,F2,F3
    FROM TABLE_AB, TABLE_BC
    WHERE F1=F4;
    What could be the issue here with INSERT INTO <TAB> SELECT <COL> FROM <TAB1>?

    Table:
    CREATE TABLE AVN_WRK_F_RENEWAL_TRANS_T
    "PKSRCSYSTEMID" NUMBER(4,0) NOT NULL ENABLE,
    "PKCOMPANYCODE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
    "PKBRANCHCODE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
    "PKLINEOFBUSINESS" NUMBER(4,0) NOT NULL ENABLE,
    "PKPRODUCINGOFFICELIST" VARCHAR2(2 CHAR) NOT NULL ENABLE,
    "PKPRODUCINGOFFICE" VARCHAR2(8 CHAR) NOT NULL ENABLE,
    "PKEXPIRYYR" NUMBER(4,0) NOT NULL ENABLE,
    "PKEXPIRYMTH" NUMBER(2,0) NOT NULL ENABLE,
    "CURRENTEXPIRYCOUNT" NUMBER,
    "CURRENTRENEWEDCOUNT" NUMBER,
    "PREVIOUSEXPIRYCOUNT" NUMBER,
    "PREVIOUSRENEWEDCOUNT" NUMBER
    SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
    TABLESPACE "XYZ" ;
    Explain Plan(With Insert Statement and Query):_
    INSERT STATEMENT, GOAL = ALL_ROWS               Cost=9110025395866     Cardinality=78120     Bytes=11952360
    LOAD TABLE CONVENTIONAL     Object owner=ODS     Object name=AVN_WRK_F_RENEWAL_TRANS               
    NESTED LOOPS OUTER               Cost=9110025395866     Cardinality=78120     Bytes=11952360
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_WRK_F_RENEWAL_TRANS_1ST     Cost=115     Cardinality=78120     Bytes=2499840
    VIEW PUSHED PREDICATE     Object owner=ODS          Cost=116615788     Cardinality=1     Bytes=121
    SORT GROUP BY               Cost=116615788     Cardinality=3594     Bytes=406122
    VIEW     Object owner=SYS     Object name=VW_DAG_1     Cost=116615787     Cardinality=20168     Bytes=2278984
    SORT GROUP BY               Cost=116615787     Cardinality=20168     Bytes=4073936
    NESTED LOOPS OUTER               Cost=116614896     Cardinality=20168     Bytes=4073936
    VIEW     Object owner=SYS          Cost=5722     Cardinality=20168     Bytes=2157976
    NESTED LOOPS               Cost=5722     Cardinality=20168     Bytes=2097472
    HASH JOIN               Cost=924     Cardinality=1199     Bytes=100716
    NESTED LOOPS                         
    NESTED LOOPS               Cost=181     Cardinality=1199     Bytes=80333
    TABLE ACCESS BY INDEX ROWID     Object owner=ODS     Object name=INWARDSPOLICYDETAILS     Cost=159     Cardinality=1199     Bytes=39567
    INDEX RANGE SCAN     Object owner=ODS     Object name=IX_INWPOLDTLS_SYSCOMPANYBRANCH     Cost=7     Cardinality=1199     
    INDEX UNIQUE SCAN     Object owner=ODS     Object name=PK_AVN_D_MASTERPOLICYDETAILS     Cost=0     Cardinality=1     
    TABLE ACCESS BY INDEX ROWID     Object owner=ODS     Object name=AVN_D_MASTERPOLICYDETAILS     Cost=1     Cardinality=1     Bytes=34
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYLOBMAPPING     Cost=741     Cardinality=288498     Bytes=4904466
    VIEW PUSHED PREDICATE     Object owner=ODS          Cost=4     Cardinality=1     Bytes=20
    FILTER                         
    SORT AGGREGATE                    Cardinality=1     Bytes=21
    TABLE ACCESS BY GLOBAL INDEX ROWID     Object owner=ODS     Object name=AVN_F_TRANSACTIONS     Cost=4     Cardinality=1     Bytes=21
    INDEX RANGE SCAN     Object owner=ODS     Object name=PK_AVN_F_TRANSACTIONS     Cost=3     Cardinality=1     
    VIEW PUSHED PREDICATE     Object owner=ODS          Cost=5782     Cardinality=1     Bytes=95
    SORT GROUP BY               Cost=5782     Cardinality=2485     Bytes=216195
    VIEW     Object owner=SYS     Object name=VW_DAG_0     Cost=5781     Cardinality=2485     Bytes=216195
    SORT GROUP BY               Cost=5781     Cardinality=2485     Bytes=278320
    HASH JOIN               Cost=5780     Cardinality=2485     Bytes=278320
    VIEW     Object owner=SYS     Object name=VW_GBC_15     Cost=925     Cardinality=1199     Bytes=73139
    SORT GROUP BY               Cost=925     Cardinality=1199     Bytes=100716
    HASH JOIN               Cost=924     Cardinality=1199     Bytes=100716
    NESTED LOOPS                         
    NESTED LOOPS               Cost=181     Cardinality=1199     Bytes=80333
    TABLE ACCESS BY INDEX ROWID     Object owner=ODS     Object name=INWARDSPOLICYDETAILS     Cost=159     Cardinality=1199     Bytes=39567
    INDEX RANGE SCAN     Object owner=ODS     Object name=IX_INWPOLDTLS_SYSCOMPANYBRANCH     Cost=7     Cardinality=1199     
    INDEX UNIQUE SCAN     Object owner=ODS     Object name=PK_AVN_D_MASTERPOLICYDETAILS     Cost=0     Cardinality=1     
    TABLE ACCESS BY INDEX ROWID     Object owner=ODS     Object name=AVN_D_MASTERPOLICYDETAILS     Cost=1     Cardinality=1     Bytes=34
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYLOBMAPPING     Cost=741     Cardinality=288498     Bytes=4904466
    VIEW     Object owner=SYS     Object name=VW_GBF_16     Cost=4854     Cardinality=75507     Bytes=3850857
    SORT GROUP BY               Cost=4854     Cardinality=75507     Bytes=2340717
    VIEW     Object owner=ODS          Cost=4207     Cardinality=75507     Bytes=2340717
    SORT GROUP BY               Cost=4207     Cardinality=75507     Bytes=1585647
    PARTITION HASH ALL               Cost=3713     Cardinality=75936     Bytes=1594656
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_F_TRANSACTIONS     Cost=3713     Cardinality=75936     Bytes=1594656
    Explain Plan(Only Query):_
    SELECT STATEMENT, GOAL = ALL_ROWS               Cost=62783     Cardinality=89964     Bytes=17632944
    HASH JOIN OUTER               Cost=62783     Cardinality=89964     Bytes=17632944
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_WRK_F_RENEWAL_TRANS_1ST     Cost=138     Cardinality=89964     Bytes=2878848
    VIEW     Object owner=ODS          Cost=60556     Cardinality=227882     Bytes=37372648
    HASH GROUP BY               Cost=60556     Cardinality=227882     Bytes=26434312
    VIEW     Object owner=SYS     Object name=VW_DAG_1     Cost=54600     Cardinality=227882     Bytes=26434312
    HASH GROUP BY               Cost=54600     Cardinality=227882     Bytes=36005356
    HASH JOIN OUTER               Cost=46664     Cardinality=227882     Bytes=36005356
    VIEW     Object owner=SYS          Cost=18270     Cardinality=227882     Bytes=16635386
    HASH JOIN               Cost=18270     Cardinality=227882     Bytes=32587126
    HASH JOIN               Cost=12147     Cardinality=34667     Bytes=2912028
    HASH JOIN               Cost=10076     Cardinality=34667     Bytes=2322689
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_D_MASTERPOLICYDETAILS     Cost=137     Cardinality=34667     Bytes=1178678
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYDETAILS     Cost=9934     Cardinality=820724     Bytes=27083892
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYLOBMAPPING     Cost=741     Cardinality=866377     Bytes=14728409
    VIEW     Object owner=ODS          Cost=5195     Cardinality=227882     Bytes=13445038
    HASH GROUP BY               Cost=5195     Cardinality=227882     Bytes=4785522
    PARTITION HASH ALL               Cost=3717     Cardinality=227882     Bytes=4785522
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_F_TRANSACTIONS     Cost=3717     Cardinality=227882     Bytes=4785522
    VIEW     Object owner=ODS          Cost=26427     Cardinality=227882     Bytes=19369970
    HASH GROUP BY               Cost=26427     Cardinality=227882     Bytes=18686324
    VIEW     Object owner=SYS     Object name=VW_DAG_0     Cost=26427     Cardinality=227882     Bytes=18686324
    HASH GROUP BY               Cost=26427     Cardinality=227882     Bytes=25294902
    HASH JOIN               Cost=20687     Cardinality=227882     Bytes=25294902
    VIEW     Object owner=SYS     Object name=VW_GBC_15     Cost=12826     Cardinality=34667     Bytes=2080020
    HASH GROUP BY               Cost=12826     Cardinality=34667     Bytes=2912028
    HASH JOIN               Cost=12147     Cardinality=34667     Bytes=2912028
    HASH JOIN               Cost=10076     Cardinality=34667     Bytes=2322689
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_D_MASTERPOLICYDETAILS     Cost=137     Cardinality=34667     Bytes=1178678
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYDETAILS     Cost=9934     Cardinality=820724     Bytes=27083892
    TABLE ACCESS FULL     Object owner=ODS     Object name=INWARDSPOLICYLOBMAPPING     Cost=741     Cardinality=866377     Bytes=14728409
    VIEW     Object owner=SYS     Object name=VW_GBF_16     Cost=7059     Cardinality=227882     Bytes=11621982
    HASH GROUP BY               Cost=7059     Cardinality=227882     Bytes=6836460
    VIEW     Object owner=ODS          Cost=5195     Cardinality=227882     Bytes=6836460
    HASH GROUP BY               Cost=5195     Cardinality=227882     Bytes=4785522
    PARTITION HASH ALL               Cost=3717     Cardinality=227882     Bytes=4785522
    TABLE ACCESS FULL     Object owner=ODS     Object name=AVN_F_TRANSACTIONS     Cost=3717     Cardinality=227882     Bytes=4785522

  • Database migrated from Oracle 10g to 11g Discoverer report performance issu

    Hi All,
    We are now getting issue in Discoverer Report performance as the report is keep on running when database got upgrade from 10g to 11g.
    In database 10g the report is working fine but the same report is not working fine in 11g.
    The query i have changed as I have passed the date format TO_CHAR("DD-MON-YYYY" and removed the NVL & TRUNC function from the existing query.
    The report is now working fine in Database 11g backhand but when I am using the same query in Discoverer it is not working and report is keep on running.
    Please advise.
    Regards,

    Pl post exact OS, database and Discoverer versions. After the upgrade, have statistics been updated ? Have you traced the Discoverer query to determine where the performance issue is ?
    How To Find Oracle Discoverer Diagnostic and Tracing Guides [ID 290658.1]
    How To Enable SQL Tracing For Discoverer Sessions [ID 133055.1]
    Discoverer 11g: Performance degradation after Upgrade to Database 11g [ID 1514929.1]
    HTH
    Srini

  • Crystal Reports 11g Performance Issue

    We just upgraded our database to Oracle 11g from Oracle 10g and we are having significant performance issues with Crystal Reports.
    Our DEV and TEST environments are on 11g and are very slow to connect to the database and attach to specific tables.  It is unusable.  Our PROD environment is still 10g and works fine.  
    We  have tested with both the lastest version -  Crystal Reports 2008 V1  and  Crystal Reports XI R2 SP6.  We have also tested on several different machines.
    We are using Oracle 10g ODBC drivers.
    Does anyone have any recommendations?

    You could also try our Data direct drivers we have available on our WEB site using this [link|https://smpdl.sap-ag.de/~sapidp/012002523100008666562008E/cr_datadirect53_win32.zip].
    Those drivers are the most recent and do support 11g. It also has a wired driver that doesn't require the client to be installed.
    Also, highly recommended that when you do update the Oracle client to uninstall 10 first. There have been issues with CR and Oracle mixing the Oracle dependencies and causing problems.
    Thank you
    Don

  • Oracle BPEL 11G performance issue

    Hi
    We are facing performance issues in executing our composite process in Oracle SOA 11g .
    We have installed an admin server and 2 managed servers in cluster in same box. The machine utilization reached almost 95% when i started the admin server and 2 managed server (min n max size of heap given as 1GB each in start up). So i shut down one managed server and increased the JVM size of other to 2 GB and found that the heap size reaches 1.5 GB on start up (observed the heap size using Jconsole)
    The machine capacity is windows server with 4 GB RAM.
    Our process requries multiple records to be processed which are retrieved using Database query.
    We have created 2 composites
    the first composite has 2 BPEL process. the First BPEL 1 executes the DB query and retrieves the result and based on result retrieved we invoke the second BPEL2
    which does around 4 DB calls and passed the result to the next composite. The final BPEL process 3 has multiple select and update query involving DB intensive process.
    When we retrieve 500 records from the BPEL 1 and process , half way through we face out of memory exception. So we are using throttling but even then while executing the process of BPEL3 we are facing out of memory excetion.
    Can you let me know how to find the memory space taken from heap by each BPEL process during it execution. Where in console can i get the memory used details so that i can find which BPEL sis consuming more memory and we can work on optimising.
    Actually we are expecting around 1Lakh and above messages per day and need to check on how this process can handle and also how to increase or determine the capacity of the windows box.
    any immediate help is highly appreciated
    thanks

    Always raise a case with Oracle Support for such issues.
    Regards,
    Anuj

  • Performance issue with Crystal when upgrading Oracle to 11g

    Dear,
    I am facing performance issue in crystal report and oracle 11g as below:
    In ther report server, I have created a ODBC for connect to another Oracle 11g server. also in report server I have created and published a folder to content all of my crystal report. These report can connect to oracle 11g server via ODBC.
    and I have a tomcat server to run my application in my application I refer to report folder in report server.
    This way can work with SQL server and oracle 9 or 10g but it facing performance issue in oracle 11g.
    please let me know the root cause.
    Notes: report server, tomcate server are win 32bit, but oracle is in win 64bit, and i have upgraded DataDirect connect ODBC version 6.1 but the issue can not resolve.
    Please help me to solve it.
    Thanks so much,
    Anh

    Hi Anh,
    Use a third party ODBC test tool now. SQL Plus will be using the Native Oracle client so you can't compare performance.
    Download our old tool called SQLCON: https://smpdl.sap-ag.de/~sapidp/012002523100006252882008E/sqlcon32.zip
    Connect and then click on the SQL tab and paste in the SQL from the report and time that test.
    I believe the issue is because the Oracle client is 64 bit, you should install the 32 bit Oracle Client. If using the 64 bit client then the client must thunk ( convert 64 bit data to 32 bit data format ) which is going to take more time.
    If you can use OLE DB or using the Oracle Server driver ( native driver ) should be faster. ODBC puts another layer on top of the Oracle client so it too takes time to communicate between the layers.
    Thank you
    Don

  • Performance Issue After Moving To 11g From 9i

    We have a process that inserts approximately 275,000 records into a table containing 22,000,000+ records. This process consistently runs in 1 hour and 20 minutes in our Oracle 9i Database (Standard Edition). This same process runs in 8+ hours in our Oracle 11g Database (Standard Edition) which is a copy of the Oracle 9i Database.
    Both databases run on identical hardware running Windows Server 2000. The Servers each have 2 GB RAM.
    We have noticed that the process in 11g slows down significantly after it has been running for about 30 minutes and is continuously consuming memory. We also ran a test in which we dropped all indexes on the table being inserted into except the primary key and the process still ran for 8+ hours again.
    We executed another test in which the same process was run however we had it insert into a table that contained 0 records and our performance was better than on the 9i Database.
    Any ideas on what might be causing the performance issue?

    Welcome to the forums !
    Troubleshooting performance issues is difficult when all of the factual data is absent. Pl review these threads to identify information that you need to post in order to help you.
    When your query takes too long:
    HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long ...
    HTH
    Srini

  • Performance issues after upgrading to 11g

    hello,
    We are facing a performance issue after upgrading from 10g to 11g.
    as you can see, the tables named APPLSYS.FND_ENV_CONTEXT has grown to 15544880 records,
    and oracle is using TABLE ACCESS FULL on it:
    DELETE FND_ENV_CONTEXT E
    WHERE NOT EXISTS
    (SELECT 'X'
    FROM FND_CONCURRENT_PROCESSES P
    WHERE P.CONCURRENT_PROCESS_ID = E.CONCURRENT_PROCESS_ID)
    AND ROWNUM < 10000;
    Plan:
    DELETE STATEMENT ALL_ROWSCost: 74,345                     
         5 DELETE APPLSYS.FND_ENV_CONTEXT                
              4 COUNT STOPKEY           
                   3 HASH JOIN RIGHT ANTI Cost: 74,345 Bytes: 3,108,980 Cardinality: 155,449      
                        1 INDEX FULL SCAN INDEX (UNIQUE) APPLSYS.FND_CONCURRENT_PROCESSES_U1 Cost: 166 Bytes: 315,450 Cardinality: 63,090
                        2 TABLE ACCESS FULL TABLE APPLSYS.FND_ENV_CONTEXT Cost: 69,124 Bytes: 233,173,200 Cardinality: 15,544,880
    select num_rows,last_analyzed from dba_tables where table_name='FND_ENV_CONTEXT'
    15544880 07/07/2011 12:08:55
    please advice.
    Ofer

    Please see these docs.
    Table Fnd_env_context Growing Very Fast [ID 419990.1]
    FND Related Tablespaces Growing at Rapid and Excessive Rate [ID 189800.1]
    FNDCPPUR Request Does Not Always Delete Files From The File System, Many Files Will Be Denoted As "deletion failed" [ID 1335304.1]
    Concurrent Processing - Best Practices for Performance for Concurrent Managers in E-Business Suite [ID 1057802.1]
    Concurrent Processing - Purge Concurrent Request and/or Manager Data Program (FNDCPPUR) [ID 104282.1]
    Thanks,
    Hussein

  • Oracle Advance Compression Deletion Performance issue in 11g R1

    Hi,
    We have implemented OAC in our datawarehouse environment to enable table and index compression. We tested in our Test machine and we gained almost 600GB due to advance compression without any issues and all the informatica loads are running fine. And hence we implemented the same in our production but unfortunately two sessions which are involving deletion of data are taking more time (3 times of actual timing) for completion which affects our production environment.
    The tables creating issue are all non partitioned tables.
    I need to know whether Oracle Advance Compression will decrease delete performance? and is there any way to disable advance compression on those particular tables?
    Our environment details:
    DB earlier version: 11.1.0.6
    DB current version : Oracle 11.1.0.7
    Applied PSU: 11.1.0.7.6
    Operating system: Solaris 5.9
    Syntax used for compression:
    ALTER TABLE TABLE_NAME MOVE COMPRESS FOR ALL OPERATIONS;
    Thanks in Advance.

    Hi,
    Thanks for your reply.
    The note is for update performance issue and also I have applied necessary patches for improving update performance.
    The update sessions are all working fine. only the deletion sessions are creating problem.
    Could someone help me out to clear this problem.
    Thanks,
    VBK

  • Oracle SOA 11g Performance Issue

    Hi,
    We have set up Oracle SOA Suite on AIX environment. Java which we are using is IBM Jdk 1.6. Recently we are hit with performance issue. Frequently we are getting out of memory exception and we need to restart the server and sometimes physically reboot the machine, because out of 16 GB of RAM 4GB we have given as heap space to Admin Server, 7 GB to SOA Server but it is taking more than 7 GB as heap space. On stopping or killing both the services memory is not getting released
    SOA Suite Version : 11.1.1.3
    Instance Node: Single Node
    I collected the logs and tried to analyze in Thread Dump Analyzer and i could see objects(Reserved) is taking 100% of the CPU Utilization.
    We are getting the following error highlighed in the analyzer. There are about 200+ threads got stuck.
    "HTTPThreadGroup-42" prio=10 tid=0x6382ba28 nid=0x20bf4 waiting on condition [0x6904f000..0x6904fb94]
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:146)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireNanos(AbstractQueuedSynchronizer.java:772)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireNanos(AbstractQueuedSynchronizer.java:1087)
    at java.util.concurrent.SynchronousQueue$Node.waitForPut(SynchronousQueue.java:291)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:443)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:475)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:674)
    at java.lang.Thread.run(Thread.java:595)
    "HTTPThreadGroup-41" prio=10 tid=0x6ae3cce0 nid=0x20bf0 waiting on condition [0x68d8f000..0x68d8fc14]
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:146)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireNanos(AbstractQueuedSynchronizer.java:772)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireNanos(AbstractQueuedSynchronizer.java:1087)
    at java.util.concurrent.SynchronousQueue$Node.waitForPut(SynchronousQueue.java:291)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:443)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:475)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:674)
    at java.lang.Thread.run(Thread.java:595)
    Has anyone faced same issue? We are badly hit with this performance issue in UAT
    Please concider this on high priority and someone please help us
    Regards,
    Sundar

    Always raise a case with Oracle Support for such issues.
    Regards,
    Anuj

  • OBIEE 11g: SAML SSO performance issues

    Hi All,
    We have implemented IDP initiated SAML2-SSO with SQL Authenticator to get user/group information.
    After implementing this we see following issues:
    1. Login time takes around 1 minute. In nqserver.log file I can see following message:
    [2014-12-22T12:55:09.000-05:00] [OracleBIServerComponent] [NOTIFICATION:1] [] [] [ecid: 0000Kdn8fzjFO99_ndL6iZ1Ka4_f0000FW,0:1:1:6] [tid: 1594] User 'BISystemUser(XXXX)' spent 28720.000000 milliseconds for http response when impersonateUserWithLanguageAndProperties
    2. General navigation through application is also slow.
    Can you please provide any pointers to fix these performance issues?
    Thanks,
    Mahipal

    I am experiencing performance issues with view selector. It repeats the SQL for each view resulting in duplicate SQL to be run and thus resulting in poor performance of reports. Is this an expected behavior of view selector?
    Thanks.

  • Comples SQL performance issues in 11g

    We are facing Performance Issues for a Complex SQL in Version 11.2. But earlier in 11.1 this SQL is performing well..
    We dont have previous versions SQL Plan for this SQL Statement.
    We Dont want to rewrite the SQL as this SQL has performed Well in previous versions.
    Do we need to change the optimizer parameters so that the Query will be tuned automatically.
    Please help me out

    If you're licensed for the SQL Tuning Pack, you could run the query through the SQL Tuning Advisor see if it can improve.
    It will probably recommend a SQL profile which you can accept.
    You could also hint the SQL directly - you might just want to look at /*+ OPT_PARAM('OPTIMIZER_FEATURES_ENABLE','11.1.0.x') */ 'x' depending on your exact 11.1 version.
    You could alter the session, set optimizer_features_enable and capture a SQL profile manually for the 11.1 plan.
    You could do some root cause analysis as suggested by Karthick.
    See threads:
    How to post a SQL tuning request: HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long: When your query takes too long ...
    For some recent relevant examples about identifying plans changes following upgrade, see also Coskan Gundogar's blog:
    http://coskan.wordpress.com/2011/02/14/plan-stability-through-upgrade-why-is-my-plan-changed-bugfixes-1/
    http://coskan.wordpress.com/2011/02/15/plan-stability-through-upgrade-why-is-my-plan-changed-bugfixes-2/
    http://coskan.wordpress.com/2011/02/17/plan-stability-through-upgrade-why-is-my-plan-changed-new-optimizer-parameters/

  • Performance issues with class loader on Windows server

    We are observing some performance issues in our application. We are Using weblogic 11g with Java6 on a windows 2003 server
    The thread dumps indicate many threads are waiting in queue for the native file methods:
    "[ACTIVE] ExecuteThread: '106' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE
         java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
         java.io.File.exists(Unknown Source)
         weblogic.utils.classloaders.ClasspathClassFinder.getFileSource(ClasspathClassFinder.java:398)
         weblogic.utils.classloaders.ClasspathClassFinder.getSourcesInternal(ClasspathClassFinder.java:347)
         weblogic.utils.classloaders.ClasspathClassFinder.getSource(ClasspathClassFinder.java:316)
         weblogic.application.io.ManifestFinder.getSource(ManifestFinder.java:75)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.application.utils.CompositeWebAppFinder.getSource(CompositeWebAppFinder.java:71)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.CodeGenClassFinder.getSource(CodeGenClassFinder.java:33)
         weblogic.utils.classloaders.GenericClassLoader.findResource(GenericClassLoader.java:210)
         weblogic.utils.classloaders.GenericClassLoader.getResourceInternal(GenericClassLoader.java:160)
         weblogic.utils.classloaders.GenericClassLoader.getResource(GenericClassLoader.java:182)
         java.lang.ClassLoader.getResourceAsStream(Unknown Source)
         javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
         javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
         javax.xml.parsers.FactoryFinder.find(Unknown Source)
         javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
         org.ajax4jsf.context.ResponseWriterContentHandler.<init>(ResponseWriterContentHandler.java:48)
         org.ajax4jsf.context.ViewResources$HeadResponseWriter.<init>(ViewResources.java:259)
         org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:445)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
         org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
    On googling this seems to be an issue with java file handling on windows servers and I couldn't find a solution yet. Any recommendation or pointer is appreciated

    Hi shubhu,
    I just analyzed your partial Thread Dump data, the problem is that the ajax4jsf framework ResponseWriterContentHandler triggers internally a new instance of the DocumentBuilderFactory; every time; triggering heavy IO contention because of Class loader / JAR file search operations.
    Too many of these IO operations under heavy load will create excessive contention and severe performance degradation; regardless of the OS you are running your JVM on.
    Please review the link below and see if this is related to your problem.. This is a known issue in JBOSS JIRA when using RichFaces / ajaxJSF.
    https://issues.jboss.org/browse/JBPAPP-6166
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Performance Issue For Opening And Closing Balance In FBL1N/3N/5N

    Dear experts,
                        I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N.
    For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...With Related BAPI
    *   IF SY-TCODE = 'FBL1N'.
    *    LOOP AT ct_items INTO gs_items.
    *      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    *        EXPORTING
    *          date      = gs_items-budat
    *          days      = '01'
    *          months    = '00'
    *          signum    = '-'
    *          years     = '00'
    *        IMPORTING
    *          calc_date = lv_date.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = lv_date
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         =  lv_obal.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = gs_items-budat
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         = lv_cbal
    *      READ TABLE lv_cbal INTO gs_cbal INDEX 1.
    *      gs_items-cbal = gs_cbal-lc_bal.
    *      READ TABLE lv_obal INTO gs_obal INDEX 1.
    *      gs_items-obal = gs_obal-lc_bal.
    *      MODIFY ct_items FROM gs_items TRANSPORTING obal cbal.
    *      CLEAR: gs_items,gs_obal,gs_cbal.
    *    ENDLOOP.
    *   ENDIF.
    So, Above Code Causing Me the Performance Issue, Kindly Suggest Me the Solution..
    Regards,
    uday.

    Hi Uday,
    I am sending you the code i used for the creation a Zreport based on FBL5N. Please check if it can of any help.
    *& Report  ZFBL5N                                                      *
    REPORT  zfbl5n_new  .
    TABLES : bsid,knc1,lfc1.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_bsid,
              bukrs TYPE bsid-bukrs,
              kunnr TYPE bsid-kunnr,
              belnr TYPE bsid-belnr,
              buzei TYPE bsid-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              bschl TYPE bsid-bschl,
              shkzg TYPE bsid-shkzg,
              dmbtr TYPE bsid-dmbtr,
              augdt TYPE bsid-augdt,
              augbl TYPE bsid-augbl,
              zuonr TYPE bsid-zuonr,
              sgtxt TYPE bsid-sgtxt,
              zfbdt TYPE bsid-zfbdt,
              zterm TYPE bsid-zterm,
              zbd1t TYPE bsid-zbd1t,
              zbd2t TYPE bsid-zbd2t,
              zbd3t TYPE bsid-zbd3t,
              kkber TYPE bsid-kkber,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsid.
    TYPES: BEGIN OF ty_bsik,
             bukrs TYPE bsik-bukrs,
              lifnr TYPE bsik-lifnr,
              belnr TYPE bsik-belnr,
              buzei TYPE bsik-buzei,
              bldat TYPE bsik-bldat,
              blart TYPE bsik-blart,
              bschl TYPE bsik-bschl,
              shkzg TYPE bsik-shkzg,
              dmbtr TYPE bsik-dmbtr,
              augdt TYPE bsik-augdt,
              augbl TYPE bsik-augbl,
              zuonr TYPE bsik-zuonr,
              sgtxt TYPE bsik-sgtxt,
               zfbdt TYPE bsik-zfbdt,
    *         KKBER TYPE bsik-kkber,
              zterm TYPE bsik-zterm,
               zbd1t TYPE bsik-zbd1t,
              zbd2t TYPE bsik-zbd2t,
              zbd3t TYPE bsik-zbd3t,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsik.
    TYPES: BEGIN OF ty_final,
              belnr TYPE bsid-belnr,
    *         buzei TYPE bsak-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              chq TYPE bsid-zuonr,
              debit TYPE bsid-dmbtr,
              credit TYPE bsid-dmbtr,
              txt TYPE bsid-sgtxt,
              date TYPE bsid-zfbdt,
              kkber TYPE bsid-kkber,
              zterm TYPE bsid-zterm,
              augbl TYPE bsid-augbl,
              augdt TYPE bsid-augdt,
              flag TYPE c,
            END OF ty_final.
    TYPES : BEGIN OF gs_openbal,
              bukrs TYPE bapi3007_2-comp_code,
              kunnr TYPE bapi3007_2-customer,
              dmbtr TYPE bapi3007_2-lc_amount,
             END OF gs_openbal.
    DATA: it_bsid TYPE STANDARD TABLE OF ty_bsid,
           it_bsik TYPE STANDARD TABLE OF ty_bsik,
           it_final TYPE STANDARD TABLE OF ty_final.
    DATA: wa_bsid TYPE ty_bsid,
           wa_bsik TYPE ty_bsik,
           wa_final TYPE ty_final.
    DATA: w_days TYPE t5a4a-dlydy,
           w_month TYPE t5a4a-dlymo,
           w_year TYPE t5a4a-dlyyr,
           w_date TYPE p0001-begda,
           w_name1 TYPE kna1-name1,
           w_ort01 TYPE kna1-ort01,
           w_lifnr TYPE kna1-lifnr,
           w_dmbtr1 TYPE bsid-dmbtr,
           w_dmbtr2 TYPE bsid-dmbtr,
           w_dmbtr3 TYPE bsad-dmbtr,
           w_dmbtr4 TYPE bsad-dmbtr,
           w_opbal TYPE bsid-dmbtr,
           w_credit TYPE bsik-dmbtr,
           w_debit TYPE bsik-dmbtr,
           w_clobal TYPE bsik-dmbtr,
           w_credit1 TYPE bsik-dmbtr,
           w_debit1 TYPE bsik-dmbtr,
           w_clobal1 TYPE bsik-dmbtr.
    DATA: ld_yrper LIKE rwcoom-fiscper,
           kunnr LIKE kna1-kunnr,
           x_norm TYPE c,
           x_park,
           x_apar,
           x_merk,
           ok_code(4),
           wa_x001 LIKE x001,
           return LIKE bapireturn,
           line_count LIKE sy-loopc,
           number_of_records TYPE i,
           xindex LIKE sy-tabix,
           open LIKE knc1-um01s,
           temp(20),
           close LIKE knc1-um01s,
           gjahr LIKE bsid-gjahr,
           period LIKE bkpf-monat,
           f(1),
           v_char(2),
           closec(20),
           openc(20),
           debit LIKE bapi3007_2-lc_amount,
           credit LIKE debit.
    DATA : v_dmbtr LIKE bsid-dmbtr.
    *DATA : tot_debit LIKE t_ar-debit,
    *       tot_credit LIKE t_ar-credit.
    DATA : t_kna1 LIKE kna1 OCCURS 1  WITH HEADER LINE,
            t_knb1 LIKE knb1 OCCURS 10 WITH HEADER LINE.
    DATA ibsid LIKE bsid OCCURS 0 WITH HEADER LINE.
    DATA ibsad LIKE bsad OCCURS 0 WITH HEADER LINE.
    DATA ibsik LIKE bsik OCCURS 0 WITH HEADER LINE.
    DATA ibsak LIKE bsak OCCURS 0 WITH HEADER LINE.
    DATA : it_fieldcat_alv   TYPE slis_t_fieldcat_alv,
            wa_fieldcat_alv     TYPE slis_fieldcat_alv,
            is_layout_alv  TYPE slis_layout_alv,
            wa_layout_alv  TYPE slis_layout_alv,
            it_list_top_of_page TYPE slis_t_listheader,
            it_events TYPE slis_t_event,
            wa_events TYPE LINE OF slis_t_event.
    DATA : BEGIN OF ibukrs OCCURS 0,
               bukrs LIKE t001-bukrs,
              END OF ibukrs.
    DATA : BEGIN OF ikunnr1 OCCURS 0,
              kunnr LIKE knc1-kunnr,
             END OF ikunnr1.
    DATA : BEGIN OF ikunnr OCCURS 0,
               kunnr LIKE knc1-kunnr,
               bukrs LIKE t001-bukrs,
               lifnr LIKE lfc1-lifnr,
              END OF ikunnr.
    DATA: it_sort TYPE slis_t_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    DATA:    r_bschl TYPE RANGE OF bschl,
              wa_bschl LIKE LINE OF r_bschl.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_kunnr TYPE bsid-kunnr OBLIGATORY,
                  p_bukrs TYPE bsid-bukrs OBLIGATORY.
    SELECT-OPTIONS: so_budat FOR bsid-budat .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : p_normal AS CHECKBOX,
                  p_spl    AS CHECKBOX,
                  p_vendor AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b2.
    PERFORM get_data.
    PERFORM process_data.
    *PERFORM calculate_openbal. " Commented by anish
    PERFORM calculate_open_bal.
    PERFORM calculate_closing_bal.
    PERFORM build_catalog_sort USING it_sort.
    PERFORM reuse_alv_events_get .
    PERFORM display_data.
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
         bstat umskz FROM bsid
         INTO TABLE it_bsid
         WHERE bukrs = p_bukrs
          AND kunnr = p_kunnr
          AND budat IN so_budat.
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
        bstat umskz FROM bsad
        APPENDING TABLE it_bsid
        WHERE bukrs = p_bukrs
         AND kunnr = p_kunnr
         AND budat IN so_budat.
       SELECT SINGLE name1 ort01 lifnr FROM kna1
         INTO (w_name1 , w_ort01 , w_lifnr)
         WHERE kunnr = p_kunnr.
       IF p_vendor IS NOT INITIAL.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz   FROM bsik
         APPENDING TABLE it_bsik
         WHERE bukrs = p_bukrs
           AND lifnr = w_lifnr
           AND budat IN so_budat.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz  FROM bsak
        APPENDING TABLE it_bsik
        WHERE bukrs = p_bukrs
          AND lifnr = w_lifnr
          AND budat IN so_budat.
       ENDIF.
       SORT it_bsid BY bschl.
       DELETE  it_bsid WHERE bschl = '04'.
       DELETE  it_bsid WHERE bschl = '07'.
       DELETE  it_bsid WHERE bschl = '17'.
       DELETE  it_bsid WHERE bschl = '34'.
       DELETE  it_bsid WHERE bschl = '27'.
       DELETE  it_bsid WHERE bschl = '37'.
       SORT it_bsik BY bschl.
       DELETE  it_bsik WHERE bschl = '04'.
       DELETE  it_bsik WHERE bschl = '07'.
       DELETE  it_bsik WHERE bschl = '17'.
       DELETE  it_bsik WHERE bschl = '34'.
       DELETE  it_bsik WHERE bschl = '27'.
       DELETE  it_bsik WHERE bschl = '37'.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM process_data .
       DATA:okay       TYPE c VALUE space.
       w_month = '00'.
       w_year = '00'.
       SORT it_bsid BY bldat .
       LOOP AT it_bsid INTO wa_bsid.
         PERFORM check_item_ok  USING p_normal
                                      p_spl
                                      p_vendor
    *                               x_park
                                      wa_bsid
                                CHANGING okay.
         CHECK okay = 'X'.
         wa_final-belnr = wa_bsid-belnr.
         wa_final-bldat = wa_bsid-bldat.
         wa_final-blart = wa_bsid-blart.
         wa_final-txt = wa_bsid-sgtxt.
         wa_final-kkber = wa_bsid-kkber.
         wa_final-zterm = wa_bsid-zterm.
         wa_final-augbl = wa_bsid-augbl.
         wa_final-augdt = wa_bsid-augdt.
         wa_final-flag = 'C'.
         IF wa_bsid-blart = 'DZ'.
           wa_final-chq = wa_bsid-zuonr.
         ENDIF.
         IF wa_bsid-shkzg = 'S'.
           wa_final-debit = wa_bsid-dmbtr.
         ELSEIF wa_bsid-shkzg = 'H'.
           wa_final-credit = wa_bsid-dmbtr.
         ENDIF.
         w_credit = w_credit + wa_final-credit.
         w_debit = w_debit + wa_final-debit.
    ****** Net due  date
         IF wa_bsid-zbd1t IS NOT INITIAL.
           w_days = wa_bsid-zbd1t.
         ELSEIF wa_bsid-zbd2t IS NOT INITIAL.
           w_days = wa_bsid-zbd2t.
         ELSEIF wa_bsid-zbd3t IS NOT INITIAL.
           w_days = wa_bsid-zbd3t.
         ENDIF.
         IF w_days IS INITIAL.
           wa_final-date = wa_bsid-zfbdt.
         ELSE.
           CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
             EXPORTING
               date      = wa_bsid-zfbdt
               days      = w_days
               months    = w_month
               signum    = '+'
               years     = w_year
             IMPORTING
               calc_date = w_date.
           wa_final-date = w_date.
         ENDIF.
         APPEND wa_final TO it_final.
         CLEAR: w_days , w_date , wa_final .
       ENDLOOP.
       IF it_bsik IS NOT INITIAL.
         CLEAR: w_days , w_date.
         SORT it_bsik BY bldat.
         LOOP AT it_bsik INTO wa_bsik.
           wa_final-belnr = wa_bsik-belnr.
           wa_final-bldat = wa_bsik-bldat.
           wa_final-blart = wa_bsik-blart.
           wa_final-txt = wa_bsik-sgtxt.
    *    wa_final-kkber = wa_bsik-kkber.
           wa_final-zterm = wa_bsik-zterm.
           wa_final-augbl = wa_bsik-augbl.
           wa_final-augdt = wa_bsik-augdt.
           wa_final-flag = 'V'.
           IF wa_bsik-blart = 'DZ'.
             wa_final-chq = wa_bsik-zuonr.
           ENDIF.
           IF wa_bsik-shkzg = 'S'.
             wa_final-debit = wa_bsik-dmbtr.
           ELSEIF wa_bsik-shkzg = 'H'.
             wa_final-credit = wa_bsik-dmbtr.
           ENDIF.
           w_credit1 = w_credit1 + wa_final-credit.
           w_debit1 = w_debit1 + wa_final-debit.
    *******  Net Due date
           IF wa_bsik-zbd1t IS NOT INITIAL.
             w_days = wa_bsik-zbd1t.
           ELSEIF wa_bsik-zbd2t IS NOT INITIAL.
             w_days = wa_bsik-zbd2t.
           ELSEIF wa_bsik-zbd3t IS NOT INITIAL.
             w_days = wa_bsik-zbd3t.
           ENDIF.
           IF w_days IS INITIAL.
             wa_final-date = wa_bsik-zfbdt.
           ELSE.
             CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
               EXPORTING
                 date      = wa_bsik-zfbdt
                 days      = w_days
                 months    = w_month
                 signum    = '+'
                 years     = w_year
               IMPORTING
                 calc_date = w_date.
           ENDIF.
           wa_final-date = w_date.
           APPEND wa_final TO it_final.
           CLEAR: wa_final.
         ENDLOOP.
       ENDIF.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  DISPLAY_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_data .
       wa_fieldcat_alv-fieldname = 'BELNR'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-003.
       wa_fieldcat_alv-outputlen = '11'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLDAT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-004.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLART'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-005.
       wa_fieldcat_alv-outputlen = '02'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CHQ'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-006.
       wa_fieldcat_alv-outputlen = '09'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DEBIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-007.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CREDIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-008.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'TXT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-009.
       wa_fieldcat_alv-outputlen = '50'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DATE'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-010.
       wa_fieldcat_alv-outputlen = '12'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'KKBER'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-011.
       wa_fieldcat_alv-outputlen = '04'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'ZTERM'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-012.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGBL'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-013.
       wa_fieldcat_alv-outputlen = '15'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGDT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-014.
       wa_fieldcat_alv-outputlen = '17'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'FLAG'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-tech = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program             = sy-repid
          is_layout                      = wa_layout_alv
          it_fieldcat                    = it_fieldcat_alv
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
          it_sort                        = it_sort
          it_events                      = it_events
          i_save                            = 'A'
         TABLES
           t_outtab                       = it_final
        EXCEPTIONS
          program_error                  = 1
          OTHERS                         = 2
       IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    *  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *    EXPORTING
    *      i_callback_program                = sy-repid
    *     i_callback_top_of_page            = 'TOP_OF_PAGE'
    *      is_layout                         = wa_layout_alv
    *      it_fieldcat                       = it_fieldcat_alv
    *      it_sort                           = it_sort
    ***   I_DEFAULT                         = 'X'
    **      i_save                            = 'A'
    ***   IT_EVENTS                         =
    *     TABLES
    *       t_outtab                          = it_final
    *    EXCEPTIONS
    *      program_error                     = 1
    *      OTHERS                            = 2
    *  IF sy-subrc <> 0.
    *** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  TOP_OF_PAGE
    *       Header at top of page.
    FORM top_of_page.
       SKIP 1.
       WRITE: AT 35 'Account Statement from' , so_budat-low , 'to' , so_budat-high.
       SKIP 2.
       WRITE: AT /5 'CUSTOMER:' , p_kunnr.
       WRITE: AT 35 'Name:' , w_name1.
       WRITE: AT /5 'Company:' , p_bukrs.
       WRITE: AT 35 'City:' , w_ort01.
       SKIP 1.
       WRITE: AT /5 'Opening Balance as on' , so_budat-low , '   ' ,  w_opbal LEFT-JUSTIFIED.
       SKIP 2.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  END_OF_PAGE
    *       Footer at End of page.
    FORM end_of_page.
       SKIP 2.
       IF so_budat-high IS NOT INITIAL.
         WRITE: AT 5 'Closing Balance as on' , so_budat-high , '   ' ,  w_clobal LEFT-JUSTIFIED.
       ELSE.
         WRITE: AT 5 'Closing Balance  ' , w_clobal LEFT-JUSTIFIED.
       ENDIF.
    ENDFORM.                    "end_of_page
    *&      Form  CALCULATE_OPENBAL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM calculate_openbal .
       DATA:v_gjahr       TYPE bsid-gjahr.
       DATA: v_period LIKE  t009b-poper,v_monat LIKE t001-periv.
       CALL FUNCTION 'FI_PERIOD_DETERMINE'
              EXPORTING
                   i_budat        = so_budat-low
                   i_bukrs        = p_bukrs
    *           I_PERIV        = ' '
    *           I_GJAHR        = 0000
    *           I_MONAT        = 00
    *           X_XMO16        = ' '
              IMPORTING
                   e_gjahr        = v_gjahr
    *            e_monat        = v_monat
                   e_poper        = v_period.
       IF sy-subrc NE 0.
       ENDIF.
       DATA: f_date LIKE sy-datum.
       CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
         EXPORTING
           i_gjahr  = v_gjahr
           i_monmit = 00
           i_periv  = 'V3'
           i_poper  = v_period
         IMPORTING
           e_date   = f_date.
       period = v_period - 1.
       gjahr = v_gjahr.
       DATA wa_kna1 LIKE kna1.
       CALL FUNCTION 'READ_KNA1'
         EXPORTING
           xkunnr         = p_kunnr
         IMPORTING
           xkna1          = wa_kna1
         EXCEPTIONS
           key_incomplete = 1
           not_authorized = 2
           not_found      = 3
           OTHERS         = 4.
       IF sy-subrc <> 0.
         MESSAGE w023(zwww).
         CALL SCREEN 0010.
       ENDIF.
       MOVE-CORRESPONDING wa_kna1 TO t_kna1.
       APPEND t_kna1.
       SELECT kunnr FROM kna1 INTO TABLE ikunnr1
         WHERE kunnr = p_kunnr.
       SELECT bukrs FROM t001 INTO TABLE ibukrs
        FOR ALL ENTRIES IN t_knb1
        WHERE bukrs = t_knb1-bukrs.
       LOOP AT ikunnr1.
         LOOP AT ibukrs.
           ikunnr-kunnr = ikunnr1-kunnr.
           ikunnr-bukrs = ibukrs-bukrs.
           READ TABLE t_kna1 WITH  KEY kunnr = ikunnr1-kunnr.
           ikunnr-lifnr = t_kna1-lifnr.
           APPEND ikunnr.
         ENDLOOP.
       ENDLOOP.
       DELETE ikunnr WHERE bukrs NE p_bukrs.
       LOOP AT ikunnr.
         CLEAR: knc1,lfc1,f.
         IF NOT ( ikunnr-kunnr IS INITIAL ) AND NOT ( p_vendor IS INITIAL ).
           SELECT SINGLE * FROM lfc1
                  WHERE gjahr = gjahr AND bukrs = ikunnr-bukrs
                                      AND lifnr = ikunnr-lifnr.
         ENDIF.
         SELECT SINGLE * FROM knc1
           WHERE gjahr = gjahr AND bukrs = p_bukrs
                 AND kunnr = p_kunnr.
         IF sy-subrc = 0.
           CASE period .
             WHEN 12.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h + knc1-um12s - knc1-um12h.
               IF NOT ( lfc1 IS INITIAL ).
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h + lfc1-um12s - lfc1-um12h.
               ENDIF.
             WHEN 11.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h.
               ENDIF.
             WHEN 10.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h.
               ENDIF.
             WHEN 9.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h.
               ENDIF.
             WHEN 8.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h .
               ENDIF.
             WHEN 7.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um

  • Performance issue in procedure

    Hi All
    i have a performance issue with below procedure it is taking 10-15 hrs .custom table has 2 lacks record .
    PROCEDURE update_summary_dollar_amounts( p_errbuf OUT VARCHAR2
    ,p_retcode OUT NUMBER) IS
    v_customer_id NUMBER := NULL;
    pymt_count NUMBER := 0;
    rec_count NUMBER := 0;
    v_number_late NUMBER;
    v_number_on_time NUMBER;
    v_days_late NUMBER;
    v_avg_elapsed NUMBER;
    v_avg_elapsed_US NUMBER;
    v_percent_prompt NUMBER;
    v_percent_late NUMBER;
    v_number_open NUMBER;
    v_last_payment_amount NUMBER;
    v_last_payment_date DATE;
    v_prev_payment_amount NUMBER;
    v_prev_payment_date DATE;
    v_last_sale_amount NUMBER;
    v_last_sale_date DATE;
    v_mtd_sales NUMBER;
    v_ytd_sales NUMBER;
    v_prev_year_sales NUMBER;
    v_prev_receipt_num VARCHAR2(30);
    v_last_sale VARCHAR2(50);
    c_current_year VARCHAR2(4);
    c_previous_year VARCHAR2(4);
    c_current_month VARCHAR2(8);
    /* ====================================================================== */
    /* CURSOR Customer Cursor (Main Customer) LOOP */
    /* ====================================================================== */
    CURSOR customer_cursor IS
    SELECT cst.customer_id customer_id
    ,cst.customer_number customer_number
    ,cst.org_id org_id
    FROM zz_ar_customer_summary_all cst
    ORDER by cst.customer_id;
    /* ====================================================================== */
    /* CURSOR Payments Cursor LOOP */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    /* ====================================================================== */
    CURSOR payments_cursor IS
    SELECT cr.receipt_number receipt_num
    ,NVL(cr.amount,0) amount
    ,crh.gl_date gl_date
    FROM ar_lookups
    ,ar_cash_receipts_all cr
    ,ar_cash_receipt_history_all crh
    ,ar_receivable_applications_all ra
    ,ra_customer_trx_all ct
    WHERE NVL(cr.type,'CASH') = ar_lookups.lookup_code
    AND ar_lookups.lookup_type = 'PAYMENT_CATEGORY_TYPE'
    AND cr.pay_from_customer = v_customer_id
    AND cr.cash_receipt_id = ra.cash_receipt_id
    AND cr.cash_receipt_id = crh.cash_receipt_id
    AND crh.first_posted_record_flag = 'Y'
    AND ra.applied_customer_trx_id = ct.customer_trx_id(+)
    ORDER BY cr.creation_date DESC
    ,cr.cash_receipt_id DESC
    ,ra.creation_date DESC;
    customer_record customer_cursor%rowtype;
    payments_record payments_cursor%rowtype;
    BEGIN
    p_errbuf := NULL;
    p_retcode := 0;
    c_current_year := TO_CHAR(SYSDATE,'YYYY');
    c_current_month := TO_CHAR(SYSDATE,'YYYYMM');
    c_previous_year := TO_CHAR(TO_NUMBER(c_current_year) - 1);
    FOR customer_record IN customer_cursor LOOP
    /* Get Days Late and Average Elapsed Days */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    v_customer_id := customer_record.customer_id;
    BEGIN
    SELECT DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.trx_date) / COUNT(cr.deposit_date))) avgdays
    ,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.due_date) / COUNT(cr.deposit_date))) avgdayslate
    ,NVL(SUM(DECODE(SIGN(cr.deposit_date - ps.due_date),1, 1, 0)), 0) newlate
    ,NVL(SUM( DECODE(SIGN(cr.deposit_date - ps.due_date),1, 0, 1)), 0) newontime
    INTO v_avg_elapsed
    ,v_days_late
    ,v_number_late
    ,v_number_on_time
    FROM ar_receivable_applications_all ra
    ,ar_cash_receipts_all cr
    ,ar_payment_schedules_all ps
    WHERE ra.cash_receipt_id = cr.cash_receipt_id
    AND ra.applied_payment_schedule_id = ps.payment_schedule_id
    AND ps.customer_id = v_customer_id
    AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE
    AND ra.status = 'APP'
    AND ra.display = 'Y'
    AND NVL(ps.receipt_confirmed_flag,'Y') = 'Y';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_days_late := NULL;
    v_number_late := NULL;
    v_avg_elapsed := NULL;
    v_number_on_time := NULL;
    END;
    IF (v_number_on_time + v_number_late) > 0
    THEN
    v_percent_prompt := ROUND(v_number_on_time/(v_number_on_time + v_number_late),2) * 100;
    v_percent_late := ROUND(v_number_late/(v_number_on_time + v_number_late),2) * 100;
    ELSE
    v_percent_prompt := 0;
    v_percent_late := 0;
    END IF;
    /* C2# 49827 */
    /* Get new average elapsed days for US use only */
    v_avg_elapsed_us := NULL;
    IF NVL(customer_record.org_id,-999) = 114
    THEN
    v_avg_elapsed_us := 0;
    BEGIN
    SELECT ROUND(SUM(NVL(ra.amount_applied,0) * (cr.deposit_date - ps.trx_date)) / DECODE(SUM(NVL(ra.amount_applied,0)),0,1,SUM(NVL(ra.amount_applied,0)))) avg_elapsed_us
    INTO v_avg_elapsed_us
    FROM ar_receivable_applications_all ra
    ,ar_cash_receipts_all cr
    ,ar_payment_schedules_all ps
    WHERE ra.cash_receipt_id = cr.cash_receipt_id
    AND ra.applied_payment_schedule_id = ps.payment_schedule_id
    AND ps.customer_id = v_customer_id
    AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -06) AND SYSDATE
    AND ps.status = 'CL'
    AND ra.status = 'APP'
    AND ra.display = 'Y'
    AND nvl(ps.receipt_confirmed_flag,'Y') = 'Y'
    AND ra.amount_applied <> 0;
    v_avg_elapsed_us := NVL(v_avg_elapsed_us,0);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_avg_elapsed_us := NULL;
    END;
    END IF;
    END;
    /* Get MTD, YTD, Prev Year Sales */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    SELECT NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYYMM'),c_current_month,amount_due_original,0)),0) mtd_sales
    ,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_current_year,amount_due_original,0)),0) ytd_sales
    ,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_previous_year,amount_due_original,0)),0) prev_sales
    ,SUM(DECODE(ps.status,'OP',(DECODE(SIGN(amount_due_original),1,1,0)),0)) number_open
    INTO v_mtd_sales
    ,v_ytd_sales
    ,v_prev_year_sales
    ,v_number_open
    FROM ar_payment_schedules_all ps
    WHERE ps.customer_id = v_customer_id
    AND ps.class != 'PMT';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_mtd_sales := NULL;
    v_ytd_sales := NULL;
    v_prev_year_sales := NULL;
    END;
    /* Get Last and Previous Payments */
    pymt_count := 0;
    v_last_payment_date := NULL;
    v_prev_payment_date := NULL;
    v_last_payment_amount := NULL;
    v_prev_payment_amount := NULL;
    v_prev_receipt_num := NULL;
    FOR payments_record IN payments_cursor LOOP
    BEGIN
    IF payments_record.receipt_num = v_prev_receipt_num
    THEN
    NULL;
    ELSIF pymt_count = 0
    THEN
    v_last_payment_date := payments_record.gl_date;
    v_last_payment_amount := payments_record.amount;
    pymt_count := pymt_count +1;
    v_prev_receipt_num := payments_record.receipt_num;
    ELSIF pymt_count = 1
    THEN
    v_prev_payment_date := payments_record.gl_date;
    v_prev_payment_amount := payments_record.amount;
    EXIT;
    ELSE
    EXIT;
    END IF;
    END;
    END LOOP;
    /* Get Last Sale Date and Amount */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    SELECT MAX(TO_CHAR(ct.trx_date,'YYYYDDD')||ps.amount_due_original)
    INTO v_last_sale
    FROM ra_cust_trx_types_all ctt
    ,ar_payment_schedules_all ps
    ,ra_customer_trx_all ct
    WHERE ps.customer_trx_id = ct.customer_trx_id
    AND ct.cust_trx_type_id = ctt.cust_trx_type_id
    AND ct.bill_to_customer_id = v_customer_id
    AND ps.class || '' = 'INV'
    ORDER BY ct.trx_date DESC
    ,ct.customer_trx_id DESC;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_last_sale := NULL;
    END;
    IF v_last_sale IS NOT NULL
    THEN
    v_last_sale_date := TO_DATE(SUBSTR(v_last_sale,1,7),'YYYYDDD');
    v_last_sale_amount := SUBSTR(v_last_sale,8,15);
    ELSE
    v_last_sale_date := NULL;
    v_last_sale_amount := NULL;
    END IF;
    /* Update Values into ZZ_AR_CUSTOMER_SUMMARY_ALL */
    BEGIN
    UPDATE zz_ar_customer_summary_all
    SET sales_last_year = v_prev_year_sales
    ,sales_ytd = v_ytd_sales
    ,sales_mtd = v_mtd_sales
    ,last_sale_date = v_last_sale_date
    ,last_sale_amount = v_last_sale_amount
    ,last_payment_date = v_last_payment_date
    ,last_payment_amount = v_last_payment_amount
    ,previous_payment_date = v_prev_payment_date
    ,previous_payment_amount = v_prev_payment_amount
    ,prompt = v_percent_prompt
    ,late = v_percent_late
    ,avg_elapsed_days = v_avg_elapsed
    ,avg_elapsed_days_us = v_avg_elapsed_us -- C2# 49827
    ,days_late = v_days_late
    ,number_open = v_number_open
    WHERE customer_id = customer_record.customer_id;
    EXCEPTION
    WHEN PROGRAM_ERROR THEN NULL;
    WHEN DUP_VAL_ON_INDEX THEN NULL;
    WHEN STORAGE_ERROR THEN NULL;
    WHEN OTHERS THEN NULL;
    END;
    rec_count := rec_count + 1;
    IF rec_count = 10000
    THEN
    COMMIT;
    rec_count := 0;
    fnd_file.put_line(fnd_file.output,'Commit at customer_id = ' || TO_CHAR(customer_record.customer_id) || ' ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
    fnd_file.new_line(fnd_file.output,1);
    END IF;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN others THEN
    ROLLBACK;
    p_retcode := 2;
    p_errbuf := SQLERRM;
    END update_summary_dollar_amounts;
    Thanks,
    Anu

    Based on my initial assessment of the code, it looks like you are utilizing the "slow by slow" method. It is often termed "slow by slow" because it is one of the most INefficient ways of doing data processing. The "slow by slow" method uses CURSOR FOR LOOPs to loop through entire record sets and process them one at a time. In your case it looks like you are using NESTED FOR LOOPs which could exacerbate the problem.
    I recommend you re-think your approach and try and do everything in a single, or a few SQL statements if possible and avoid the procedural logic.
    If you can post your business requirements, and sample data we may be able to help you achieve your goal.
    HTH!

Maybe you are looking for

  • Member formula restriction problem

    I have made a customized form in Capex the layout of the form is that on row side i have Line Item dimension with 5 members and their parent and on coloumn side i have account dimension with 7 members selected. I am using a member formula on the pare

  • Remove default mail database

    Dues to the size of my default mailbox database I created two new mail box databases and moved (using EMC) the existing user mailboxes from the default mailbox into the two new ones (half in each new database). That left me with the Discovery Search

  • Final Cut Pro keeps quitting on me!!

    As I'm trying to import an audio track from a CD into Final Cut, the program 'unexpectedly quits'. How do I import music for Final Cut to stopping shutting down on me?!?

  • Can Acrobat Reader DC be used on a Mac

    Can Acrobat Reader DC be used on a Mac?  From what I read it appears to be for Microsoft only.

  • How can we identify

    hi    can anybody tell me how can we identify valuated or non valuated sales order stock thanks prasad