DISTINCT operator performance issue

Hi Guyz,
I am facing a performance issue in a query which contains DISTINCT function. Following is my query:
SELECT     /*+ ORDERED USE_NL_WITH_INDEX(c DIMENSION_KEY_PK) */
                    DISTINCT f.*,c.client_ids
FROM FACT_TAB f, DIM_TAB c
WHERE f.client = c.dimension_key
FACT_TAB = Fact table with a bitmap index on client column (10,000,000 records).
DIM_TAB = Dimension table with dimension_key as primary key (100,000 records).
when i select only fact table columns in the above query, the query executes within a second. But when i execute the above query it takes more than 15 minutes to execute.
How can i improve the above query. Any suggestions or tips would be helpful.
Thanks in advance.

Hi myers,
you are absolutely right, there is no purpose of using DISTINCT, because i have found there are no duplicates in fact table, neither in dimension.
BUT there is another problem after this, i am joining these two tables with another table (INLINE VIEW), which gives me duplicate data, so i need DISTINCT operator for that purpose. Time dimension is also used in this query now. Here is my new Query:
SELECT /*+ ORDERED USE_NL_WITH_INDEX(c DIMENSION_KEY_PK) */
DISTINCT f.*,c.client_ids
FROM FACT_TAB f, DIM_TAB c, DIM_TIME_TAB t, (select id,start_date,end_date from tab3) tab
WHERE f.client = c.dimension_key
AND f.time = t.dimension_key
AND f.tabid = tab.id
AND t.day_start_date >= tab.start_date
AND (t.day_start_date <= tab.end_date OR tab.end_date IS NULL)
Thanks

Similar Messages

  • Move Excel Formatting on Operations performance issue

    Hi,
    Firstly we have a 64bit Windows system running EPM version V11.1.2.1, patched to .102, and Excel 2010 32 bit.
    Having applied patchset 13709867 on the .103 SV version the old problem we had where formatting was not maintained when a fixed format report was cascaded remained so, having seen that the 32bit version of SV v11.1.2.2 was backwards compatible we experimented to see if it would resolve the problem, which it didn't.
    However, when the 'Use Excel Formatting' and 'Move Formatting on Operations' are selected, the performance is horrendous which makes me wonder if there is some sort with the Office product? It's V14.0.6112.5000 for info.
    Does this ring bells with anyone?
    Thanks
    Steve

    1st, no I haven't had any feedback, although I have seen it in operation on other systems without the performance issues we experienced, which made me wonder whether there was some 'setting' in Office that could affect it.
    Secondly, the grid had one row in it, it can't get much smaller than that.
    3rdly, I never said anything about 'Move formatting....' having an effect on cascades, thanks. I said we hoped that the patch might resolve the issue.
    Lastly - the reason cascading doesn't work is that it actually does work. When a sheet is cascaded, it doesn't use the current sheet options, it uses the default sheet options, therefore, to successfully cascade a highly formatted smart view report, ensure that the default sheet options (set on the drop down by the OK button) are set as per the excel sheet you created. Not even Oracle Support could tell me that.
    Steve

  • SharePoint 2007 performance issue after upgrading the operating system

    We upgraded the operating system of our SharePoint Server 2007 from 2003 to 2008 R2. After upgrade we rebuilt the SharePoint using content DBs we backed up before upgrade. All settings is same except that we moved the DBs to new SQL servers. Now users are
    reporting performance issue with sites. I experienced it myself some of the pages takes 9-30 seconds to load. Also our SharePoint server is single server. I monitored the SharePoint Server and it is fine. I did fiddler trace and here are the result. I see
    lots of 401 (login failed) errors then 302 (redirect) then 200 (OK). Do you know why we are getting 401 errors?
    Result
    Protocol
    Host
    URL
    Body
    Caching
    Content-Type
    Process
    184
    401
    HTTP
    sp07.ourcompany.com
    /bif/EUROPE-AMA
    341
    text/html; charset=us-ascii
    iexplore:15344
    185
    302
    HTTP
    sp07.ourcompany.com
    /bif/EUROPE-AMA
    196
    text/html; charset=UTF-8
    iexplore:15344
    186
    401
    HTTP
    sp07.ourcompany.com
    /bif/EUROPE-AMA/default.aspx
    341
    text/html; charset=us-ascii
    iexplore:15344
    187
    200
    HTTP
    sp07.ourcompany.com
    /bif/EUROPE-AMA/default.aspx
    105,487
    private, max-age=0; Expires: Mon, 22 Dec 2014 21:37:48 GMT
    text/html; charset=utf-8
    iexplore:15344
    188
    401
    HTTP
    sp07.ourcompany.com
    /_layouts/1033/styles/calendar.css?rev=BrbrIU86qTG2EHx1ZUuFBQ%3D%3D
    341
    text/html; charset=us-ascii
    iexplore:15344
    189
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/prevbuttonltr.gif
    76
    max-age=31536000
    image/gif
    iexplore:15344
    190
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/nextbuttonltr.gif
    78
    max-age=31536000
    image/gif
    iexplore:15344
    191
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/day.gif
    1,051
    max-age=31536000
    image/gif
    iexplore:15344
    192
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/month.gif
    1,068
    max-age=31536000
    image/gif
    iexplore:15344
    193
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/1033/styles/calendar.css?rev=BrbrIU86qTG2EHx1ZUuFBQ%3D%3D
    28,814
    max-age=31536000
    text/css
    iexplore:15344
    194
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/week.gif
    1,057
    max-age=31536000
    image/gif
    iexplore:15344
    195
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/weekbox.gif
    149
    max-age=31536000
    image/gif
    iexplore:15344
    196
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/alldayDefault.gif
    157
    max-age=31536000
    image/gif
    iexplore:15344
    197
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/calnumBttntoday.gif
    146
    max-age=31536000
    image/gif
    iexplore:15344
    198
    200
    HTTP
    sp07.ourcompany.com
    /_layouts/images/calnumBttn.gif
    95
    max-age=31536000
    image/gif
    iexplore:15344

    Hi
    when you request a  Site collection (http://domain/) or a Site (http://domain/foo/) of your Publishing Site you get redirected to the http://domain/Pages/<WelcomePage>.aspx. SharePoint 2007 uses the 302 header (location temporarily moved) for
    this purpose. Surprisingly even WSS uses the 302 header to redirect a root url to the default.aspx. In comparison ASP.NET uses an internal redirect to render the default page when the root url requested: there is no redirect in this situation.
    Check the link which can give more input
    http://blog.mastykarz.nl/sharepoint-2007-redirect-solved-using-301-instead-of-302-redirects/
    for error 401 you can check this link
    http://discussions.citrix.com/topic/97027-no-resources-401-unauthorized/d
    and check SharePoint ULS logs and event viewer for any exceptions.
    Please mark the Answer and Vote me if you think that it will help you to resolved your issue

  • Performance Issue - Index is not used when a zero padded string is queried

    Hi All,
    I have a table T1 which has many columns. One such column say C1 is a varchar2(20). T1 has 10 million rows and there is an index called I1 on C1. Stats are current for both tables and indexes. These are the scenarios:
    Scenario 1
    select *   from T1 where C1 = '0013206263' --Uses index I1
    187 ms
    Scenario 2
    select *   from T1 where C1 = '8177341863' --Uses index I1
    203 ms
    *Scenario 3*
    *select *   from T1 where C1 = '0000000945' --Uses Fulll Table Scan --Very Slow*
    *45 seconds*
    When I force the sql to use the index through a hint, it is working fine:
    Scenario 4
    select /*+ INDEX (t1 i1) */  *   from T1 where C1 = '0013206263' --Uses index I1
    123 ms
    Scenario 5
    select /*+ INDEX (t1 i1) */  *   from T1 where C1 = '8177341863' --Uses index I1
    201 ms
    *Scenario 6*
    *select /*+ INDEX (t1 i1) */  *   from T1 where C1 = '0000000945' --Uses index I1*
    *172ms*Is there any reason for this performance issue? Why does the optimizer goes for FTS in Scenario 3?
    Edited by: user539954 on May 14, 2009 12:22 PM
    Edited by: user539954 on May 14, 2009 12:32 PM

    user539954 wrote:
    Please see the replies below:
    - How many distinct values for C1 out of that 10 million rows? I'm guessing that histograms were created for C1, correct?
    =>7 million distinct c1 values. I have not gathered a histogram yet. Should I try that?
    SQL> explain plan for select * from T1  where C1 = '0000000954';
    | Id  | Operation         | Name           | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT  |                |   244K|    19M| 26228   (5)|
    |   1 |  TABLE ACCESS FULL| T1 |   244K|    19M| 26228   (5)|
    SQL> explain plan for select * from T1  where C1 = '0033454555';
    | Id  | Operation                   | Name               | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT            |                    |   532 | 43624 |   261   (0)|
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1     |   532 | 43624 |   261   (0)|
    |   2 |   INDEX RANGE SCAN          | I1 |   532 |       |     2   (0)|
    It's possible you do have a histogram, even though you didn't plan on creating it, if you're running 10g.
    In the absence of a histogram and with 7M distinct keys in 10M rows, Oracle should have predicted 2 rows for both queries, not 244,000 and 532.
    If you do have a histogram, you probably need to get rid of it.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Query giving performance issues.

    Hi All,
    Following query is giving performance issues. Query execution is taking around 11 minutes. Our client requirement is to get the data for the query in 30 sec to 1 min. Please suggest.
    SELECT
    DISTINCT r.rptid, p.product_id, p.vnd_dscr, p.vendor_cd, p.Firm_Cd, a.is_mm_sweep IsMoneyMarket
    FROM
    dev.ac_cube a,
    dev.rpt_master_rep_list_view r,
    dev.cur_ps_cube p
    WHERE a.repid = r.rep_id
    AND a.accountkey = p.accountkey
    AND p.product_id IS NOT NULL
    AND p.product_id != 'CASH'
    AND r.RPTID = '42817'
    Number of distinct records fetched by above query : 34445
    Number of records in dev.ac_cube table : 13.6 million
    Number of records in dev.cur_ps_cube table : 7 million
    Number of records in dev.rpt_master_rep_list_view for RPTID '42817' : 118354
    repid, product_id is indexed column in dev.ac_cube table. accountkey is primary key in dev.ac_cube table.
    rep_id is indexed column in base table on which dev.rpt_master_rep_list_view view is created

    The output is not complete as i expected. Have you followed the steps I have mentioned in my earlier post
    Also when posting output enclose between two {*code*} ...{*code*} (remove * within braces). It displays everything between the tags as proper formatted output otherwise its really hard to read and understand
    See sample below. However you need to get the session id, sql id, display_cursor output exactly in same way as mentioned in my previous post
    SQL> set arraysize 200 timing on serveroutput on linesize 200;
    SQL> set autotrace traceonly explain statistics;
    SQL> select level from dual  connect by level <= 10000;
    10000 rows selected.
    Elapsed: 00:00:00.09
    Execution Plan
    Plan hash value: 1236776825
    | Id  | Operation                    | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |      |     1 |     2   (0)| 00:00:01 |
    |   1 |  CONNECT BY WITHOUT FILTERING|      |       |            |          |
    |   2 |   FAST DUAL                  |      |     1 |     2   (0)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
          57406  bytes sent via SQL*Net to client
            919  bytes received via SQL*Net from client
             51  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    SQL>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Facing Performance Issue?

    Hi All,
    I am facing a performance issue in this query. Any suggestions.
    version Oracle : 9i
    Data in table : INFO - 11,0000. EXCEPTIONS - 100. ERRCODES - 125
    SELECT COUNT(DISTINCT FF.ID) ff_cnt
    FROM INFO_Table FF
    , EXCEPTIONS DE
    , ERRCODES EC
    WHERE FF.CASE_ID IS NOT NULL
    AND UPPER(FF.CASE_ID) LIKE UPPER('012-121205-001')
    AND FF.LDCODE NOT IN ('AAA','ESED','ITE')
    AND FF.MGTCODE IN ('AWFF','PED')
    AND FF.ID = DE.MSGID
    AND DE.ERRCODE = EC.CODE
    AND EC.CAT = 'FL'
    AND EC.CODE NOT IN ('NLY','NTE','NL')
    AND DE.MCL_ID = (SELECT MAX(MC.ID) FROM MESSTROL MC WHERE MC.MSG_ID = FF.ID);
    Explain Plan:
    SELECT STATEMENT CHOOSE 0 1,405.00 1,405.00 1 19
    SORT GROUP BY 1 0 1 1 19
    VIEW SYS 2 1 1 1,4055.00 1 19
    FILTER 3 2 1
    SORT GROUP BY 4 3 1 1,4055.00 1 96
    HASH JOIN 5 4 1 1,322.00 7674 196
    TABLE ACCESS FULL GEM ERRCODES ANALYZED 6 5 1 7 70 1,260.00
    HASH JOIN 7 5 2 1,313.00 7,728.00
    HASH JOIN 8 7 1 613 239 13,145.00
    TABLE ACCESS FULL GEM INFO_Table 1 ANALYZED 9 8 1 383 193 8,685.00
    TABLE ACCESS FULL GEM MESSTROL 4 ANALYZED 10 8 2 225 285 1260
    TABLE ACCESS FULL GEM EXCEPTIONS 2 ANALYZED 11 7 2 686 602 7883.00
    Edited by: user545846 on Nov 23, 2008 8:51 PM

    user545846 wrote:
    Hi All,
    I am facing a performance issue in this query. Any suggestions.
    version Oracle : 9i
    Data in table : INFO - 11,0000. EXCEPTIONS - 100. ERRCODES - 125
    Explain Plan:
    SELECT STATEMENT CHOOSE 0 1,405.00 1,405.00 1 19
    SORT GROUP BY 1 0 1 1 19
    VIEW SYS 2 1 1 1,4055.00 1 19
    FILTER 3 2 1
    SORT GROUP BY 4 3 1 1,4055.00 1 96
    HASH JOIN 5 4 1 1,322.00 7674 196
    TABLE ACCESS FULL GEM ERROR_CODES ANALYZED 6 5 1 7 70 1,260.00
    HASH JOIN 7 5 2 1,313.00 7,728.00
    HASH JOIN 8 7 1 613 239 13,145.00
    TABLE ACCESS FULL GEM INFO_Table 1 ANALYZED 9 8 1 383 193 8,685.00
    TABLE ACCESS FULL GEM MESSTROL 4 ANALYZED 10 8 2 225 285 1260
    TABLE ACCESS FULL GEM EXCEPTIONS 2 ANALYZED 11 7 2 686 602 7883.00Your query seems to be based on a view. I assume it's the ERRCODES view that is based on the table ERROR_CODES and there are some group by operations. In addition there is a FILTER operation for which it would be interesting to know what it is doing.
    In order to find out these details, you should consider using DBMS_XPLAN.DISPLAY to generate more meaningful explain plan output. Please make sure that you include the "Predicate Information" section below the plan to see the details e.g. of the FILTER operation. If the "Predicate Information" section is missing, check the instructions below.
    Generic instructions how to do so and how to post it here using appropriate tags for mono-space font formatting and there improved readability follow below:
    Could you please post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your statement. Please use the {noformat}[{noformat}code{noformat}]{noformat} tag before and {noformat}[{noformat}/code{noformat}]{noformat} tag after or the {noformat}{{noformat}code{noformat}}{noformat} tag before and after to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Note that the package DBMS_XPLAN.DISPLAY is only available from 9i on.
    In 9i and above, if the "Predicate Information" section is missing from the DBMS_XPLAN.DISPLAY output but you get instead the message "Plan table is old version" then you need to re-create your plan table using the server side script "$ORACLE_HOME/rdbms/admin/utlxplan.sql".
    In previous versions you could run the following in SQL*Plus (on the server) instead:
    @?/rdbms/admin/utlxplsA different approach in SQL*Plus:
    SET AUTOTRACE ON EXPLAIN
    <run your statement>;will also show the execution plan.
    In order to get a better understanding where your statement spends the time you might want to turn on SQL trace as described here:
    When your query takes too long ...
    and post the "tkprof" output here, too.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • BEA Weblogic performance issue

    Hi All,
    We are using bea weblogic 10.2.
    We have some performance issue in our production.
    We face the proble like
    1. Our bea query takes maxixmum cpu utilization in the oracle databse.
    process are content upload, update, expiry and report fetching.
    2. When we run BEA query for report it takes around 10 min to run and content count is around 70,000,
    is this OK?
    3. Some times we get Socket connection error.
    4. Sometimes we get portal datasource connection pool error, currently it is set as 30.
    5. Almost every process is slow.
    Can anyone help me for optimization?
    From BBA,
    we idetified the query which is taking high CPU utilization..
    SELECT
    DISTINCT B.NODE_ID, B.NODE_VERSION_ID, B.CM_MODIFIED_DATE, B.MODIFIED_BY,B.VERSION_COMMENT,
    B.LIFECYCLE_STATUS,A.OBJECT_CLASS_ID,A.REPOSITORY_NAME
    FROM CMV_NODE A, CMV_NODE_VERSION B,(SELECT NODE_ID, MAX(CAST(NODE_VERSION_ID AS INTEGER)) NVI
    FROM CMV_NODE_VERSION GROUP BY NODE_ID) A1, ( SELECT B.NODE_ID,B.NODE_VERSION_ID, B.CM_MODIFIED_DATE,
    B.MODIFIED_BY, B.VERSION_COMMENT, B.LIFECYCLE_STATUS, A.OBJECT_CLASS_ID, A.REPOSITORY_NAME FROM CMV_NODE A,
    CMV_NODE_VERSION B, CMV_NODE_VERSION_PROPERTY N1, CMV_PROPERTY P1, CMV_VALUE_V V1 WHERE A.NODE_ID = B.NODE_ID
    AND B.NODE_ID = N1.NODE_ID AND B.NODE_VERSION_ID = N1.NODE_VERSION_ID AND N1.PROPERTY_ID = P1.PROPERTY_ID
    AND P1.PROPERTY_ID = V1.PROPERTY_ID AND P1.PROPERTY_NAME = :1 AND (UPPER(V1.TEXT_VALUE) LIKE :2 ESCAPE :"SYS_B_0" )
    UNION
         SELECT B.NODE_ID, B.NODE_VERSION_ID, B.CM_MODIFIED_DATE, B.MODIFIED_BY, B.VERSION_COMMENT,
    B.LIFECYCLE_STATUS, A.OBJECT_CLASS_ID, A.REPOSITORY_NAME FROM CMV_NODE A, CMV_NODE_VERSION B, CMV_NODE_
    Edited by: Arvind Rai on Apr 13, 2010 12:49 PM

    If your DB CPU is pegged, then anything that does db operations will take time (including some portal operations). If you take a thread dump you should be able to see them waiting on the DB
    When we run BEA query for report it takes around 10 min to run and content count is around 70,000,No. If it causes your CPU to max out it isnt. However your content items arent that much, so what query are you running? You could always export and import just the content tables and run your queries on some other machine (Assuming this is the cause)
    3. Some times we get Socket connection error.More information needed
    4. Sometimes we get portal datasource connection pool error, currently it is set as 30.What is the error?
    5. Almost every process is slow.If the DB is maxed this is what you should expect.
    When is the query fired? Are your indexes created? I assume caching is not much good to you since these are reporting queries?

  • Interested by performance issue ?  Read this !  If you can explain, you're a master Jedi !

    This is the question we will try to answer...
    What si the bottle neck (hardware) of Adobe Premiere Pro CS6
    I used PPBM5 as a benchmark testing template.
    All the data and log as been collected using performance counter
    First of all, describe my computer...
    Operating System
    Microsoft Windows 8 Pro 64-bit
    CPU
    Intel Xeon E5 2687W @ 3.10GHz
    Sandy Bridge-EP/EX 32nm Technology
    RAM
    Corsair Dominator Platinum 64.0 GB DDR3
    Motherboard
    EVGA Corporation Classified SR-X
    Graphics
    PNY Nvidia Quadro 6000
    EVGA Nvidia GTX 680   // Yes, I created bench stats for both card
    Hard Drives
    16.0GB Romex RAMDISK (RAID)
    556GB LSI MegaRAID 9260-8i SATA3 6GB/s 5 disks with Fastpath Chip Installed (RAID 0)
    I have other RAID installed, but not relevant for the present post...
    PSU
    Cosair 1000 Watts
    After many days of tests, I wanna share my results with community and comment them.
    CPU Introduction
    I tested my cpu and pushed it at maximum speed to understand where is the limit, can I reach this limit and I've logged precisely all result in graph (See pictures 1).
    Intro : I tested my E5-XEON 2687W (8 Cores Hyperthread - 16 threads) to know if programs can use the maximum of it.  I used Prime 95 to get the result.  // I know this seem to be ordinary, but you will understand soon...
    The result : Yes, I can get 100% of my CPU with 1 program using 20 threads in parallel.  The CPU gives everything it can !
    Comment : I put 3 IO (cpu, disk, ram) on the graph of my computer during the test...
    (picture 1)
    Disk Introduction
    I tested my disk and pushed it at maximum speed to understand where is the limit and I've logged precisely all result in graph (See pictures 2).
    Intro : I tested my RAID 0 556GB (LSI MegaRAID 9260-8i SATA3 6GB/s 5 disks with Fastpath Chip Installed) to know if I can reach the maximum % disk usage (0% idle Time)
    The result : As you can see in picture 2, yes, I can get the max of my drive at ~ 1.2 Gb/sec read/write steady !
    Comment : I put 3 IO (cpu, disk, ram) on the graph of my computer during the test to see the impact of transfering many Go of data during ~10 sec...
    (picture 2)
    Now, I know my limits !  It's time to enter deeper in the subject !
    PPBM5 (H.264) Result
    I rendered the sequence (H.264) using Adobe Media Encoder.
    The result :
    My CPU is not used at 100%, the turn around 50%
    My Disk is totally idle !
    All the process usage are idle except process of (Adobe Media Encoder)
    The transfert rate seem to be a wave (up and down).  Probably caused by (Encrypt time....  write.... Encrypt time.... write...)  // It's ok, ~5Mb/sec during transfert rate !
    CPU Power management give 100% of clock to CPU during the encoding process (it's ok, the clock is stable during process).
    RAM, more than enough !  39 Go RAM free after the test !  // Excellent
    ~65 thread opened by Adobe Media Encoder (Good, thread is the sign that program try to using many cores !)
    GPU Load on card seem to be a wave also ! (up and down)  ~40% usage of GPU during the process of encoding.
    GPU Ram get 1.2Go of RAM (But with GTX 680, no problem and Quadro 6000 with 6 GB RAM, no problem !)
    Comment/Question : CPU is free (50%), disks are free (99%), GPU is free (60%), RAM is free (62%), my computer is not pushed at limit during the encoding process.  Why ????  Is there some time delay in the encoding process ?
    Other : Quadro 6000 & GTX 680 gives the same result !
    (picture 3)
    PPBM5 (Disk Test) Result (RAID LSI)
    I rendered the sequence (Disk Test) using Adobe Media Encoder on my RAID 0 LSI disk.
    The result :
    My CPU is not used at 100%
    My Disk wave and wave again, but far far from the limit !
    All the process usage are idle except process of (Adobe Media Encoder)
    The transfert rate wave and wave again (up and down).  Probably caused by (Buffering time....  write.... Buffering time.... write...)  // It's ok, ~375Mb/sec peak during transfert rate !  Easy !
    CPU Power management give 100% of clock to CPU during the encoding process (it's ok, the clock is stable during process).
    RAM, more than enough !  40.5 Go RAM free after the test !  // Excellent
    ~48 thread opened by Adobe Media Encoder (Good, thread is the sign that program try to using many cores !)
    GPU Load on card = 0 (This kind of encoding is GPU irrelevant)
    GPU Ram get 400Mb of RAM (No usage for encoding)
    Comment/Question : CPU is free (65%), disks are free (60%), GPU is free (100%), RAM is free (63%), my computer is not pushed at limit during the encoding process.  Why ????  Is there some time delay in the encoding process ?
    (picture 4)
    PPBM5 (Disk Test) Result (Direct in RAMDrive)
    I rendered the same sequence (Disk Test) using Adobe Media Encoder directly in my RamDrive
    Comment/Question : Look at the transfert rate under (picture 5).  It's exactly the same speed than with my RAID 0 LSI controller.  Impossible !  Look in the same picture the transfert rate I can reach with the ramdrive (> 3.0 Gb/sec steady) and I don't go under 30% of disk usage.  CPU is idle (70%), Disk is idle (100%), GPU is idle (100%) and RAM is free (63%).  // This kind of results let me REALLY confused.  It's smell bug and big problem with hardware and IO usage in CS6 !
    (picture 5)
    PPBM5 (MPEG-DVD) Result
    I rendered the sequence (MPEG-DVD) using Adobe Media Encoder.
    The result :
    My CPU is not used at 100%
    My Disk is totally idle !
    All the process usage are idle except process of (Adobe Media Encoder)
    The transfert rate wave and wave again (up and down).  Probably caused by (Encoding time....  write.... Encoding time.... write...)  // It's ok, ~2Mb/sec during transfert rate !  Real Joke !
    CPU Power management give 100% of clock to CPU during the encoding process (it's ok, the clock is stable during process).
    RAM, more than enough !  40 Go RAM free after the test !  // Excellent
    ~80 thread opened by Adobe Media Encoder (Lot of thread, but it's ok in multi-thread apps!)
    GPU Load on card = 100 (This use the maximum of my GPU)
    GPU Ram get 1Gb of RAM
    Comment/Question : CPU is free (70%), disks are free (98%), GPU is loaded (MAX), RAM is free (63%), my computer is pushed at limit during the encoding process for GPU only.  Now, for this kind of encoding, the speed limit is affected by the slower IO (Video Card GPU)
    Other : Quadro 6000 is slower than GTX 680 for this kind of encoding (~20 s slower than GTX).
    (picture 6)
    Encoding single clip FULL HD AVCHD to H.264 Result (Premiere Pro CS6)
    You can look the result in the picture.
    Comment/Question : CPU is free (55%), disks are free (99%), GPU is free (90%), RAM is free (65%), my computer is not pushed at limit during the encoding process.  Why ????   Adobe Premiere seem to have some bug with thread management.  My hardware is idle !  I understand AVCHD can be very difficult to decode, but where is the waste ?  My computer want, but the software not !
    (picture 7)
    Render composition using 3D Raytracer in After Effects CS6
    You can look the result in the picture.
    Comment : GPU seems to be the bottle neck when using After Effects.  CPU is free (99%), Disks are free (98%), Memory is free (60%) and it depend of the setting and type of project.
    Other : Quadro 6000 & GTX 680 gives the same result in time for rendering the composition.
    (picture 8)
    Conclusion
    There is nothing you can do (I thing) with CS6 to get better performance actually.  GTX 680 is the best (Consumer grade card) and the Quadro 6000 is the best (Profressional card).  Both of card give really similar result (I will probably return my GTX 680 since I not really get any better performance).  I not used Tesla card with my Quadro, but actually, both, Premiere Pro & After Effects doesn't use multi GPU.  I tried to used both card together (GTX & Quadro), but After Effects gives priority to the slower card (In this case, the GTX 680)
    Premiere Pro, I'm speechless !  Premiere Pro is not able to get max performance of my computer.  Not just 10% or 20%, but average 60%.  I'm a programmor, multi-threadling apps are difficult to manage and I can understand Adobe's programmor.  But actually, if anybody have comment about this post, tricks or any kind of solution, you can comment this post.  It's seem to be a bug...
    Thank you.

    Patrick,
    I can't explain everything, but let me give you some background as I understand it.
    The first issue is that CS6 has a far less efficient internal buffering or caching system than CS5/5.5. That is why the MPEG encoding in CS6 is roughly 2-3 times slower than the same test with CS5. There is some 'under-the-hood' processing going on that causes this significant performance loss.
    The second issue is that AME does not handle regular memory and inter-process memory very well. I have described this here: Latest News
    As to your test results, there are some other noteworthy things to mention. 3D Ray tracing in AE is not very good in using all CUDA cores. In fact it is lousy, it only uses very few cores and the threading is pretty bad and does not use the video card's capabilities effectively. Whether that is a driver issue with nVidia or an Adobe issue, I don't know, but whichever way you turn it, the end result is disappointing.
    The overhead AME carries in our tests is something we are looking into and the next test will only use direct export and no longer the AME queue, to avoid some of the problems you saw. That entails other problems for us, since we lose the capability to check encoding logs, but a solution is in the works.
    You see very low GPU usage during the H.264 test, since there are only very few accelerated parts in the timeline, in contrast to the MPEG2-DVD test, where there is rescaling going on and that is CUDA accelerated. The disk I/O test suffers from the problems mentioned above and is the reason that my own Disk I/O results are only 33 seconds with the current test, but when I extend the duration of that timeline to 3 hours, the direct export method gives me 22 seconds, although the amount of data to be written, 37,092 MB has increased threefold. An effective write speed of 1,686 MB/s.
    There are a number of performance issues with CS6 that Adobe is aware of, but whether they can be solved and in what time, I haven't the faintest idea.
    Just my $ 0.02

  • 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 issues with dynamic action (PL/SQL)

    Hi!
    I'm having perfomance issues with a dynamic action that is triggered on a button click.
    I have 5 drop down lists to select columns which the users want to filter, 5 drop down lists to select an operation and 5 boxes to input values.
    After that, there is a filter button that just submits the page based on the selected filters.
    This part works fine, the data is filtered almost instantaneously.
    After this, I have 3 column selectors and 3 boxes where users put values they wish to update the filtered rows to,
    There is an update button that calls the dynamic action (procedure that is written below).
    It should be straight out, the only performance issue could be the decode section, because I need to cover cases when user wants to set a value to null (@) and when he doesn't want update 3 columns, but less (he leaves '').
    Hence P99_X_UC1 || ' = decode('  || P99_X_UV1 ||','''','|| P99_X_UC1  ||',''@'',null,'|| P99_X_UV1  ||')
    However when I finally click the update button, my browser freezes and nothing happens on the table.
    Can anyone help me solve this and improve the speed of the update?
    Regards,
    Ivan
    P.S. The code for the procedure is below:
    create or replace
    PROCEDURE DWP.PROC_UPD
    (P99_X_UC1 in VARCHAR2,
    P99_X_UV1 in VARCHAR2,
    P99_X_UC2 in VARCHAR2,
    P99_X_UV2 in VARCHAR2,
    P99_X_UC3 in VARCHAR2,
    P99_X_UV3 in VARCHAR2,
    P99_X_COL in VARCHAR2,
    P99_X_O in VARCHAR2,
    P99_X_V in VARCHAR2,
    P99_X_COL2 in VARCHAR2,
    P99_X_O2 in VARCHAR2,
    P99_X_V2 in VARCHAR2,
    P99_X_COL3 in VARCHAR2,
    P99_X_O3 in VARCHAR2,
    P99_X_V3 in VARCHAR2,
    P99_X_COL4 in VARCHAR2,
    P99_X_O4 in VARCHAR2,
    P99_X_V4 in VARCHAR2,
    P99_X_COL5 in VARCHAR2,
    P99_X_O5 in VARCHAR2,
    P99_X_V5 in VARCHAR2,
    P99_X_CD in VARCHAR2,
    P99_X_VD in VARCHAR2
    ) IS
    l_sql_stmt varchar2(32600);
    p_table_name varchar2(30) := 'DWP.IZV_SLOG_DET'; 
    BEGIN
    l_sql_stmt := 'update ' || p_table_name || ' set '
    || P99_X_UC1 || ' = decode('  || P99_X_UV1 ||','''','|| P99_X_UC1  ||',''@'',null,'|| P99_X_UV1  ||'),'
    || P99_X_UC2 || ' = decode('  || P99_X_UV2 ||','''','|| P99_X_UC2  ||',''@'',null,'|| P99_X_UV2  ||'),'
    || P99_X_UC3 || ' = decode('  || P99_X_UV3 ||','''','|| P99_X_UC3  ||',''@'',null,'|| P99_X_UV3  ||') where '||
    P99_X_COL  ||' '|| P99_X_O  ||' ' || P99_X_V  || ' and ' ||
    P99_X_COL2 ||' '|| P99_X_O2 ||' ' || P99_X_V2 || ' and ' ||
    P99_X_COL3 ||' '|| P99_X_O3 ||' ' || P99_X_V3 || ' and ' ||
    P99_X_COL4 ||' '|| P99_X_O4 ||' ' || P99_X_V4 || ' and ' ||
    P99_X_COL5 ||' '|| P99_X_O5 ||' ' || P99_X_V5 || ' and ' ||
    P99_X_CD   ||       ' = '         || P99_X_VD ;
    --dbms_output.put_line(l_sql_stmt); 
    EXECUTE IMMEDIATE l_sql_stmt;
    END;

    Hi Ivan,
    I do not think that the decode is performance relevant. Maybe the update hangs because some other transaction has uncommitted changes to one of the affected rows or the where clause is not selective enough and needs to update a huge amount of records.
    Besides that - and I might be wrong, because I only know some part of your app - the code here looks like you have a huge sql injection vulnerability here. Maybe you should consider re-writing your logic in static sql. If that is not possible, you should make sure that the user input only contains allowed values, e.g. by white-listing P99_X_On (i.e. make sure they only contain known values like '=', '<', ...), and by using dbms_assert.enquote_name/enquote_literal on the other P99_X_nnn parameters.
    Regards,
    Christian

  • Performance Issues with Photoshop CS6 64-Bit

    Hello -
    Issue at hand: over the course of the last few weeks, I have noticed significant issues with performance since the last update to PS CS6 via the Adobe Application Manager, ranging from unexpected shut downs to bringing my workstation to a crawl (literally, my cursor seems to crawl across my displays). I'm curious as to if anyone else is experiencing these issues, or if there is a solution I have not yet tried. Here is a list of actions that result in these performance issues - there are likely more that I have either not experienced due to my frustration, or have not documented as occuring multiple times:
    Opening files - results in hanging process, takes 3-10 seconds to resolve
    Pasting from clipboard - results in hanging process, takes 3-10 seconds to resolve
    Saving files - takes 3-10 seconds to open the dialog, another 3-10 seconds to return to normal window (saving a compressed PNG)
    Eyedropper tool - will either crash Photoshop to desktop, or take 5-15 seconds to load
    Attempting to navigate any menu - will either crash Photoshop to desktop, or take 5-15 seconds to load
    Attempts I've taken to resolve this matter, which have failed:
    Uninstalled all fonts that I have added since the last update (this was a pain in the ***, thank you Windows explorer for being glitchy)
    Uninstall application and reinstall application
    Use 32-bit edition
    Changing process priority to Above Normal
    Confirm process affinity to all available CPU cores
    Change configuration of Photoshop performance options
    61% of memory is available to Photoshop to use (8969 MB)
    History states: 20; Cache levels: 6; Cache tile size: 1024K
    Scratch disks: active on production SSD, ~10GB space available
    Dedicated graphics processor is selected (2x nVidia cards in SLI)
    System Information:
    Intel i7 2600K @ 3.40GHz
    16GB DDR3, Dual Channel RAM
    2x nVidia GeForce GTS 450 cards, 1GB each
    Windows 7 Professional 64-bit
    Adobe Creative Cloud
    This issue is costing me time I could be working every day, and I'm about ready to begin searching for alternatives and cancel my membership if I can't get this resolved.

    Adobe Photoshop Version: 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00) x64
    Operating System: Windows 7 64-bit
    Version: 6.1 Service Pack 1
    System architecture: Intel CPU Family:6, Model:10, Stepping:7 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2, HyperThreading
    Physical processor count: 4
    Logical processor count: 8
    Processor speed: 3392 MHz
    Built-in memory: 16350 MB
    Free memory: 12070 MB
    Memory available to Photoshop: 14688 MB
    Memory used by Photoshop: 61 %
    Image tile size: 1024K
    Image cache levels: 6
    OpenGL Drawing: Enabled.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: True.
    OpenGL Allow Old GPUs: Not Detected.
    OpenCL Version: 1.1 CUDA 4.2.1
    OpenGL Version: 3.0
    Video Rect Texture Size: 16384
    OpenGL Memory: 1024 MB
    Video Card Vendor: NVIDIA Corporation
    Video Card Renderer: GeForce GTS 450/PCIe/SSE2
    Display: 2
    Display Bounds: top=0, left=1920, bottom=1080, right=3840
    Display: 1
    Display Bounds: top=0, left=0, bottom=1080, right=1920
    Video Card Number: 3
    Video Card: NVIDIA GeForce GTS 450
    Driver Version: 9.18.13.1106
    Driver Date: 20130118000000.000000-000
    Video Card Driver: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
    Video Mode:
    Video Card Caption: NVIDIA GeForce GTS 450
    Video Card Memory: 1024 MB
    Video Card Number: 2
    Video Card: LogMeIn Mirror Driver
    Driver Version: 7.1.542.0
    Driver Date: 20060522000000.000000-000
    Video Card Driver:
    Video Mode: 1920 x 1080 x 4294967296 colors
    Video Card Caption: LogMeIn Mirror Driver
    Video Card Memory: 0 MB
    Video Card Number: 1
    Video Card: NVIDIA GeForce GTS 450
    Driver Version: 9.18.13.1106
    Driver Date: 20130118000000.000000-000
    Video Card Driver: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
    Video Mode: 1920 x 1080 x 4294967296 colors
    Video Card Caption: NVIDIA GeForce GTS 450
    Video Card Memory: 1024 MB
    Serial number: 90970233273769828003
    Application folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\
    Temporary file path: C:\Users\ANDREW~1\AppData\Local\Temp\
    Photoshop scratch has async I/O enabled
    Scratch volume(s):
      C:\, 111.8G, 7.68G free
    Required Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Required\
    Primary Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\
    Additional Plug-ins folder: not set
    Installed components:
       ACE.dll   ACE 2012/06/05-15:16:32   66.507768   66.507768
       adbeape.dll   Adobe APE 2012/01/25-10:04:55   66.1025012   66.1025012
       AdobeLinguistic.dll   Adobe Linguisitc Library   6.0.0  
       AdobeOwl.dll   Adobe Owl 2012/09/10-12:31:21   5.0.4   79.517869
       AdobePDFL.dll   PDFL 2011/12/12-16:12:37   66.419471   66.419471
       AdobePIP.dll   Adobe Product Improvement Program   7.0.0.1686  
       AdobeXMP.dll   Adobe XMP Core 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPFiles.dll   Adobe XMP Files 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPScript.dll   Adobe XMP Script 2012/02/06-14:56:27   66.145661   66.145661
       adobe_caps.dll   Adobe CAPS   6,0,29,0  
       AGM.dll   AGM 2012/06/05-15:16:32   66.507768   66.507768
       ahclient.dll    AdobeHelp Dynamic Link Library   1,7,0,56  
       aif_core.dll   AIF   3.0   62.490293
       aif_ocl.dll   AIF   3.0   62.490293
       aif_ogl.dll   AIF   3.0   62.490293
       amtlib.dll   AMTLib (64 Bit)   6.0.0.75 (BuildVersion: 6.0; BuildDate: Mon Jan 16 2012 18:00:00)   1.000000
       ARE.dll   ARE 2012/06/05-15:16:32   66.507768   66.507768
       AXE8SharedExpat.dll   AXE8SharedExpat 2011/12/16-15:10:49   66.26830   66.26830
       AXEDOMCore.dll   AXEDOMCore 2011/12/16-15:10:49   66.26830   66.26830
       Bib.dll   BIB 2012/06/05-15:16:32   66.507768   66.507768
       BIBUtils.dll   BIBUtils 2012/06/05-15:16:32   66.507768   66.507768
       boost_date_time.dll   DVA Product   6.0.0  
       boost_signals.dll   DVA Product   6.0.0  
       boost_system.dll   DVA Product   6.0.0  
       boost_threads.dll   DVA Product   6.0.0  
       cg.dll   NVIDIA Cg Runtime   3.0.00007  
       cgGL.dll   NVIDIA Cg Runtime   3.0.00007  
       CIT.dll   Adobe CIT   2.1.0.20577   2.1.0.20577
       CoolType.dll   CoolType 2012/06/05-15:16:32   66.507768   66.507768
       data_flow.dll   AIF   3.0   62.490293
       dvaaudiodevice.dll   DVA Product   6.0.0  
       dvacore.dll   DVA Product   6.0.0  
       dvamarshal.dll   DVA Product   6.0.0  
       dvamediatypes.dll   DVA Product   6.0.0  
       dvaplayer.dll   DVA Product   6.0.0  
       dvatransport.dll   DVA Product   6.0.0  
       dvaunittesting.dll   DVA Product   6.0.0  
       dynamiclink.dll   DVA Product   6.0.0  
       ExtendScript.dll   ExtendScript 2011/12/14-15:08:46   66.490082   66.490082
       FileInfo.dll   Adobe XMP FileInfo 2012/01/17-15:11:19   66.145433   66.145433
       filter_graph.dll   AIF   3.0   62.490293
       hydra_filters.dll   AIF   3.0   62.490293
       icucnv40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       icudt40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       image_compiler.dll   AIF   3.0   62.490293
       image_flow.dll   AIF   3.0   62.490293
       image_runtime.dll   AIF   3.0   62.490293
       JP2KLib.dll   JP2KLib 2011/12/12-16:12:37   66.236923   66.236923
       libifcoremd.dll   Intel(r) Visual Fortran Compiler   10.0 (Update A)  
       libmmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   12.0  
       LogSession.dll   LogSession   2.1.2.1681  
       mediacoreif.dll   DVA Product   6.0.0  
       MPS.dll   MPS 2012/02/03-10:33:13   66.495174   66.495174
       msvcm80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcm90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcp100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcp80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcp90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcr100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcr80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6195  
       msvcr90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       pdfsettings.dll   Adobe PDFSettings   1.04  
       Photoshop.dll   Adobe Photoshop CS6   CS6  
       Plugin.dll   Adobe Photoshop CS6   CS6  
       PlugPlug.dll   Adobe(R) CSXS PlugPlug Standard Dll (64 bit)   3.0.0.383  
       PSArt.dll   Adobe Photoshop CS6   CS6  
       PSViews.dll   Adobe Photoshop CS6   CS6  
       SCCore.dll   ScCore 2011/12/14-15:08:46   66.490082   66.490082
       ScriptUIFlex.dll   ScriptUIFlex 2011/12/14-15:08:46   66.490082   66.490082
       svml_dispmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   12.0  
       tbb.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       tbbmalloc.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       updaternotifications.dll   Adobe Updater Notifications Library   6.0.0.24 (BuildVersion: 1.0; BuildDate: BUILDDATETIME)   6.0.0.24
       WRServices.dll   WRServices Friday January 27 2012 13:22:12   Build 0.17112   0.17112
    Required plug-ins:
       3D Studio 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Accented Edges 13.0
       Adaptive Wide Angle 13.0
       Angled Strokes 13.0
       Average 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Bas Relief 13.0
       BMP 13.0
       Camera Raw 8.1
       Camera Raw Filter 8.1
       Chalk & Charcoal 13.0
       Charcoal 13.0
       Chrome 13.0
       Cineon 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Clouds 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Collada 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Color Halftone 13.0
       Colored Pencil 13.0
       CompuServe GIF 13.0
       Conté Crayon 13.0
       Craquelure 13.0
       Crop and Straighten Photos 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Crop and Straighten Photos Filter 13.0
       Crosshatch 13.0
       Crystallize 13.0
       Cutout 13.0
       Dark Strokes 13.0
       De-Interlace 13.0
       Dicom 13.0
       Difference Clouds 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Diffuse Glow 13.0
       Displace 13.0
       Dry Brush 13.0
       Eazel Acquire 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Embed Watermark 4.0
       Entropy 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Extrude 13.0
       FastCore Routines 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Fibers 13.0
       Film Grain 13.0
       Filter Gallery 13.0
       Flash 3D 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Fresco 13.0
       Glass 13.0
       Glowing Edges 13.0
       Google Earth 4 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Grain 13.0
       Graphic Pen 13.0
       Halftone Pattern 13.0
       HDRMergeUI 13.0
       IFF Format 13.0
       Ink Outlines 13.0
       JPEG 2000 13.0
       Kurtosis 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Lens Blur 13.0
       Lens Correction 13.0
       Lens Flare 13.0
       Liquify 13.0
       Matlab Operation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Maximum 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mean 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Measurement Core 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Median 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mezzotint 13.0
       Minimum 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       MMXCore Routines 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Mosaic Tiles 13.0
       Multiprocessor Support 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Neon Glow 13.0
       Note Paper 13.0
       NTSC Colors 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Ocean Ripple 13.0
       Oil Paint 13.0
       OpenEXR 13.0
       Paint Daubs 13.0
       Palette Knife 13.0
       Patchwork 13.0
       Paths to Illustrator 13.0
       PCX 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Photocopy 13.0
       Photoshop 3D Engine 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Picture Package Filter 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Pinch 13.0
       Pixar 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Plaster 13.0
       Plastic Wrap 13.0
       PNG 13.0
       Pointillize 13.0
       Polar Coordinates 13.0
       Portable Bit Map 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Poster Edges 13.0
       Radial Blur 13.0
       Radiance 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Range 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Read Watermark 4.0
       Reticulation 13.0
       Ripple 13.0
       Rough Pastels 13.0
       Save for Web 13.0
       ScriptingSupport 13.1.2
       Shear 13.0
       Skewness 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Smart Blur 13.0
       Smudge Stick 13.0
       Solarize 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Spatter 13.0
       Spherize 13.0
       Sponge 13.0
       Sprayed Strokes 13.0
       Stained Glass 13.0
       Stamp 13.0
       Standard Deviation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       STL 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Sumi-e 13.0
       Summation 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Targa 13.0
       Texturizer 13.0
       Tiles 13.0
       Torn Edges 13.0
       Twirl 13.0
       Underpainting 13.0
       Vanishing Point 13.0
       Variance 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Variations 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Water Paper 13.0
       Watercolor 13.0
       Wave 13.0
       Wavefront|OBJ 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       WIA Support 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       Wind 13.0
       Wireless Bitmap 13.1.2 (13.1.2 20130105.r.224 2013/01/05:23:00:00)
       ZigZag 13.0
    Optional and third party plug-ins: NONE
    Plug-ins that failed to load: NONE
    Flash:
       Mini Bridge
       Kuler
    Installed TWAIN devices: NONE

  • Performance issues with version enable partitioned tables?

    Hi all,
    Are there any known performance issues with version enable partitioned tables?
    I’ve been doing some performance testes with a large version enable partitioned table and it seems that OCB optimiser is choosing very expensive plans during merge operations.
    Tanks in advance,
    Vitor
    Example:
         Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    UPDATE STATEMENT Optimizer Mode=CHOOSE          1          249                    
    UPDATE     SIG.SIG_QUA_IMG_LT                                   
    NESTED LOOPS SEMI          1     266     249                    
    PARTITION RANGE ALL                                   1     9
    TABLE ACCESS FULL     SIG.SIG_QUA_IMG_LT     1     259     2               1     9
    VIEW     SYS.VW_NSO_1     1     7     247                    
    NESTED LOOPS          1     739     247                    
    NESTED LOOPS          1     677     247                    
    NESTED LOOPS          1     412     246                    
    NESTED LOOPS          1     114     244                    
    INDEX RANGE SCAN     WMSYS.MODIFIED_TABLES_PK     1     62     2                    
    INDEX RANGE SCAN     SIG.QIM_PK     1     52     243                    
    TABLE ACCESS BY GLOBAL INDEX ROWID     SIG.SIG_QUA_IMG_LT     1     298     2               ROWID     ROW L
    INDEX RANGE SCAN     SIG.SIG_QUA_IMG_PKI$     1          1                    
    INDEX RANGE SCAN     WMSYS.WM$NEXTVER_TABLE_NV_INDX     1     265     1                    
    INDEX UNIQUE SCAN     WMSYS.MODIFIED_TABLES_PK     1     62                         
    /* Formatted on 2004/04/19 18:57 (Formatter Plus v4.8.0) */                                        
    UPDATE /*+ USE_NL(Z1) ROWID(Z1) */sig.sig_qua_img_lt z1                                        
    SET z1.nextver =                                        
    SYS.ltutil.subsversion                                        
    (z1.nextver,                                        
    SYS.ltutil.getcontainedverinrange (z1.nextver,                                        
    'SIG.SIG_QUA_IMG',                                        
    'NpCyPCX3dkOAHSuBMjGioQ==',                                        
    4574,                                        
    4575                                        
    4574                                        
    WHERE z1.ROWID IN (
    (SELECT /*+ ORDERED USE_NL(T1) USE_NL(T2) USE_NL(J2) USE_NL(J3)
    INDEX(T1 QIM_PK) INDEX(T2 SIG_QUA_IMG_PKI$)
    INDEX(J2 WM$NEXTVER_TABLE_NV_INDX) INDEX(J3 MODIFIED_TABLES_PK) */
    t2.ROWID
    FROM (SELECT /*+ INDEX(WM$MODIFIED_TABLES MODIFIED_TABLES_PK) */
    UNIQUE VERSION
    FROM wmsys.wm$modified_tables
    WHERE table_name = 'SIG.SIG_QUA_IMG'
    AND workspace = 'NpCyPCX3dkOAHSuBMjGioQ=='
    AND VERSION > 4574
    AND VERSION <= 4575) j1,
    sig.sig_qua_img_lt t1,
    sig.sig_qua_img_lt t2,
    wmsys.wm$nextver_table j2,
    (SELECT /*+ INDEX(WM$MODIFIED_TABLES MODIFIED_TABLES_PK) */
    UNIQUE VERSION
    FROM wmsys.wm$modified_tables
    WHERE table_name = 'SIG.SIG_QUA_IMG'
    AND workspace = 'NpCyPCX3dkOAHSuBMjGioQ=='
    AND VERSION > 4574
    AND VERSION <= 4575) j3
    WHERE t1.VERSION = j1.VERSION
    AND t1.ima_id = t2.ima_id
    AND t1.qim_inf_esq_x_tile = t2.qim_inf_esq_x_tile
    AND t1.qim_inf_esq_y_tile = t2.qim_inf_esq_y_tile
    AND t2.nextver != '-1'
    AND t2.nextver = j2.next_vers
    AND j2.VERSION = j3.VERSION))

    Hello Vitor,
    There are currently no known issues with version enabled tables that are partitioned. The merge operation may need to access all of the partitions of a table depending on the data that needs to be moved/copied from the child to the parent. This is the reason for the 'Partition Range All' step in the plan that you provided. The majority of the remaining steps are due to the hints that have been added, since this plan has provided the best performance for us in the past for this particular statement. If this is not the case for you, and you feel that another plan would yield better performance, then please let me know and I will take a look at it.
    One suggestion would be to make sure that the table was been recently analyzed so that the optimizer has the most current data about the table.
    Performance issues are very hard to fix without a reproducible test case, so it may be advisable to file a TAR if you continue to have significant performance issues with the mergeWorkspace operation.
    Thank You,
    Ben

  • Performance issues with the Tuxedo MQ Adapter

    We are experimenting some performance issues with the MQ Adapter. For example, we are seeing that the MQ Adapter takes from 10 to 100 ms in reading a single message from the queue and sending to the Tuxedo service. The Tuxedo service takes 80 ms in its execution so there is a considerable waste of time in the MQ adapter that we cannot explain.
    Also, we have looked a lot of rollback transactions on the MQ adapter, for example we got 980 rollback transactions for 15736 transactions sent and only the MQ adapter is involved in the rollback. However, the operations are executed properly. The error we got is
    135027.122.hqtux101!MQI_QMTESX01.7636.1.0: gtrid x0 x4ec1491f x25b59: LIBTUX_CAT:376: ERROR: tpabort: xa_rollback returned XA_RBROLLBACK.
    I am looking for information at Oracle site, but I have not found nothing. Could you or someone from your team help me?

    Hi Todd,
    We have 6 MQI adapters reading from 5 different queues, but in this case we are writing in only one queue.
    Someone from Oracle told us that the XA_RBROLLBACK occurs because we have 6 MQ adapters that are reading from the same queues and when one adapter finds a message and try to get that message, it can occurs that other MQ Adapter gets it before. In this case, the MQ adapter rollbacks the transaction. Even when we got some XA_RBROLLBACK errors, we don´t lose message. Also, I read something about that when XA sends a xa_end call to MQ adapter, it actually does the rollback, so when the MQ adapter receives the xa_rollback call, it answers with XA_RBROLLBACK. Is that true?
    However, I am more worried about the performance. We are putting a request message in a MQ queue and waiting for the reply. In some cases, it takes 150ms and in other cases it takes much more longer (more than 400ms). The average is 300ms. MQ adapter calls a service (txgralms0) which lasts 110ms in average.
    This is our configuration:
    "MQI_QMTESX01" SRVGRP="g03000" SRVID=3000
    CLOPT="-- -C /tuxedo/qt/txqgral00/control/src/MQI_QMTESX01.cfg"
    RQPERM=0600 REPLYQ=N RPPERM=0600 MIN=6 MAX=6 CONV=N
    SYSTEM_ACCESS=FASTPATH
    MAXGEN=1 GRACE=86400 RESTART=N
    MINDISPATCHTHREADS=0 MAXDISPATCHTHREADS=1 THREADSTACKSIZE=0
    SICACHEENTRIESMAX="500"
    /tuxedo/qt/txqgral00/control/src/MQI_QMTESX01.cfg:
    *SERVER
    MINMSGLEVEL=0
    MAXMSGLEVEL=0
    DEFMAXMSGLEN=4096
    TPESVCFAILDATA=Y
    *QUEUE_MANAGER
    LQMID=QMTESX01
    NAME=QMTESX01
    *SERVICE
    NAME=txgralms0
    FORMAT=MQSTR
    TRAN=N
    *QUEUE
    LQMID=QMTESX01
    MQNAME=QAT.Q.NACAR.TO.TUX.KGCRQ01
    *QUEUE
    LQMID=QMTESX01
    MQNAME=QAT.Q.NACAR.TO.TUX.KGCPQ01
    *QUEUE
    LQMID=QMTESX01
    MQNAME=QAT.Q.NACAR.TO.TUX.KPSAQ01
    *QUEUE
    LQMID=QMTESX01
    MQNAME=QAT.Q.NACAR.TO.TUX.KPINQ01
    *QUEUE
    LQMID=QMTESX01
    MQNAME=QAT.Q.NACAR.TO.TUX.KDECQ01
    Thanks in advance,
    Marling

  • Performance issues

    Hi,
    The program(developed by someother person) which was given to me is having performance issue. Its giving RUNTIME ERROR 'TIME LIMIT EXCEEDED'. Can u please suggest me in what way i can improve the performance of the program.
    please help me in resolving this.
    Helpful answers will be rewarded.
    TABLES : MARA, "General Material Data
    MARC, "Plant Data for Material
    VBAP, "Sales Document: Item Data
    MARD, "Storage Location Data for Material
    MAST, "Material to BOM Link
    MKPF, "Header: Material Document
    MSEG, "Document Segment: Material
    PKHD, "Control Cycle
    PKPS, "Control Cycle Item / Kanban
    PVBE, "Supply area
    ZTGRP, "Wabco Technology Group table
    ZZC10. "Kanban status table
    I N T E R N A L T A B L E D E C L A R A T I O N *
    INTERNAL TABLE FOR TECH.GROUP AND PLANT
    DATA: BEGIN OF IT_MARC_ZTGRP OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    ZZPTG LIKE ZTGRP-ZZPTG,
    ZZPTD LIKE ZTGRP-ZZPTD,
    END OF IT_MARC_ZTGRP.
    INTERNAL TABLE FOR RETURN VALUES
    DATA IT_RETURN LIKE TABLE OF BAPIRET2 WITH HEADER LINE.
    INTERNAL TABLE FOR SUBASSEMBLY AND FINISHED GOOD
    DATA: BEGIN OF IT_MATERIAL OCCURS 0,
    IDNRK LIKE STPO-IDNRK,
    MATNR LIKE MAST-MATNR,
    END OF IT_MATERIAL.
    INTERNAL TABLE FOR OUTPUT YESTERDAY
    DATA: BEGIN OF IT_KBED_KAKO OCCURS 0,
    KBEAREST LIKE KBED-KBEAREST,
    KRUEREST LIKE KBED-KRUEREST,
    KEINH LIKE KBED-KEINH,
    END OF IT_KBED_KAKO.
    INTERNAL TABLE FOR MATERIAL AND PLANT
    DATA: BEGIN OF IT_PLANT OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    END OF IT_PLANT.
    DATA: BEGIN OF IT_COBK OCCURS 0,
    RUECK LIKE COBK-REFBN,
    END OF IT_COBK.
    DATA: BEGIN OF IT_COEPL OCCURS 0,
    KOKRS LIKE COEPL-KOKRS,
    BELNR LIKE COEPL-BELNR,
    END OF IT_COEPL.
    DATA: BEGIN OF IT_CAPACITIES OCCURS 0,
    LSBBTR LIKE COEPL-LSBBTR,
    MEINB LIKE COEPL-MEINB,
    END OF IT_CAPACITIES.
    DATA: BEGIN OF IT_MKPF_MSEG OCCURS 0,
    MBLNR LIKE MKPF-MBLNR,
    MJAHR LIKE MKPF-MJAHR,
    BUDAT LIKE MKPF-BUDAT,
    BWART LIKE MSEG-BWART,
    MATNR LIKE MSEG-MATNR,
    MENGE LIKE MSEG-MENGE,
    MEINS LIKE MSEG-MEINS,
    DMBTR LIKE MSEG-DMBTR,
    WERKS LIKE MSEG-WERKS,
    END OF IT_MKPF_MSEG.
    INTERNAL TABLE FOR MATERIAL-TO-BOM LINK
    DATA: IT_MAST LIKE MAST OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL
    DATA: BEGIN OF IT_MAT OCCURS 0,
    MATNR LIKE MARA-MATNR,
    END OF IT_MAT.
    INTERNAL TABLE FOR STORAGE LOCATION DATA FOR SUBASSEMBLY
    DATA: BEGIN OF IT_MARD OCCURS 0,
    LABST LIKE MARD-LABST,
    END OF IT_MARD.
    INTERNAL TABLE FOR PLANT FOR MATERIALS
    DATA IT_MARC LIKE MARC OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR BOM ITEM DATA
    DATA: IT_STPO LIKE STPO OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR KANBAN STATUS DATA
    DATA IT_ZZC10 LIKE ZZC10 OCCURS 0 WITH HEADER LINE.
    TEMPORARY INTERNAL TABLE FOR KANBAN STATUS DATA
    DATA IT_ZZC10_TEMP LIKE ZZC10 OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR CONTROL CYCLE
    DATA IT_PKHD LIKE PKHD OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR CONTROL CYCLE ITEM
    DATA IT_PKPS LIKE PKPS OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL DOCUMENT HEADER
    DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR MATERIAL DOCUMENT ITEM
    DATA IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
    TEMPORARY INTERNAL TABLE FOR ACTUAL QUANTITY
    DATA : BEGIN OF IT_TEMP OCCURS 0,
    TECH LIKE ZTGRP-ZZPTD,
    MATNR LIKE ZZC10-MATNR,
    FINISHED LIKE MAST-MATNR,
    PKNUM LIKE PKHD-PKNUM,
    WERKS LIKE ZZC10-WERKS,
    GSMNG LIKE PLAF-GSMNG,
    MEINS LIKE PLAF-MEINS,
    BEHAZ LIKE PKHD-BEHAZ,
    BEHMG LIKE PKHD-BEHMG,
    PKBMG LIKE ZZC10-PKBMG,
    LATEHOURS LIKE PKHD-KWBZM,
    FILLRATE TYPE P DECIMALS 2,
    REPL_LEAD_TIME TYPE P DECIMALS 3,
    QTY_1 LIKE PLAF-GSMNG,
    QTY_2 LIKE PLAF-GSMNG,
    QTY_3 LIKE PLAF-GSMNG,
    QTY_4 LIKE PLAF-GSMNG,
    QTY_5 LIKE PLAF-GSMNG,
    QTY_6 LIKE PLAF-GSMNG,
    GSMNG_OUTY LIKE PLAF-GSMNG,
    MEINS_OUTY LIKE PLAF-MEINS,
    KAPBD_OUTY LIKE COEPL-LSTBTR,
    KEINH_OUTY LIKE COEPL-MEINH,
    GSMNG_OUTM LIKE MSEG-MENGE,
    MEINS_OUTM LIKE MSEG-MEINS,
    KAPBD_OUTM LIKE COEPL-LSTBTR,
    KEINH_OUTM LIKE COEPL-MEINH,
    GSMNG_BORD LIKE PLAF-GSMNG,
    MEINS_BORD LIKE MSEG-MEINS,
    KAPBD_BORD LIKE KBED-KBEAREST,
    KEINH_BORD LIKE COEPL-MEINH,
    GSMNG_TDAY LIKE PLAF-GSMNG,
    KAPBD_TDAY LIKE KBED-KBEAREST,
    GSMNG_DAY1 LIKE PLAF-GSMNG,
    KAPBD_DAY1 LIKE KBED-KBEAREST,
    GSMNG_DAY2 LIKE PLAF-GSMNG,
    KAPBD_DAY2 LIKE KBED-KBEAREST,
    GSMNG_DAY3 LIKE PLAF-GSMNG,
    KAPBD_DAY3 LIKE KBED-KBEAREST,
    GSMNG_DAY4 LIKE PLAF-GSMNG,
    KAPBD_DAY4 LIKE KBED-KBEAREST,
    GSMNG_DAY5 LIKE PLAF-GSMNG,
    KAPBD_DAY5 LIKE KBED-KBEAREST,
    STOCK_PO01 LIKE MARD-LABST,
    F_GSMNG_BORD LIKE PLAF-GSMNG,
    F_MEINS_BORD LIKE MSEG-MEINS,
    F_KAPBD_BORD LIKE KBED-KBEAREST,
    F_KEINH_BORD LIKE COEPL-MEINH,
    F_GSMNG_TDAY LIKE PLAF-GSMNG,
    F_MEINS_TDAY LIKE MSEG-MEINS,
    F_KAPBD_TDAY LIKE KBED-KBEAREST,
    F_KEINH_TDAY LIKE COEPL-MEINH,
    F_GSMNG_DAY1 LIKE PLAF-GSMNG,
    F_MEINS_DAY1 LIKE MSEG-MEINS,
    F_KAPBD_DAY1 LIKE KBED-KBEAREST,
    F_KEINH_DAY1 LIKE COEPL-MEINH,
    F_GSMNG_DAY2 LIKE PLAF-GSMNG,
    F_MEINS_DAY2 LIKE MSEG-MEINS,
    F_KAPBD_DAY2 LIKE KBED-KBEAREST,
    F_KEINH_DAY2 LIKE COEPL-MEINH,
    F_GSMNG_DAY3 LIKE PLAF-GSMNG,
    F_MEINS_DAY3 LIKE MSEG-MEINS,
    F_KAPBD_DAY3 LIKE KBED-KBEAREST,
    F_KEINH_DAY3 LIKE COEPL-MEINH,
    F_GSMNG_DAY4 LIKE PLAF-GSMNG,
    F_MEINS_DAY4 LIKE MSEG-MEINS,
    F_KAPBD_DAY4 LIKE KBED-KBEAREST,
    F_KEINH_DAY4 LIKE COEPL-MEINH,
    F_GSMNG_DAY5 LIKE PLAF-GSMNG,
    F_MEINS_DAY5 LIKE MSEG-MEINS,
    F_KAPBD_DAY5 LIKE KBED-KBEAREST,
    F_KEINH_DAY5 LIKE COEPL-MEINH,
    F_GSMNG_OUTM LIKE MSEG-MENGE,
    F_MEINS_OUTM LIKE MSEG-MEINS,
    F_KAPBD_OUTM LIKE COEPL-LSTBTR,
    F_KEINH_OUTM LIKE COEPL-MEINH,
    F_GSMNG_OUTN LIKE MSEG-MENGE,
    F_MEINS_OUTN LIKE MSEG-MEINS,
    F_KAPBD_OUTN LIKE KBED-KBEAREST,
    F_KEINH_OUTN LIKE COEPL-MEINH,
    END OF IT_TEMP.
    INTERNAL TABLE FOR PLANNED DATA
    DATA IT_PLAF LIKE PLAF OCCURS 0 WITH HEADER LINE.
    INTERNAL TABLE FOR FACTORY CALENDER AND CURRENCY
    DATA: BEGIN OF IT_T001W OCCURS 0,
    WERKS LIKE T001W-WERKS,
    BWKEY LIKE T001W-BWKEY,
    FABKL LIKE T001W-FABKL,
    END OF IT_T001W.
    V A R I A B L E S *
    DATA: AUX_BORD LIKE SY-DATUM,
    AUX_YDAY LIKE SY-DATUM,
    AUX_TDAY LIKE SY-DATUM,
    AUX_DAY1 LIKE SY-DATUM,
    AUX_DAY2 LIKE SY-DATUM,
    AUX_DAY3 LIKE SY-DATUM,
    AUX_DAY4 LIKE SY-DATUM,
    AUX_DAY5 LIKE SY-DATUM,
    AUX_CURRENT LIKE SY-DATUM,
    AUX_PREVIOUS LIKE SY-DATUM,
    AUX_TECH LIKE ZTGRP-ZZPTD,
    AUX_BUDAT LIKE MKPF-BUDAT,
    AUX_LOW LIKE MKPF-BUDAT,
    AUX_HIGH LIKE MKPF-BUDAT,
    AUX_MNG LIKE MSEG-MENGE,
    AUX_MENGE LIKE MSEG-MENGE,
    AUX_QUANT LIKE PLAF-GSMNG,
    AUX_SUM_UNIT LIKE UMADD-MSEHI,
    AUX_TIMESTAMP1 LIKE CCUPEAKA-TIMESTAMP,
    AUX_TIMESTAMP2 LIKE CCUPEAKA-TIMESTAMP,
    AUX_BUKRS LIKE T001K-BUKRS,
    AUX_BWKEY LIKE T001W-BWKEY,
    AUX_GSMNG LIKE PLAF-GSMNG,
    AUX_PKBMG LIKE ZZC10-PKBMG,
    AUX_FILL LIKE ZZC10-PKBMG,
    AUX_TOTAL LIKE ZZC10-PKBMG,
    AUX_FABKL LIKE SCAL-FCALID,
    AUX_WAERS LIKE MSEG-WAERS,
    AUX_ZZC10_HR TYPE P DECIMALS 3,
    AUX_PLAF_HR TYPE P DECIMALS 3,
    AUX_KAPBD_OUTY TYPE P DECIMALS 3,
    AUX_KAPBD_OUTM TYPE P DECIMALS 3,
    AUX_KAPBD_BORD TYPE P DECIMALS 3,
    AUX_F_KAPBD_BORD TYPE P DECIMALS 3,
    AUX_F_KAPBD_TDAY TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY1 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY2 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY3 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY4 TYPE P DECIMALS 3,
    AUX_F_KAPBD_DAY5 TYPE P DECIMALS 3,
    AUX_F_KAPBD_OUTM TYPE P DECIMALS 3,
    AUX_F_KAPBD_OUTN TYPE P DECIMALS 3,
    AUX_PKHD_TIME TYPE P DECIMALS 3,
    AUX_LATEHOURS TYPE P DECIMALS 3,
    AUX_DIFF TYPE I,
    AUX_FLAG TYPE C,
    AUX_SET TYPE C,
    AUX_DATUMABSOLUT(5) TYPE P,
    AUX_FDAY LIKE SY-DATUM,
    AUX_DAYS LIKE PKHD-KWBZD,
    AUX_HOURS LIKE IT_ZZC10-TIME_EMPTY,
    AUX_TIME LIKE PKHD-KWBZM,
    AUX_PKHD_DAYS LIKE PKHD-KWBZD,
    AUX_PKHD_HOURS LIKE PKHD-KWBZM,
    AUX_TMP_DAYS LIKE PKHD-KWBZM VALUE 24,
    AUX_TMP_HRS LIKE PKHD-KWBZM,
    AUX_FILL_DAYS LIKE PKHD-KWBZD,
    AUX_FILL_HOURS LIKE AUX_HOURS,
    AUX_FILL_TIME LIKE PKHD-KWBZM,
    AUX_TOTAL_QTY LIKE PKHD-BEHMG,
    AUX_RATID LIKE PLAF-RATID,
    AUX_MATNR LIKE PLAF-MATNR,
    AUX_HEADER LIKE MARA-MATNR,
    AUX_ZZPTG LIKE MARC-ZZPTG,
    AUX_PEDTR LIKE PLAF-PEDTR,
    AUX_KRUEREST LIKE KBED-KRUEREST,
    AUX_KBEAREST LIKE KBED-KBEAREST,
    AUX_KRUEREST_T LIKE KBED-KRUEREST,
    AUX_KBEAREST_T LIKE KBED-KBEAREST,
    AUX_KEINH LIKE KBED-KEINH,
    AUX_KAPBD LIKE KBED-KBEAREST,
    AUX_ARBPL LIKE MKAL-MDV01,
    AUX_ARBID LIKE CRHD-OBJID,
    AUX_QUALF LIKE CRHD-QUALF,
    AUX_SAT1800 LIKE SY-UZEIT VALUE '180000'.
    S E L E C T I O N S C R E E N *
    INPUT SELECTION
    SELECTION-SCREEN : BEGIN OF BLOCK BL0 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS : SO_PRVBE FOR PVBE-PRVBE,
    SO_MATNR FOR MARA-MATNR,
    SO_ZZPTG FOR MARC-ZZPTG OBLIGATORY,
    SO_WERKS FOR MARC-WERKS OBLIGATORY,
    SO_BUDAT FOR MKPF-BUDAT OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK BL0.
    I N I T I A L I Z A T I O N *
    INITIALIZATION.
    MOVE SY-DATUM TO AUX_CURRENT.
    AUX_PREVIOUS = AUX_CURRENT - 1.
    MOVE SY-DATUM TO SO_BUDAT-LOW.
    MOVE '01' TO SO_BUDAT-LOW+6(2).
    APPEND SO_BUDAT.
    AUX_PREVIOUS = AUX_CURRENT - 1.
    A T S E L E C T I O N - S C R E E N *
    AT SELECTION-SCREEN.
    CHECK ON SELECTION SCREEN
    PERFORM CHECK_ON_SELECTION.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    CHECK IF BOM EXISTS FOR THE COMPONENTS
    PERFORM CHECK_BOM_EXISTENCE.
    GET FINISHED PRODUCT NUMBER FOR THE SUBASSEMBLIES
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    LOOP AT IT_MARC_ZTGRP.
    PERFORM GET_HEADER_MATERIAL USING IT_MARC_ZTGRP-MATNR.
    IF NOT IT_MAT[] IS INITIAL.
    PERFORM GET_FINISHED_GOOD TABLES IT_MAT.
    ENDIF.
    CLEAR IT_MARC_ZTGRP.
    ENDLOOP.
    ELSE.
    MESSAGE S010 WITH 'No data present for given selection'.
    ENDIF.
    CHECK IF SALES DATA EXIST FOR THE FINISHED GOOD
    PERFORM CHECK_SALESDATA_EXISTENCE.
    GET CONTROL CYCLE AND KANBAN DATA
    PERFORM GET_KANBAN_DATA.
    GET VALUATION AREA DATA
    PERFORM GET_VALUATION_AREA.
    GET MATERIAL DOCUMENT DATA
    PERFORM GET_MATERIAL_DOC_DATA.
    GET KANBAN DETAILS
    PERFORM GET_KANBAN_DETAILS.
    E N D O F S E L E C T I O N *
    END-OF-SELECTION.
    IF NOT IT_TEMP[] IS INITIAL.
    DISPLAY OUTPUT
    PERFORM DISPLAY_OUTPUT.
    ENDIF.
    *& Form CHECK_ON_SELECTION
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_ON_SELECTION .
    CHECK IF ENTERED PLANT IS VALID
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE WERKS EQ SO_WERKS-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_WERKS-LOW'.
    MESSAGE E010 WITH 'Please enter a valid Plant'.
    ENDIF.
    ENDIF.
    CHECK IF SUPPLY AREA AND PLANT IS VALID
    IF NOT SO_PRVBE-LOW IS INITIAL AND SO_PRVBE-HIGH IS INITIAL.
    IF NOT SO_WERKS IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM PVBE WHERE WERKS EQ SO_WERKS-LOW
    AND PRVBE EQ SO_PRVBE-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_PRVBE-LOW'.
    MESSAGE E010 WITH 'Supply Area' SO_PRVBE-LOW 'donot belong to'
    SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    CHECK IF ENTERED MATERIAL NUMBER IS VALID
    IF NOT SO_MATNR-LOW IS INITIAL AND SO_MATNR-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ SO_MATNR-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_MATNR-LOW'.
    MESSAGE E010 WITH 'Please enter a valid Material Number'.
    ELSE.
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE MATNR EQ SO_MATNR-LOW
    AND WERKS EQ SO_WERKS-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_MATNR-LOW'.
    MESSAGE E010 WITH 'Material' SO_MATNR-LOW
    'doesnot belong to plant' SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    CHECK IF TECHNOLOGY GROUP AND PLANT IS VALID
    IF NOT SO_ZZPTG-LOW IS INITIAL AND SO_ZZPTG-HIGH IS INITIAL.
    IF NOT SO_WERKS-LOW IS INITIAL AND SO_WERKS-HIGH IS INITIAL.
    SELECT SINGLE * FROM MARC WHERE WERKS EQ SO_WERKS-LOW
    AND ZZPTG EQ SO_ZZPTG-LOW.
    IF SY-SUBRC NE 0.
    SET CURSOR FIELD 'SO_ZZPTG-LOW'.
    MESSAGE E010 WITH 'Tech.Group' SO_ZZPTG-LOW 'doesnot belong to plant'
    SO_WERKS-LOW.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " CHECK_ON_SELECTION
    *& Form CHECK_BOM_EXISTENCE
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_BOM_EXISTENCE .
    JOIN MARC AND ZTGRP TABLES TO GET THE COMPONENTS BASED ON THE INPUT
    CRITERIA
    REFRESH IT_MARC_ZTGRP.
    SELECT MARCMATNR MARCWERKS ZTGRPZZPTG ZTGRPZZPTD
    INTO TABLE IT_MARC_ZTGRP
    FROM MARC INNER JOIN ZTGRP
    ON MARCWERKS EQ ZTGRPWERKS AND
    MARCZZPTG EQ ZTGRPZZPTG
    WHERE MARC~WERKS IN SO_WERKS
    AND MARC~ZZPTG IN SO_ZZPTG
    AND MARC~MATNR IN SO_MATNR
    AND MARC~LVORM NE 'X'
    AND ( MARC~BESKZ EQ 'E' OR
    MARC~BESKZ EQ 'X' ).
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    CHECK THE EXISTENCE OF BOM FOR THE SELECTED COMPONENTS.
    IF NOT PRESENT, DELETE THE ENTRY FROM INTERNAL TABLE
    LOOP AT IT_MARC_ZTGRP.
    REFRESH IT_RETURN.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = IT_MARC_ZTGRP-MATNR
    PLANT = IT_MARC_ZTGRP-WERKS
    BOMUSAGE = '1'
    TABLES
    RETURN = IT_RETURN.
    IF NOT IT_RETURN[] IS INITIAL.
    DELETE IT_MARC_ZTGRP WHERE MATNR EQ IT_MARC_ZTGRP-MATNR
    AND WERKS EQ IT_MARC_ZTGRP-WERKS
    AND ZZPTG EQ IT_MARC_ZTGRP-ZZPTG.
    ENDIF.
    CLEAR IT_MARC_ZTGRP.
    ENDLOOP.
    ELSE.
    MESSAGE S010 WITH 'No data present for given selection'.
    ENDIF.
    ENDFORM. " CHECK_BOM_EXISTENCE
    *& Form GET_HEADER_MATERIAL
    text
    -->P_IT_MARC_ZTGRP_MATNR text
    FORM GET_HEADER_MATERIAL USING P_MATNR.
    REFRESH IT_STPO.
    GET BOM ITEM DATA FOR THE COMPONENT
    SELECT * FROM STPO INTO TABLE IT_STPO WHERE IDNRK EQ P_MATNR
    AND DATUV LE SO_BUDAT-LOW
    AND LKENZ NE 'X'.
    IF NOT IT_STPO[] IS INITIAL.
    IF BOM ITEM DATA IS PRESENT FOR THE COMPONENT
    REFRESH IT_MAST.
    GET MATERIAL TO BOM LINK
    SELECT * FROM MAST INTO TABLE IT_MAST FOR ALL ENTRIES IN IT_STPO
    WHERE STLNR EQ IT_STPO-STLNR.
    IF NOT IT_MAST[] IS INITIAL.
    SORT IT_MAST BY MATNR.
    DELETE ADJACENT DUPLICATES FROM IT_MAST COMPARING MATNR.
    LOOP AT IT_MAST.
    CLEAR AUX_SET.
    REFRESH IT_PLANT.
    GET ALL THE PLANTS FOR THE COMPONENT
    SELECT MATNR WERKS FROM MARC INTO TABLE IT_PLANT
    WHERE MATNR EQ IT_MAST-MATNR.
    LOOP AT IT_PLANT.
    REFRESH IT_RETURN.
    CHECK FOR BOM EXISTENCE FOR MATERIAL IN ALL PLANTS
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = IT_MAST-MATNR
    PLANT = IT_PLANT-WERKS
    BOMUSAGE = '1'
    TABLES
    RETURN = IT_RETURN.
    IF IT_RETURN[] IS INITIAL.
    MOVE 'X' TO AUX_SET.
    ENDIF.
    CLEAR IT_PLANT.
    ENDLOOP.
    IF BOM EXISTS FOR THE COMPONENT IN ANY PLANT, MOVE THE COMPONENT
    TO INTERNAL TABLE IT_MAT
    IF AUX_SET EQ 'X'.
    MOVE IT_MAST-MATNR TO IT_MAT-MATNR.
    APPEND IT_MAT.
    CLEAR IT_MAT.
    ELSE.
    IF BOM DOESNOT EXISTS FOR THE COMPONENT IN ALL PLANTS,
    SELECT THE COMPONENT AS THE FINISHED PRODUCT
    CLEAR MARA.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ IT_MAST-MATNR.
    IF SY-SUBRC EQ 0 AND MARA-LVORM NE 'X'.
    MOVE: IT_MARC_ZTGRP-MATNR TO IT_MATERIAL-IDNRK,
    IT_MAST-MATNR TO IT_MATERIAL-MATNR.
    APPEND IT_MATERIAL.
    CLEAR IT_MATERIAL.
    ENDIF.
    ENDIF.
    CLEAR IT_MAST.
    ENDLOOP.
    ENDIF.
    ELSE.
    IF BOM ITEM DATA DOESNOT PRESENT FOR THE COMPONENT,
    CONSIDER THE COMPONENT AS FINISHED PRODUCT
    CLEAR MARA.
    SELECT SINGLE * FROM MARA WHERE MATNR EQ P_MATNR.
    IF SY-SUBRC EQ 0 AND MARA-LVORM NE 'X'.
    MOVE: IT_MARC_ZTGRP-MATNR TO IT_MATERIAL-IDNRK,
    P_MATNR TO IT_MATERIAL-MATNR.
    APPEND IT_MATERIAL.
    CLEAR IT_MATERIAL.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_HEADER_MATERIAL
    *& Form GET_FINISHED_GOOD
    text
    -->P_IT_MAT text
    FORM GET_FINISHED_GOOD TABLES P_IT_MAT LIKE IT_MAT[].
    LOOP AT P_IT_MAT.
    PERFORM GET_HEADER_MATERIAL USING P_IT_MAT-MATNR.
    DELETE P_IT_MAT INDEX 1.
    CLEAR P_IT_MAT.
    ENDLOOP.
    ENDFORM. " GET_FINISHED_GOOD
    *& Form CHECK_SALESDATA_EXISTENCE
    text
    --> p1 text
    <-- p2 text
    FORM CHECK_SALESDATA_EXISTENCE .
    IF NOT IT_MATERIAL[] IS INITIAL.
    LOOP AT IT_MATERIAL.
    CLEAR VBAP.
    SELECT SINGLE * FROM VBAP WHERE MATNR EQ IT_MATERIAL-MATNR.
    IF SY-SUBRC NE 0.
    DELETE IT_MATERIAL WHERE IDNRK EQ IT_MATERIAL-IDNRK
    AND MATNR EQ IT_MATERIAL-MATNR.
    ENDIF.
    CLEAR IT_MATERIAL.
    ENDLOOP.
    ENDIF.
    ENDFORM. " CHECK_SALESDATA_EXISTENCE
    *& Form GET_KANBAN_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_KANBAN_DATA.
    SORT IT_MATERIAL BY IDNRK MATNR.
    DELETE ADJACENT DUPLICATES FROM IT_MATERIAL COMPARING ALL FIELDS.
    IF NOT IT_MATERIAL[] IS INITIAL.
    GET CONTROL CYCLE HEADER DATA
    SELECT * FROM PKHD INTO TABLE IT_PKHD
    FOR ALL ENTRIES IN IT_MATERIAL
    WHERE WERKS IN SO_WERKS
    AND MATNR EQ IT_MATERIAL-IDNRK
    AND PRVBE IN SO_PRVBE.
    IF NOT IT_PKHD[] IS INITIAL.
    GET CONTROL CYCLE ITEM DATA
    SELECT * FROM PKPS INTO TABLE IT_PKPS
    FOR ALL ENTRIES IN IT_PKHD
    WHERE PKNUM EQ IT_PKHD-PKNUM.
    IF NOT IT_PKPS[] IS INITIAL.
    GET KANBAN STATUS DATA
    SELECT * FROM ZZC10 INTO TABLE IT_ZZC10_TEMP
    FOR ALL ENTRIES IN IT_PKPS
    WHERE PKKEY EQ IT_PKPS-PKKEY
    AND PKNUM EQ IT_PKPS-PKNUM
    AND ZDATE BETWEEN SO_BUDAT-LOW AND SY-DATUM
    AND STATUS EQ '5'.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_KANBAN_DATA
    *& Form GET_VALUATION_AREA
    text
    --> p1 text
    <-- p2 text
    FORM GET_VALUATION_AREA.
    IF NOT IT_MARC_ZTGRP[] IS INITIAL.
    SELECT WERKS BWKEY FABKL FROM T001W INTO TABLE IT_T001W
    FOR ALL ENTRIES IN IT_MARC_ZTGRP
    WHERE WERKS EQ IT_MARC_ZTGRP-WERKS.
    ENDIF.
    ENDFORM. " GET_VALUATION_AREA
    *& Form GET_MATERIAL_DOC_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_MATERIAL_DOC_DATA.
    GET MATERIAL DOCUMENT HEADER DATA
    SELECT * FROM MKPF INTO TABLE IT_MKPF
    WHERE BUDAT IN SO_BUDAT.
    IF NOT IT_MKPF[] IS INITIAL.
    GET MATERIAL DOCUMENT ITEM DATA
    SELECT * FROM MSEG INTO TABLE IT_MSEG
    FOR ALL ENTRIES IN IT_MKPF
    WHERE MBLNR EQ IT_MKPF-MBLNR
    AND WERKS IN SO_WERKS
    AND MJAHR EQ SY-DATUM+0(4)
    AND ( BWART EQ '131' OR BWART EQ '132' ).
    IF NOT IT_MATERIAL[] IS INITIAL.
    LOOP AT IT_MSEG.
    READ TABLE IT_MATERIAL WITH KEY IDNRK = IT_MSEG-MATNR.
    IF SY-SUBRC NE 0.
    DELETE IT_MSEG WHERE MATNR EQ IT_MSEG-MATNR.
    ENDIF.
    CLEAR: IT_MATERIAL, IT_MSEG.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_MATERIAL_DOC_DATA
    *& Form GET_KANBAN_DETAILS
    text
    --> p1 text
    <-- p2 text
    FORM GET_KANBAN_DETAILS .
    SORT IT_PKHD BY PKNUM.
    IF NOT IT_ZZC10_TEMP[] IS INITIAL.
    LOOP AT IT_ZZC10_TEMP.
    CLEAR: AUX_FILL, AUX_PKBMG.
    MOVE IT_ZZC10_TEMP] TO IT_ZZC10[.
    DELETE IT_ZZC10 WHERE MATNR NE IT_ZZC10_TEMP-MATNR
    AND WERKS NE IT_ZZC10_TEMP-WERKS.
    LOOP AT IT_ZZC10.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2, AUX_ZZC10_HR, AUX_DIFF.
    EMPTY DATE GREATER THAN FULL DATE
    IF IT_ZZC10-DATE_EMPTY GT IT_ZZC10-DATE_FULL.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL DATE GREATER THAN EMPTY DATE
    ELSEIF IT_ZZC10-DATE_FULL GT IT_ZZC10-DATE_EMPTY.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP2.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP1.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL DATE EQUAL TO EMPTY DATE
    ELSEIF IT_ZZC10-DATE_FULL EQ IT_ZZC10-DATE_EMPTY.
    EMPTY TIME GREATER THAN FULL TIME
    IF IT_ZZC10-TIME_EMPTY GT IT_ZZC10-TIME_FULL.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL TIME GREATER THAN EMPTY TIME
    ELSEIF IT_ZZC10-TIME_FULL GT IT_ZZC10-TIME_EMPTY.
    CONCATENATE IT_ZZC10-DATE_EMPTY IT_ZZC10-TIME_EMPTY
    INTO AUX_TIMESTAMP2.
    CONCATENATE IT_ZZC10-DATE_FULL IT_ZZC10-TIME_FULL
    INTO AUX_TIMESTAMP1.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_ZZC10_HR = AUX_DIFF / 3600.
    FULL TIME EQUAL TO EMPTY TIME
    ELSEIF IT_ZZC10-TIME_FULL EQ IT_ZZC10-TIME_EMPTY.
    AUX_ZZC10_HR = 0.
    ENDIF.
    ENDIF.
    READ TABLE IT_PKHD WITH KEY PKNUM = IT_ZZC10-PKNUM
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2,
    AUX_PKHD_DAYS, AUX_PKHD_HOURS, AUX_TMP_DAYS,
    AUX_PKHD_TIME.
    AUX_PKHD_DAYS = IT_PKHD-KWBZD.
    AUX_PKHD_HOURS = IT_PKHD-KWBZM.
    IF AUX_PKHD_DAYS NE 0.
    AUX_TMP_DAYS = AUX_PKHD_DAYS * 24.
    AUX_PKHD_TIME = AUX_TMP_DAYS + AUX_PKHD_HOURS.
    ELSE.
    AUX_PKHD_TIME = AUX_PKHD_HOURS.
    ENDIF.
    COMPARE STATUS CHANGE TIME WITH REPLENISHMENT LEAD TIME
    IF AUX_ZZC10_HR GT AUX_PKHD_TIME.
    CLEAR: AUX_LATEHOURS.
    LATE HOURS
    AUX_LATEHOURS = AUX_ZZC10_HR - AUX_PKHD_TIME.
    LATE QUANTITY FOR +1 DAY
    IF AUX_LATEHOURS LE 24.
    IT_TEMP-QTY_1 = IT_TEMP-QTY_1 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +2 DAYS
    ELSEIF AUX_LATEHOURS GT 24
    AND AUX_LATEHOURS LE 48.
    IT_TEMP-QTY_2 = IT_TEMP-QTY_2 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +3 DAYS
    ELSEIF AUX_LATEHOURS GT 48
    AND AUX_LATEHOURS LE 72.
    IT_TEMP-QTY_3 = IT_TEMP-QTY_3 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +4 DAYS
    ELSEIF AUX_LATEHOURS GT 72
    AND AUX_LATEHOURS LE 96.
    IT_TEMP-QTY_4 = IT_TEMP-QTY_4 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR +5 DAYS
    ELSEIF AUX_LATEHOURS GT 96
    AND AUX_LATEHOURS LE 120.
    IT_TEMP-QTY_5 = IT_TEMP-QTY_5 + IT_ZZC10-PKBMG.
    LATE QUANTITY FOR MORE THAN 5 DAYS
    ELSEIF AUX_LATEHOURS GT 120.
    IT_TEMP-QTY_6 = IT_TEMP-QTY_6 + IT_ZZC10-PKBMG.
    ENDIF.
    TOTAL KANBAN LATE QUANTITIES
    AUX_PKBMG = AUX_PKBMG + IT_ZZC10-PKBMG.
    ELSE.
    AUX_FILL = AUX_FILL + IT_ZZC10-PKBMG.
    CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    SUBASSEMBLY PART NUMBER
    IT_TEMP-MATNR = IT_ZZC10-MATNR.
    FINISHED GOOD
    READ TABLE IT_MATERIAL WITH KEY IDNRK = IT_ZZC10-MATNR.
    IT_TEMP-FINISHED = IT_MATERIAL-MATNR.
    TECHNOLOGY GROUP
    READ TABLE IT_MARC_ZTGRP WITH KEY WERKS = IT_ZZC10-WERKS
    MATNR = IT_ZZC10-MATNR.
    IF SY-SUBRC EQ 0.
    MOVE IT_MARC_ZTGRP-ZZPTD TO IT_TEMP-TECH.
    ENDIF.
    NUMBER OF KANBAN CONTAINERS
    IT_TEMP-BEHAZ = IT_PKHD-BEHAZ.
    KANBAN QUANTITY
    IT_TEMP-BEHMG = IT_PKHD-BEHMG.
    LATE HOURS
    AUX_LATEHOURS = AUX_ZZC10_HR - AUX_PKHD_TIME.
    IT_TEMP-LATEHOURS = AUX_LATEHOURS.
    REPLENISHMENT LEAD TIME
    IT_TEMP-REPL_LEAD_TIME = AUX_PKHD_TIME.
    KANBAN LATE QUANTITIES
    IT_TEMP-GSMNG = AUX_PKBMG.
    FILL RATE
    AUX_TOTAL = AUX_PKBMG + AUX_FILL.
    IT_TEMP-FILLRATE = ( AUX_FILL / AUX_TOTAL ) * 100.
    GET STOCK IN PO01
    REFRESH IT_MARD.
    SELECT LABST FROM MARD INTO TABLE IT_MARD
    WHERE MATNR EQ IT_ZZC10-MATNR
    AND WERKS EQ IT_ZZC10-WERKS.
    IF SY-SUBRC EQ 0.
    LOOP AT IT_MARD.
    SUM.
    ENDLOOP.
    MOVE IT_MARD-LABST TO IT_TEMP-STOCK_PO01.
    CLEAR IT_MARD.
    ENDIF.
    GET YESTERDAY'S OUTPUT QUANTITY
    PERFORM GET_YESTERDAY_QTY.
    CUMULATIVE OUTPUT FOR ACTUAL MONTH
    PERFORM GET_CUMULATIVE_OUTPUT.
    GET BACKORDER SUBASSEMBLY DATA
    PERFORM GET_BACKORDER_QTY.
    GET BACKORDER FINISHED GOODS, TODAY, +1, +2, +3, +4, +5
    AND AVERAGE OUPTUT NEEDED DATA
    PERFORM GET_FINISHEDGOODS_DATA.
    GET DATA FOR ACTUAL MONTH DELIVERED
    PERFORM GET_ACTUAL_MONTH_DATA.
    APPEND IT_TEMP.
    CLEAR IT_TEMP.
    DELETE IT_ZZC10_TEMP WHERE MATNR EQ IT_ZZC10_TEMP-MATNR
    AND WERKS EQ IT_ZZC10_TEMP-WERKS.
    CLEAR: IT_ZZC10, IT_ZZC10_TEMP, IT_PKHD.
    ENDLOOP.
    ENDIF.
    ENDFORM. " GET_KANBAN_DETAILS
    *& Form GET_YESTERDAY_QTY
    text
    --> p1 text
    <-- p2 text
    FORM GET_YESTERDAY_QTY .
    CLEAR: AUX_BUKRS, AUX_WAERS.
    READ TABLE IT_T001W WITH KEY WERKS = IT_PKHD-WERKS.
    IF SY-SUBRC EQ 0.
    CLEAR AUX_FABKL.
    MOVE IT_T001W-FABKL TO AUX_FABKL.
    SELECT SINGLE BUKRS INTO AUX_BUKRS FROM T001K
    WHERE BWKEY = IT_T001W-BWKEY.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE WAERS INTO AUX_WAERS FROM T001
    WHERE BUKRS = AUX_BUKRS.
    ENDIF.
    IF 'WD;WF;WN;WP;WU' CS AUX_FABKL.
    AUX_FABKL(1) = 'P'.
    ENDIF.
    MOVE SY-DATUM TO AUX_DATUMABSOLUT.
    PERFORM WEEKDAY USING AUX_DATUMABSOLUT.
    MOVE 'W' TO AUX_FLAG.
    PERFORM CHECK_WORKING_DAY CHANGING AUX_FLAG.
    IF AUX_DATUMABSOLUT = 0.
    AUX_YDAY = SY-DATUM.
    ELSEIF AUX_DATUMABSOLUT = 1.
    AUX_YDAY = SY-DATUM - 1.
    ELSEIF AUX_FLAG = 'F'.
    AUX_YDAY = SY-DATUM.
    ENDIF.
    IF AUX_DATUMABSOLUT = 0 OR
    AUX_DATUMABSOLUT = 1 OR
    AUX_FLAG = 'F'.
    PERFORM DATE_WITH_OFFSET USING 0 CHANGING AUX_TDAY.
    PERFORM DATE_WITH_OFFSET USING 1 CHANGING AUX_DAY1.
    PERFORM DATE_WITH_OFFSET USING 2 CHANGING AUX_DAY2.
    PERFORM DATE_WITH_OFFSET USING 3 CHANGING AUX_DAY3.
    PERFORM DATE_WITH_OFFSET USING 4 CHANGING AUX_DAY4.
    PERFORM DATE_WITH_OFFSET USING 5 CHANGING AUX_DAY5.
    ELSE.
    PERFORM DATE_WITH_OFFSET USING 0 CHANGING AUX_YDAY.
    PERFORM DATE_WITH_OFFSET USING 1 CHANGING AUX_TDAY.
    PERFORM DATE_WITH_OFFSET USING 2 CHANGING AUX_DAY1.
    PERFORM DATE_WITH_OFFSET USING 3 CHANGING AUX_DAY2.
    PERFORM DATE_WITH_OFFSET USING 4 CHANGING AUX_DAY3.
    PERFORM DATE_WITH_OFFSET USING 5 CHANGING AUX_DAY4.
    PERFORM DATE_WITH_OFFSET USING 6 CHANGING AUX_DAY5.
    ENDIF.
    AUX_BORD = '19000101'.
    GET PLANNED ORDER DATA FOR YESTERDAY
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_PKHD-MATNR
    AND PLWRK EQ IT_PKHD-WERKS
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR EQ AUX_YDAY.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    REFRESH IT_KBED_KAKO.
    SELECT KBED~KBEAREST KBED~KRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBED~KAPID EQ KAKO~KAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    ADD IT_KBED_KAKO-KBEAREST TO AUX_KBEAREST.
    ADD IT_KBED_KAKO-KRUEREST TO AUX_KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    CLEAR IT_PLAF.
    ENDLOOP.
    ENDIF.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE: AUX_KAPBD TO IT_TEMP-KAPBD_OUTY,
    IT_KBED_KAKO-KEINH TO IT_TEMP-KEINH_OUTY.
    GET OUTPUT QUANTITY FOR YESTERDAY
    REFRESH: IT_MKPF, IT_MSEG.
    CLEAR: AUX_MENGE.
    SELECT * FROM MKPF INTO TABLE IT_MKPF
    WHERE BUDAT EQ AUX_PREVIOUS.
    IF NOT IT_MKPF[] IS INITIAL.
    GET MATERIAL DOCUMENT ITEM DATA
    SELECT * FROM MSEG INTO TABLE IT_MSEG
    FOR ALL ENTRIES IN IT_MKPF
    WHERE MBLNR EQ IT_MKPF-MBLNR
    AND MATNR IN SO_MATNR
    AND WERKS IN SO_WERKS
    AND MJAHR EQ SY-DATUM+0(4)
    AND ( BWART EQ '131' OR BWART EQ '132' ).
    IF NOT IT_MSEG[] IS INITIAL.
    LOOP AT IT_MSEG.
    AUX_MENGE = AUX_MENGE + IT_MSEG-MENGE.
    CLEAR IT_MSEG.
    ENDLOOP.
    ENDIF.
    ENDIF.
    READ TABLE IT_MSEG INDEX 1.
    MOVE: AUX_MENGE TO IT_TEMP-GSMNG_OUTY,
    IT_MSEG-MEINS TO IT_TEMP-MEINS_OUTY.
    CLEAR IT_T001W.
    ENDIF.
    ENDFORM. " GET_YESTERDAY_QTY
    *& Form GET_BACKORDER_QTY
    text
    --> p1 text
    <-- p2 text
    FORM GET_BACKORDER_QTY .
    GET PLANNED ORDER DATA FOR BACKORDER
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG, AUX_QUANT.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_ZZC10-MATNR
    AND PLWRK EQ IT_ZZC10-WERKS
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR GE SO_BUDAT-LOW
    AND PEDTR LE SY-DATUM.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    CLEAR: AUX_TIMESTAMP1, AUX_TIMESTAMP2, AUX_PLAF_HR, AUX_DIFF.
    EMPTY DATE GREATER THAN FULL DATE
    CONCATENATE SY-DATUM SY-UZEIT
    INTO AUX_TIMESTAMP1.
    CONCATENATE IT_PLAF-PEDTR IT_PLAF-PEDTI
    INTO AUX_TIMESTAMP2.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
    EXPORTING
    TIMESTAMP1 = AUX_TIMESTAMP1
    TIMESTAMP2 = AUX_TIMESTAMP2
    IMPORTING
    DIFFERENCE = AUX_DIFF.
    AUX_PLAF_HR = AUX_DIFF / 3600.
    IF AUX_PLAF_HR > AUX_PKHD_TIME.
    AUX_GSMNG = AUX_GSMNG + IT_PLAF-GSMNG.
    REFRESH IT_KBED_KAKO.
    SELECT KBEDKBEAREST KBEDKRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBEDKAPID EQ KAKOKAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    AUX_KBEAREST = AUX_KBEAREST + IT_KBED_KAKO-KBEAREST.
    AUX_KRUEREST = AUX_KRUEREST + IT_KBED_KAKO-KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    ENDIF.
    ENDLOOP.
    READ TABLE IT_PLAF INDEX 1.
    MOVE: AUX_GSMNG TO IT_TEMP-GSMNG_BORD,
    IT_PLAF-MEINS TO IT_TEMP-MEINS_BORD.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE: AUX_KAPBD TO IT_TEMP-KAPBD_BORD,
    IT_KBED_KAKO-KEINH TO IT_TEMP-KEINH_BORD.
    ENDIF.
    ENDFORM. " GET_BACKORDER_QTY
    *& Form WEEKDAY
    text
    -->P_AUX_DATUMABSOLUT text
    FORM WEEKDAY USING P_DATUMABSOLUT.
    P_DATUMABSOLUT = P_DATUMABSOLUT MOD 7.
    ENDFORM. " WEEKDAY
    *& Form CHECK_WORKING_DAY
    text
    <--P_AUX_FLAG text
    FORM CHECK_WORKING_DAY CHANGING P_FLAG.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
    EXPORTING
    DATE = SY-DATUM
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    DATE = AUX_FDAY
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    CORRECT_OPTION_INVALID = 2
    DATE_AFTER_RANGE = 3
    DATE_BEFORE_RANGE = 4
    DATE_INVALID = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    IF AUX_FDAY NE SY-DATUM.
    AUX_FLAG = 'F'.
    ENDIF.
    ENDFORM. " CHECK_WORKING_DAY
    *& Form DATE_WITH_OFFSET
    text
    -->P_0 text
    <--P_AUX_TDAY text
    FORM DATE_WITH_OFFSET USING AUX_OFFSET
    CHANGING P_TDAY.
    DATA:
    AUX_CALENDARDATE LIKE SCAL-DATE,
    AUX_FACTORYDATE LIKE SCAL-FACDATE.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
    EXPORTING
    DATE = SY-DATUM
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    FACTORYDATE = AUX_FACTORYDATE
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    CORRECT_OPTION_INVALID = 2
    DATE_AFTER_RANGE = 3
    DATE_BEFORE_RANGE = 4
    DATE_INVALID = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    AUX_FACTORYDATE = AUX_FACTORYDATE + AUX_OFFSET.
    CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
    EXPORTING
    FACTORYDATE = AUX_FACTORYDATE
    FACTORY_CALENDAR_ID = AUX_FABKL
    IMPORTING
    DATE = AUX_CALENDARDATE
    EXCEPTIONS
    CALENDAR_BUFFER_NOT_LOADABLE = 1
    FACTORYDATE_AFTER_RANGE = 2
    FACTORYDATE_BEFORE_RANGE = 3
    FACTORYDATE_INVALID = 4
    FACTORY_CALENDAR_ID_MISSING = 5
    FACTORY_CALENDAR_NOT_FOUND = 6
    OTHERS = 7.
    P_TDAY = AUX_CALENDARDATE.
    ENDFORM. " DATE_WITH_OFFSET
    *& Form GET_CUMULATIVE_OUTPUT
    text
    --> p1 text
    <-- p2 text
    FORM GET_CUMULATIVE_OUTPUT .
    CLEAR: AUX_LOW, AUX_HIGH.
    MOVE: SY-DATUM TO AUX_LOW,
    SY-DATUM TO AUX_HIGH.
    MOVE: '01' TO AUX_LOW+6(2),
    '31' TO AUX_HIGH+6(2).
    REFRESH IT_MKPF_MSEG.
    CLEAR AUX_MNG.
    SELECT MKPFMBLNR MKPFMJAHR MKPF~BUDAT
    MSEGBWART MSEGMATNR MSEGMENGE MSEGMEINS MSEGDMBTR MSEGWERKS
    INTO TABLE IT_MKPF_MSEG
    FROM MKPF JOIN MSEG
    ON MKPFMBLNR EQ MSEGMBLNR
    WHERE MKPF~BUDAT BETWEEN AUX_LOW AND AUX_HIGH
    AND MKPF~MJAHR EQ AUX_CURRENT+0(4)
    AND MKPF~VGART EQ 'WS'
    AND MSEG~ZEILE EQ 1
    AND MSEG~WERKS EQ SO_WERKS
    AND MSEG~MATNR EQ IT_PKHD-MATNR
    AND MSEG~BWART IN ('131', '132').
    IF NOT IT_MKPF_MSEG[] IS INITIAL.
    LOOP AT IT_MKPF_MSEG.
    AUX_MNG = AUX_MNG + IT_MKPF_MSEG-MENGE.
    CLEAR IT_MKPF_MSEG.
    ENDLOOP.
    ENDIF.
    MOVE AUX_MNG TO IT_TEMP-GSMNG_OUTM.
    READ TABLE IT_MKPF_MSEG INDEX 1.
    MOVE IT_MKPF_MSEG-MEINS TO IT_TEMP-MEINS_OUTM.
    REFRESH IT_COBK.
    SELECT DISTINCT BLPP~RUECK FROM BLPK INNER JOIN BLPP
    ON BLPKPRTNR EQ BLPPPRTNR
    INTO TABLE IT_COBK
    WHERE BLPK~WERKS EQ SO_WERKS
    AND BLPK~MATNR EQ SO_MATNR
    AND BLPK~DATUM BETWEEN AUX_LOW
    AND AUX_HIGH
    AND BLPP~PRTPS EQ '0002'.
    IF NOT IT_COBK[] IS INITIAL.
    REFRESH IT_COEPL.
    SELECT KOKRS BELNR FROM COBK
    INTO CORRESPONDING FIELDS OF TABLE IT_COEPL
    FOR ALL ENTRIES IN IT_COBK
    WHERE REFBT EQ 'R'
    AND REFBN EQ IT_COBK-RUECK
    AND BLDAT BETWEEN AUX_LOW AND AUX_HIGH.
    CLEAR IT_CAPACITIES.
    REFRESH IT_CAPACITIES.
    LOOP AT IT_COEPL.
    SELECT LSBBTR MEINB FROM COEPL
    APPENDING CORRESPONDING FIELDS OF TABLE IT_CAPACITIES
    WHERE KOKRS EQ IT_COEPL-KOKRS
    AND BELNR EQ IT_COEPL-BELNR
    AND OBJNR LIKE '%DLABOR'.
    CALL FUNCTION 'UNIT_SUM'
    IMPORTING
    QUANTITY_SUM = IT_TEMP-KAPBD_OUTM
    UNIT_SUM = AUX_SUM_UNIT
    TABLES
    QUANTITIES_UNITS = IT_CAPACITIES.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_TEMP-KAPBD_OUTM
    UNIT_IN = AUX_SUM_UNIT
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_TEMP-KAPBD_OUTM.
    ENDLOOP.
    READ TABLE IT_CAPACITIES INDEX 1.
    MOVE IT_CAPACITIES-MEINB TO IT_TEMP-KEINH_OUTM.
    ENDIF.
    ENDFORM. " GET_CUMULATIVE_OUTPUT
    *& Form GET_FINISHEDGOODS_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_FINISHEDGOODS_DATA .
    GET PLANNED ORDER DATA
    REFRESH IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_KBEAREST, AUX_KRUEREST, AUX_GSMNG.
    SELECT * FROM PLAF INTO TABLE IT_PLAF
    WHERE MATNR EQ IT_TEMP-FINISHED
    AND ( PAART EQ 'KD' OR PAART EQ 'PE' )
    AND RATID GT 0
    AND PEDTR GE AUX_BORD
    AND PEDTR LE AUX_DAY5.
    IF NOT IT_PLAF[] IS INITIAL.
    LOOP AT IT_PLAF.
    CLEAR: AUX_KAPBD, AUX_GSMNG.
    REFRESH IT_KBED_KAKO.
    SELECT KBEDKBEAREST KBEDKRUEREST KBED~KEINH
    FROM KBED INNER JOIN KAKO
    ON KBEDKAPID EQ KAKOKAPID
    INTO TABLE IT_KBED_KAKO
    WHERE KBED~BEDID = IT_PLAF-RATID
    AND KAKO~KAPAR = '001'.
    IF NOT IT_KBED_KAKO[] IS INITIAL.
    CLEAR AUX_KAPBD.
    LOOP AT IT_KBED_KAKO.
    IF IT_KBED_KAKO-KEINH NE 'STD'.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KBEAREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KBEAREST.
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = IT_KBED_KAKO-KRUEREST
    UNIT_IN = IT_KBED_KAKO-KEINH
    UNIT_OUT = 'STD'
    IMPORTING
    OUTPUT = IT_KBED_KAKO-KRUEREST.
    ENDIF.
    ADD IT_KBED_KAKO-KBEAREST TO AUX_KBEAREST.
    ADD IT_KBED_KAKO-KRUEREST TO AUX_KRUEREST.
    CLEAR IT_KBED_KAKO.
    ENDLOOP.
    AUX_KAPBD = AUX_KBEAREST + AUX_KRUEREST.
    ENDIF.
    READ TABLE IT_KBED_KAKO INDEX 1.
    CASE IT_PLAF-PEDTR.
    WHEN AUX_DAY5.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY5 = IT_TEMP-F_GSMNG_DAY5 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY5 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY5 = IT_TEMP-F_KAPBD_DAY5 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY5 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY4.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY4 = IT_TEMP-F_GSMNG_DAY4 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY4 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY4 = IT_TEMP-F_KAPBD_DAY4 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY4 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY3.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY3 = IT_TEMP-F_GSMNG_DAY3 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY3 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY3 = IT_TEMP-F_KAPBD_DAY3 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY3 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY2.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY2 = IT_TEMP-F_GSMNG_DAY2 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY2 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY2 = IT_TEMP-F_KAPBD_DAY2 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY2 = IT_KBED_KAKO-KEINH.
    WHEN AUX_DAY1.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_DAY1 = IT_TEMP-F_GSMNG_DAY1 + AUX_GSMNG.
    IT_TEMP-F_MEINS_DAY1 = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_DAY1 = IT_TEMP-F_KAPBD_DAY1 + AUX_KAPBD.
    IT_TEMP-F_KEINH_DAY1 = IT_KBED_KAKO-KEINH.
    WHEN AUX_TDAY.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_TDAY = IT_TEMP-F_GSMNG_TDAY + AUX_GSMNG.
    IT_TEMP-F_MEINS_TDAY = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_TDAY = IT_TEMP-F_KAPBD_TDAY + AUX_KAPBD.
    IT_TEMP-F_KEINH_TDAY = IT_KBED_KAKO-KEINH.
    WHEN OTHERS.
    AUX_GSMNG = IT_PLAF-GSMNG.
    IT_TEMP-F_GSMNG_BORD = IT_TEMP-F_GSMNG_BORD + AUX_GSMNG.
    IT_TEMP-F_MEINS_BORD = IT_PLAF-MEINS.
    IT_TEMP-F_KAPBD_BORD = IT_TEMP-F_KAPBD_BORD + AUX_KAPBD.
    IT_TEMP-F_KEINH_BORD = IT_KBED_KAKO-KEINH.
    ENDCASE.
    IT_TEMP-F_GSMNG_OUTN = IT_TEMP-F_GSMNG_OUTN + AUX_GSMNG.
    IT_TEMP-F_KAPBD_OUTN = IT_TEMP-F_KAPBD_OUTN + AUX_KAPBD.
    ENDLOOP.
    READ TABLE IT_PLAF INDEX 1.
    MOVE IT_PLAF-MEINS TO IT_TEMP-F_MEINS_OUTN.
    READ TABLE IT_KBED_KAKO INDEX 1.
    MOVE IT_KBED_KAKO-KEINH TO IT_TEMP-F_KEINH_OUTN.
    ENDIF.
    ENDFORM. " GET_FINISHEDGOODS_DATA
    *& Form GET_ACTUAL_MONTH_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_ACTUAL_MONTH_DATA .
    CLEAR: AUX_LOW, AUX_HIGH.
    MOVE: '01' TO SO_BUDAT-LOW+6(2),
    SO_BUDAT-LOW TO AUX_LOW,
    '31' TO SO_BUDAT-LOW+6(2),
    SO_BUDAT-LOW TO AUX_HIGH.
    REFRESH IT_MKPF_MSEG.
    CLEAR AUX_MNG.
    SELECT MKPFMBLNR MKPFMJAHR MKPF~BUDAT
    MSEGBWART MSE

    Hi Ramya,
    Your program contains a lot of BIG standard tables, these tables
    usually contain huge amount of data,
    plus you have used SELECT * in many places, try to avoid that and replace with only those field names that are reqd.
    even the joins are on huge tables, performance could improve on those  if you can put some more conditions or keys to the joins to make it more specific.
    even after that if it gives the Runtime Error then you have 2 options:
    1. Ask your Basis to increase Time limit for program executing in foreground.
    2. Execute your program in Background Mode.
    Regards,
    Samson Rodrigues.

  • Performance issue in DB need help with analysing this ADDM report

    Hi,
    My environment:
    Os: RHEL5U3 / 11.1.0.7 64 bit / R12.1.1 64 bit
    Issue:
    Few days are am facing serious of performance problem in our Production instance. Normally the issue will occur 5 to 10 minutes occasionally per day. At the time of issue we not able to access the EBS application its taking time to load. But backend all the oracle, listener and apps services are up and running. No locks at table and session level. Cpu and memory usage is normal.
    We have monitored using "Enterprise Manager" for this issue and we found the wait session present more in Active session tab. At this time EBS application is not able access its loading too time. After some time the in Active session tab the wait session came normal and when we try to access the EBS application its working fine.
    We try to find the cause of the issue by running addm report. But am not able to understand what its says. Kindly suggests me
    ADDM Report for Task 'TASK_42656'
    Analysis Period
    AWR snapshot range from 14754 to 14755.
    Time period starts at 17-APR-12 11.00.22 AM
    Time period ends at 17-APR-12 12.00.33 PM
    Analysis Target
    Database 'PRD' with DB ID 1789440879.
    Database version 11.1.0.7.0.
    ADDM performed an analysis of instance PRD, numbered 1 and hosted at
    advgrpdb.advgroup.ae.
    Activity During the Analysis Period
    Total database time was 18674 seconds.
    The average number of active sessions was 5.17.
    Summary of Findings
    Description Active Sessions Recommendations
    Percent of Activity
    1 Top SQL by DB Time 3.43 | 66.33 5
    2 Buffer Busy 2.52 | 48.81 5
    3 Buffer Busy 1.39 | 26.81 2
    4 Log File Switches .91 | 17.56 1
    5 Buffer Busy .56 | 10.87 2
    6 Undersized SGA .38 | 7.37 1
    7 Commits and Rollbacks .28 | 5.42 1
    8 Undo I/O .18 | 3.53 0
    9 CPU Usage .13 | 2.57 1
    10 Top SQL By I/O .11 | 2.21 1
    Findings and Recommendations
    Finding 1: Top SQL by DB Time
    Impact is 3.43 active sessions, 66.33% of total activity.
    SQL statements consuming significant database time were found.
    Recommendation 1: SQL Tuning
    Estimated benefit is 1.59 active sessions, 30.8% of total activity.
    Action
    Investigate the SQL statement with SQL_ID "a49xsqhv0h31b" for possible
    performance improvements.
    Related Object
    SQL statement with SQL_ID a49xsqhv0h31b.
    SELECT R.Conc_Login_Id, R.Request_Id, R.Phase_Code, R.Status_Code,
    P.Application_ID, P.Concurrent_Program_ID, P.Concurrent_Program_Name,
    R.Enable_Trace, R.Restart, DECODE(R.Increment_Dates, 'Y', 'Y', 'N'),
    R.NLS_Compliant, R.OUTPUT_FILE_TYPE, E.Executable_Name,
    E.Execution_File_Name, A2.Basepath, DECODE(R.Stale, 'Y', 'C',
    P.Execution_Method_Code), P.Print_Flag, P.Execution_Options,
    DECODE(P.Srs_Flag, 'Y', 'Y', 'Q', 'Y', 'N'), P.Argument_Method_Code,
    R.Print_Style, R.Argument_Input_Method_Code, R.Queue_Method_Code,
    R.Responsibility_ID, R.Responsibility_Application_ID, R.Requested_By,
    R.Number_Of_Copies, R.Save_Output_Flag, R.Printer, R.Print_Group,
    R.Priority, U.User_Name, O.Oracle_Username,
    O.Encrypted_Oracle_Password, R.Cd_Id, A.Basepath,
    A.Application_Short_Name, TO_CHAR(R.Requested_Start_Date,'YYYY/MM/DD
    HH24:MI:SS'), R.Nls_Language, R.Nls_Territory,
    R.Nls_Numeric_Characters, DECODE(R.Parent_Request_ID, NULL, 0,
    R.Parent_Request_ID), R.Priority_Request_ID, R.Single_Thread_Flag,
    R.Has_Sub_Request, R.Is_Sub_Request, R.Req_Information,
    R.Description, R.Resubmit_Time, TO_CHAR(R.Resubmit_Interval),
    R.Resubmit_Interval_Type_Code, R.Resubmit_Interval_Unit_Code,
    TO_CHAR(R.Resubmit_End_Date,'YYYY/MM/DD HH24:MI:SS'),
    Decode(E.Execution_File_Name, NULL, 'N', Decode(E.Subroutine_Name,
    NULL, Decode(E.Execution_Method_Code, 'I', 'Y', 'J', 'Y', 'N'),
    'Y')), R.Argument1, R.Argument2, R.Argument3, R.Argument4,
    R.Argument5, R.Argument6, R.Argument7, R.Argument8, R.Argument9,
    R.Argument10, R.Argument11, R.Argument12, R.Argument13, R.Argument14,
    R.Argument15, R.Argument16, R.Argument17, R.Argument18, R.Argument19,
    R.Argument20, R.Argument21, R.Argument22, R.Argument23, R.Argument24,
    R.Argument25, X.Argument26, X.Argument27, X.Argument28, X.Argument29,
    X.Argument30, X.Argument31, X.Argument32, X.Argument33, X.Argument34,
    X.Argument35, X.Argument36, X.Argument37, X.Argument38, X.Argument39,
    X.Argument40, X.Argument41, X.Argument42, X.Argument43, X.Argument44,
    X.Argument45, X.Argument46, X.Argument47, X.Argument48, X.Argument49,
    X.Argument50, X.Argument51, X.Argument52, X.Argument53, X.Argument54,
    X.Argument55, X.Argument56, X.Argument57, X.Argument58, X.Argument59,
    X.Argument60, X.Argument61, X.Argument62, X.Argument63, X.Argument64,
    X.Argument65, X.Argument66, X.Argument67, X.Argument68, X.Argument69,
    X.Argument70, X.Argument71, X.Argument72, X.Argument73, X.Argument74,
    X.Argument75, X.Argument76, X.Argument77, X.Argument78, X.Argument79,
    X.Argument80, X.Argument81, X.Argument82, X.Argument83, X.Argument84,
    X.Argument85, X.Argument86, X.Argument87, X.Argument88, X.Argument89,
    X.Argument90, X.Argument91, X.Argument92, X.Argument93, X.Argument94,
    X.Argument95, X.Argument96, X.Argument97, X.Argument98, X.Argument99,
    X.Argument100, R.number_of_arguments, C.CD_Name,
    NVL(R.Security_Group_ID, 0), NVL(R.org_id, 0) FROM
    fnd_concurrent_requests R, fnd_concurrent_programs P, fnd_application
    A, fnd_user U, fnd_oracle_userid O, fnd_conflicts_domain C,
    fnd_concurrent_queues Q, fnd_application A2, fnd_executables E,
    fnd_conc_request_arguments X WHERE R.Status_code = 'I' And
    ((R.OPS_INSTANCE is null) or (R.OPS_INSTANCE = -1) or
    (R.OPS_INSTANCE =
    decode(:dcp_on,1,FND_CONC_GLOBAL.OPS_INST_NUM,R.OPS_INSTANCE))) And
    R.Request_ID = X.Request_ID(+) And R.Program_Application_Id =
    P.Application_Id(+) And R.Concurrent_Program_Id =
    P.Concurrent_Program_Id(+) And R.Program_Application_Id =
    A.Application_Id(+) And P.Executable_Application_Id =
    E.Application_Id(+) And P.Executable_Id =
    E.Executable_Id(+) And P.Executable_Application_Id =
    A2.Application_Id(+) And R.Requested_By = U.User_Id(+) And R.Cd_Id
    = C.Cd_Id(+) And R.Oracle_Id = O.Oracle_Id(+) And Q.Application_Id =
    :q_applid And Q.Concurrent_Queue_Id = :queue_id And (P.Enabled_Flag
    is NULL OR P.Enabled_Flag = 'Y') And R.Hold_Flag = 'N' And
    R.Requested_Start_Date <= Sysdate And ( R.Enforce_Seriality_Flag =
    'N' OR ( C.RunAlone_Flag = P.Run_Alone_Flag And (P.Run_Alone_Flag =
    'N' OR Not Exists (Select Null From Fnd_Concurrent_Requests Sr
    Where Sr.Status_Code In ('R', 'T') And Sr.Enforce_Seriality_Flag =
    'Y' And Sr.CD_id = C.CD_Id)))) And Q.Running_Processes <=
    Q.Max_Processes And R.Rowid = :reqname And
    ((P.Execution_Method_Code != 'S' OR
    (R.PROGRAM_APPLICATION_ID,R.CONCURRENT_PROGRAM_ID) IN
    ((0,98),(0,100),(0,31721),(0,31722),(0,31757))) AND
    ((R.PROGRAM_APPLICATION_ID,R.CONCURRENT_PROGRAM_ID) NOT IN
    ((510,40112),(510,40113),(510,41497),(510,41498),(530,41859),(530,418
    60),(535,41492),(535,41493),(535,41494)))) FOR UPDATE OF
    R.status_code NoWait
    Rationale
    SQL statement with SQL_ID "a49xsqhv0h31b" was executed 4686 times and
    had an average elapsed time of 1.2 seconds.
    Rationale
    Waiting for event "buffer busy waits" in wait class "Concurrency"
    accounted for 85% of the database time spent in processing the SQL
    statement with SQL_ID "a49xsqhv0h31b".
    Rationale
    Waiting for event "log file switch (checkpoint incomplete)" in wait
    class "Configuration" accounted for 9% of the database time spent in
    processing the SQL statement with SQL_ID "a49xsqhv0h31b".
    Recommendation 3: SQL Tuning
    Estimated benefit is .56 active sessions, 10.91% of total activity.
    Action
    Investigate the SQL statement with SQL_ID "5d7957yktf3nn" for possible
    performance improvements.
    Related Object
    SQL statement with SQL_ID 5d7957yktf3nn.
    UPDATE ICX_SESSIONS SET TIME_OUT = :B2 WHERE SESSION_ID = :B1
    Rationale
    SQL statement with SQL_ID "5d7957yktf3nn" was executed 266 times and had
    an average elapsed time of 7.6 seconds.
    Rationale
    Waiting for event "buffer busy waits" in wait class "Concurrency"
    accounted for 86% of the database time spent in processing the SQL
    statement with SQL_ID "5d7957yktf3nn".
    Rationale
    Waiting for event "log file switch (checkpoint incomplete)" in wait
    class "Configuration" accounted for 7% of the database time spent in
    processing the SQL statement with SQL_ID "5d7957yktf3nn".
    Finding 2: Buffer Busy
    Impact is 2.52 active sessions, 48.81% of total activity.
    Read and write contention on database blocks was consuming significant
    database time.
    Recommendation 1: Application Analysis
    Estimated benefit is 1.42 active sessions, 27.44% of total activity.
    Action
    Trace the cause of object contention due to SELECT statements in the
    application using the information provided.
    Related Object
    Database object with ID 34562.
    Rationale
    The SELECT statement with SQL_ID "a49xsqhv0h31b" was significantly
    affected by "buffer busy" waits.
    Related Object
    SQL statement with SQL_ID a49xsqhv0h31b.
    SELECT R.Conc_Login_Id, R.Request_Id, R.Phase_Code, R.Status_Code,
    P.Application_ID, P.Concurrent_Program_ID, P.Concurrent_Program_Name,
    R.Enable_Trace, R.Restart, DECODE(R.Increment_Dates, 'Y', 'Y', 'N'),
    R.NLS_Compliant, R.OUTPUT_FILE_TYPE, E.Executable_Name,
    E.Execution_File_Name, A2.Basepath, DECODE(R.Stale, 'Y', 'C',
    P.Execution_Method_Code), P.Print_Flag, P.Execution_Options,
    DECODE(P.Srs_Flag, 'Y', 'Y', 'Q', 'Y', 'N'), P.Argument_Method_Code,
    R.Print_Style, R.Argument_Input_Method_Code, R.Queue_Method_Code,
    R.Responsibility_ID, R.Responsibility_Application_ID, R.Requested_By,
    R.Number_Of_Copies, R.Save_Output_Flag, R.Printer, R.Print_Group,
    R.Priority, U.User_Name, O.Oracle_Username,
    O.Encrypted_Oracle_Password, R.Cd_Id, A.Basepath,
    A.Application_Short_Name, TO_CHAR(R.Requested_Start_Date,'YYYY/MM/DD
    HH24:MI:SS'), R.Nls_Language, R.Nls_Territory,
    R.Nls_Numeric_Characters, DECODE(R.Parent_Request_ID, NULL, 0,
    R.Parent_Request_ID), R.Priority_Request_ID, R.Single_Thread_Flag,
    R.Has_Sub_Request, R.Is_Sub_Request, R.Req_Information,
    R.Description, R.Resubmit_Time, TO_CHAR(R.Resubmit_Interval),
    R.Resubmit_Interval_Type_Code, R.Resubmit_Interval_Unit_Code,
    TO_CHAR(R.Resubmit_End_Date,'YYYY/MM/DD HH24:MI:SS'),
    Decode(E.Execution_File_Name, NULL, 'N', Decode(E.Subroutine_Name,
    NULL, Decode(E.Execution_Method_Code, 'I', 'Y', 'J', 'Y', 'N'),
    'Y')), R.Argument1, R.Argument2, R.Argument3, R.Argument4,
    R.Argument5, R.Argument6, R.Argument7, R.Argument8, R.Argument9,
    R.Argument10, R.Argument11, R.Argument12, R.Argument13, R.Argument14,
    R.Argument15, R.Argument16, R.Argument17, R.Argument18, R.Argument19,
    R.Argument20, R.Argument21, R.Argument22, R.Argument23, R.Argument24,
    R.Argument25, X.Argument26, X.Argument27, X.Argument28, X.Argument29,
    X.Argument30, X.Argument31, X.Argument32, X.Argument33, X.Argument34,
    X.Argument35, X.Argument36, X.Argument37, X.Argument38, X.Argument39,
    X.Argument40, X.Argument41, X.Argument42, X.Argument43, X.Argument44,
    X.Argument45, X.Argument46, X.Argument47, X.Argument48, X.Argument49,
    X.Argument50, X.Argument51, X.Argument52, X.Argument53, X.Argument54,
    X.Argument55, X.Argument56, X.Argument57, X.Argument58, X.Argument59,
    X.Argument60, X.Argument61, X.Argument62, X.Argument63, X.Argument64,
    X.Argument65, X.Argument66, X.Argument67, X.Argument68, X.Argument69,
    X.Argument70, X.Argument71, X.Argument72, X.Argument73, X.Argument74,
    X.Argument75, X.Argument76, X.Argument77, X.Argument78, X.Argument79,
    X.Argument80, X.Argument81, X.Argument82, X.Argument83, X.Argument84,
    X.Argument85, X.Argument86, X.Argument87, X.Argument88, X.Argument89,
    X.Argument90, X.Argument91, X.Argument92, X.Argument93, X.Argument94,
    X.Argument95, X.Argument96, X.Argument97, X.Argument98, X.Argument99,
    X.Argument100, R.number_of_arguments, C.CD_Name,
    NVL(R.Security_Group_ID, 0), NVL(R.org_id, 0) FROM
    fnd_concurrent_requests R, fnd_concurrent_programs P, fnd_application
    A, fnd_user U, fnd_oracle_userid O, fnd_conflicts_domain C,
    fnd_concurrent_queues Q, fnd_application A2, fnd_executables E,
    fnd_conc_request_arguments X WHERE R.Status_code = 'I' And
    ((R.OPS_INSTANCE is null) or (R.OPS_INSTANCE = -1) or
    (R.OPS_INSTANCE =
    decode(:dcp_on,1,FND_CONC_GLOBAL.OPS_INST_NUM,R.OPS_INSTANCE))) And
    R.Request_ID = X.Request_ID(+) And R.Program_Application_Id =
    P.Application_Id(+) And R.Concurrent_Program_Id =
    P.Concurrent_Program_Id(+) And R.Program_Application_Id =
    A.Application_Id(+) And P.Executable_Application_Id =
    E.Application_Id(+) And P.Executable_Id =
    E.Executable_Id(+) And P.Executable_Application_Id =
    A2.Application_Id(+) And R.Requested_By = U.User_Id(+) And R.Cd_Id
    = C.Cd_Id(+) And R.Oracle_Id = O.Oracle_Id(+) And Q.Application_Id =
    :q_applid And Q.Concurrent_Queue_Id = :queue_id And (P.Enabled_Flag
    is NULL OR P.Enabled_Flag = 'Y') And R.Hold_Flag = 'N' And
    R.Requested_Start_Date <= Sysdate And ( R.Enforce_Seriality_Flag =
    'N' OR ( C.RunAlone_Flag = P.Run_Alone_Flag And (P.Run_Alone_Flag =
    'N' OR Not Exists (Select Null From Fnd_Concurrent_Requests Sr
    Where Sr.Status_Code In ('R', 'T') And Sr.Enforce_Seriality_Flag =
    'Y' And Sr.CD_id = C.CD_Id)))) And Q.Running_Processes <=
    Q.Max_Processes And R.Rowid = :reqname And
    ((P.Execution_Method_Code != 'S' OR
    (R.PROGRAM_APPLICATION_ID,R.CONCURRENT_PROGRAM_ID) IN
    ((0,98),(0,100),(0,31721),(0,31722),(0,31757))) AND
    ((R.PROGRAM_APPLICATION_ID,R.CONCURRENT_PROGRAM_ID) NOT IN
    ((510,40112),(510,40113),(510,41497),(510,41498),(530,41859),(530,418
    60),(535,41492),(535,41493),(535,41494)))) FOR UPDATE OF
    R.status_code NoWait
    UPDATE ICX_SESSIONS SET LAST_CONNECT = SYSDATE WHERE SESSION_ID = :B1
    Recommendation 1: Schema Changes
    Estimated benefit is .03 active sessions, .62% of total activity.
    Action
    Consider rebuilding the TABLE "APPLSYS.FND_LOGIN_RESP_FORMS" with object
    ID 34651 using a higher value for PCTFREE.
    Related Object
    Database object with ID 34651.
    Rationale
    The UPDATE statement with SQL_ID "cqc5crhxxt36t" was significantly
    affected by "buffer busy" waits.
    Related Object
    SQL statement with SQL_ID cqc5crhxxt36t.
    UPDATE FND_LOGIN_RESP_FORMS FLRF SET END_TIME = SYSDATE WHERE
    FLRF.LOGIN_ID = :B2 AND FLRF.LOGIN_RESP_ID = :B1 AND FLRF.END_TIME IS
    NULL AND (FLRF.FORM_ID, FLRF.FORM_APPL_ID) = (SELECT F.FORM_ID,
    F.APPLICATION_ID FROM FND_FORM F, FND_APPLICATION A WHERE F.FORM_NAME
    = :B4 AND F.APPLICATION_ID = A.APPLICATION_ID AND
    A.APPLICATION_SHORT_NAME = :B3 )
    Symptoms That Led to the Finding:
    Wait class "Concurrency" was consuming significant database time.
    Impact is 2.53 active sessions, 48.87% of total activity.
    Finding 4: Log File Switches
    Impact is .91 active sessions, 17.56% of total activity.
    Log file switch operations were consuming significant database time while
    waiting for checkpoint completion.
    This problem can be caused by use of hot backup mode on tablespaces. DML to
    tablespaces in hot backup mode causes generation of additional redo.
    Recommendation 1: Database Configuration
    Estimated benefit is .91 active sessions, 17.56% of total activity.
    Action
    Verify whether incremental shipping was used for standby databases.
    Symptoms That Led to the Finding:
    Wait class "Configuration" was consuming significant database time.
    Impact is .91 active sessions, 17.63% of total activity.
    Finding 5: Buffer Busy
    Impact is .56 active sessions, 10.87% of total activity.
    A hot data block with concurrent read and write activity was found. The block
    belongs to segment "ICX.ICX_SESSIONS" and is block 243489 in file 36.
    Recommendation 1: Application Analysis
    Estimated benefit is .56 active sessions, 10.87% of total activity.
    Action
    Investigate application logic to find the cause of high concurrent read
    and write activity to the data present in this block.
    Related Object
    Database block with object number 37562, file number 36 and block
    number 243489.
    Rationale
    The SQL statement with SQL_ID "5d7957yktf3nn" spent significant time on
    "buffer busy" waits for the hot block.
    Related Object
    SQL statement with SQL_ID 5d7957yktf3nn.
    UPDATE ICX_SESSIONS SET TIME_OUT = :B2 WHERE SESSION_ID = :B1
    Rationale
    The SQL statement with SQL_ID "326up1aym56dd" spent significant time on
    "buffer busy" waits for the hot block.
    Related Object
    SQL statement with SQL_ID 326up1aym56dd.
    UPDATE ICX_SESSIONS SET LAST_CONNECT = SYSDATE WHERE SESSION_ID = :B1
    Recommendation 2: Schema Changes
    Estimated benefit is .56 active sessions, 10.87% of total activity.
    Action
    Consider rebuilding the TABLE "ICX.ICX_SESSIONS" with object ID 37562
    using a higher value for PCTFREE.
    Related Object
    Database object with ID 37562.
    Symptoms That Led to the Finding:
    Wait class "Concurrency" was consuming significant database time.
    Impact is 2.53 active sessions, 48.87% of total activity.
    Finding 6: Undersized SGA
    Impact is .38 active sessions, 7.37% of total activity.
    The SGA was inadequately sized, causing additional I/O or hard parses.
    The value of parameter "sga_target" was "4096 M" during the analysis period.
    Recommendation 1: Database Configuration
    Estimated benefit is .12 active sessions, 2.33% of total activity.
    Action
    Increase the size of the SGA by setting the parameter "sga_target" to
    4608 M.
    Symptoms That Led to the Finding:
    Wait class "User I/O" was consuming significant database time.
    Impact is .7 active sessions, 13.57% of total activity.
    Hard parsing of SQL statements was consuming significant database time.
    Impact is .13 active sessions, 2.51% of total activity.
    Contention for latches related to the shared pool was consuming
    significant database time.
    Impact is 0 active sessions, .03% of total activity.
    Wait class "Concurrency" was consuming significant database time.
    Impact is 2.53 active sessions, 48.87% of total activity.
    Finding 7: Commits and Rollbacks
    Impact is .28 active sessions, 5.42% of total activity.
    Waits on event "log file sync" while performing COMMIT and ROLLBACK operations
    were consuming significant database time.
    Recommendation 1: Host Configuration
    Estimated benefit is .28 active sessions, 5.42% of total activity.
    Action
    Investigate the possibility of improving the performance of I/O to the
    online redo log files.
    Rationale
    The average size of writes to the online redo log files was 163 K and
    the average time per write was 68 milliseconds.
    Symptoms That Led to the Finding:
    Wait class "Commit" was consuming significant database time.
    Impact is .28 active sessions, 5.42% of total activity.
    Finding 8: Undo I/O
    Impact is .18 active sessions, 3.53% of total activity.
    Undo I/O was a significant portion (26%) of the total database I/O.
    No recommendations are available.
    Symptoms That Led to the Finding:
    The throughput of the I/O subsystem was significantly lower than
    expected.
    Impact is .08 active sessions, 1.46% of total activity.
    Wait class "User I/O" was consuming significant database time.
    Impact is .7 active sessions, 13.57% of total activity.
    Finding 9: CPU Usage
    Impact is .13 active sessions, 2.57% of total activity.
    Time spent on the CPU by the instance was responsible for a substantial part
    of database time.
    Recommendation 1: SQL Tuning
    Estimated benefit is .13 active sessions, 2.57% of total activity.
    Finding 10: Top SQL By I/O
    Impact is .11 active sessions, 2.21% of total activity.
    Individual SQL statements responsible for significant user I/O wait were
    found.
    Recommendation 1: SQL Tuning
    Estimated benefit is .11 active sessions, 2.22% of total activity.
    Action
    Run SQL Tuning Advisor on the SQL statement with SQL_ID "b3pnc5yctv2z5".
    Related Object
    SQL statement with SQL_ID b3pnc5yctv2z5.
    INSERT INTO ZX_TRANSACTION_LINES_GT( APPLICATION_ID ,ENTITY_CODE
    ,EVENT_CLASS_CODE ,TRX_ID ,TRX_LEVEL_TYPE ,TRX_LINE_ID ,LINE_CLASS
    ,LINE_LEVEL_ACTION ,TRX_LINE_TYPE ,TRX_LINE_DATE
    ,LINE_AMT_INCLUDES_TAX_FLAG ,LINE_AMT ,TRX_LINE_QUANTITY ,UNIT_PRICE
    ,PRODUCT_ID ,PRODUCT_ORG_ID ,UOM_CODE ,PRODUCT_CODE ,SHIP_TO_PARTY_ID
    ,SHIP_FROM_PARTY_ID ,BILL_TO_PARTY_ID ,BILL_FROM_PARTY_ID
    ,SHIP_FROM_PARTY_SITE_ID ,BILL_FROM_PARTY_SITE_ID
    ,SHIP_TO_LOCATION_ID ,SHIP_FROM_LOCATION_ID ,BILL_TO_LOCATION_ID
    ,SHIP_THIRD_PTY_ACCT_ID ,SHIP_THIRD_PTY_ACCT_SITE_ID ,HISTORICAL_FLAG
    ,TRX_LINE_CURRENCY_CODE ,TRX_LINE_CURRENCY_CONV_DATE
    ,TRX_LINE_CURRENCY_CONV_RATE ,TRX_LINE_CURRENCY_CONV_TYPE
    ,TRX_LINE_MAU ,TRX_LINE_PRECISION ,HISTORICAL_TAX_CODE_ID
    ,TRX_BUSINESS_CATEGORY ,PRODUCT_CATEGORY ,PRODUCT_FISC_CLASSIFICATION
    ,LINE_INTENDED_USE ,PRODUCT_TYPE ,USER_DEFINED_FISC_CLASS
    ,ASSESSABLE_VALUE ,INPUT_TAX_CLASSIFICATION_CODE ,ACCOUNT_CCID
    ,BILL_THIRD_PTY_ACCT_ID ,BILL_THIRD_PTY_ACCT_SITE_ID ,TRX_LINE_NUMBER
    ,TRX_LINE_DESCRIPTION ,PRODUCT_DESCRIPTION ,USER_UPD_DET_FACTORS_FLAG
    ,DEFAULTING_ATTRIBUTE1 ) SELECT :B4 ,:B3 ,:B2
    ,PRL.REQUISITION_HEADER_ID ,:B1 ,PRL.REQUISITION_LINE_ID ,'INVOICE'
    ,NVL(PRL.TAX_ATTRIBUTE_UPDATE_CODE,'UPDATE') ,'ITEM'
    ,NVL(PRL.NEED_BY_DATE, SYSDATE) ,'N' ,NVL(PRL.AMOUNT,
    PRL.UNIT_PRICE*PRL.QUANTITY) ,PRL.QUANTITY ,PRL.UNIT_PRICE
    ,PRL.ITEM_ID ,(SELECT FSP.INVENTORY_ORGANIZATION_ID FROM
    FINANCIALS_SYSTEM_PARAMS_ALL FSP WHERE FSP.ORG_ID=PRL.ORG_ID)
    ,(SELECT MUM.UOM_CODE FROM MTL_UNITS_OF_MEASURE MUM WHERE
    MUM.UNIT_OF_MEASURE=PRL.UNIT_MEAS_LOOKUP_CODE) ,MSIB.SEGMENT1
    ,PRL.DESTINATION_ORGANIZATION_ID ,PV.PARTY_ID ,PRH.ORG_ID
    ,PV.PARTY_ID ,PVS.PARTY_SITE_ID ,PVS.PARTY_SITE_ID
    ,PRL.DELIVER_TO_LOCATION_ID ,(SELECT HZPS.LOCATION_ID FROM
    HZ_PARTY_SITES HZPS WHERE HZPS.PARTY_SITE_ID = PVS.PARTY_SITE_ID)
    ,(SELECT LOCATION_ID FROM HR_ALL_ORGANIZATION_UNITS WHERE
    ORGANIZATION_ID=PRH.ORG_ID) ,PRL.VENDOR_ID ,PRL.VENDOR_SITE_ID ,NULL
    ,NVL(PRL.CURRENCY_CODE, :B9 ) ,NVL2(PRL.CURRENCY_CODE, PRL.RATE_DATE,
    SYSDATE) ,NVL2(PRL.CURRENCY_CODE, PRL.RATE, :B8 )
    ,NVL2(PRL.CURRENCY_CODE, PRL.RATE_TYPE, :B7 )
    ,FC.MINIMUM_ACCOUNTABLE_UNIT ,NVL(FC.PRECISION, 2) ,NULL
    ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.TRX_BUSINESS_CATEGORY, NULL),
    NULL ) ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.PRODUCT_CATEGORY, NULL), NULL )
    ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.PRODUCT_FISC_CLASSIFICATION,
    NULL), NULL ) ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.LINE_INTENDED_USE, NULL), NULL )
    ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.PRODUCT_TYPE, NULL), NULL )
    ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.USER_DEFINED_FISC_CLASS, NULL),
    NULL ) ,DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.ASSESSABLE_VALUE, NULL), NULL )
    ,DECODE(:B6 , 'REQIMPORT', PRL.TAX_NAME,
    DECODE(PRL.TAX_ATTRIBUTE_UPDATE_CODE, 'CREATE',
    NVL2(PRL.PARENT_REQ_LINE_ID, ZXLDET.INPUT_TAX_CLASSIFICATION_CODE,
    NULL), NULL ) ) ,NVL((SELECT PRD.CODE_COMBINATION_ID FROM
    PO_REQ_DISTRIBUTIONS_ALL PRD WHERE PRD.REQUISITION_LINE_ID =
    PRL.REQUISITION_LINE_ID AND ROWNUM = 1), MSIB.EXPENSE_ACCOUNT )
    ,PV.VENDOR_ID ,PVS.VENDOR_SITE_ID ,PRL.LINE_NUM ,PRL.ITEM_DESCRIPTION
    ,PRL.ITEM_DESCRIPTION ,(SELECT 'Y' FROM DUAL WHERE :B6 = 'REQIMPORT'
    AND PRL.TAX_NAME IS NOT NULL) ,PRL.DESTINATION_ORGANIZATION_ID FROM
    PO_REQUISITION_HEADERS_ALL PRH, PO_REQUISITION_LINES_ALL PRL,
    ZX_LINES_DET_FACTORS ZXLDET, PO_VENDORS PV, PO_VENDOR_SITES_ALL PVS,
    MTL_SYSTEM_ITEMS_B MSIB, FND_CURRENCIES FC WHERE
    PRH.REQUISITION_HEADER_ID = :B5 AND PRH.REQUISITION_HEADER_ID =
    PRL.REQUISITION_HEADER_ID AND ZXLDET.APPLICATION_ID(+) = :B4 AND
    ZXLDET.ENTITY_CODE(+) = :B3 AND ZXLDET.EVENT_CLASS_CODE(+) = :B2 AND
    ZXLDET.TRX_LEVEL_TYPE(+) = :B1 AND ZXLDET.TRX_LINE_ID(+) =
    PRL.PARENT_REQ_LINE_ID AND PV.VENDOR_ID(+) = PRL.VENDOR_ID AND
    PVS.VENDOR_SITE_ID(+) = PRL.VENDOR_SITE_ID AND
    MSIB.INVENTORY_ITEM_ID(+) = PRL.ITEM_ID AND MSIB.ORGANIZATION_ID(+) =
    PRL.ORG_ID AND FC.CURRENCY_CODE(+) = PRL.CURRENCY_CODE AND
    NVL(PRL.MODIFIED_BY_AGENT_FLAG, 'N') = 'N' AND NVL(PRL.CANCEL_FLAG,
    'N') = 'N' AND NVL(PRL.CLOSED_CODE, 'OPEN') <> 'FINALLY CLOSED' AND
    PRL.LINE_LOCATION_ID IS NULL AND PRL.AT_SOURCING_FLAG IS NULL
    Rationale
    SQL statement with SQL_ID "b3pnc5yctv2z5" was executed 3 times and had
    an average elapsed time of 138 seconds.
    Rationale
    Average time spent in User I/O wait events per execution was 137
    seconds.
    Symptoms That Led to the Finding:
    Wait class "User I/O" was consuming significant database time.
    Impact is .7 active sessions, 13.57% of total activity.
    Additional Information
    Miscellaneous Information
    Wait class "Application" was not consuming significant database time.
    Wait class "Network" was not consuming significant database time.
    Session connect and disconnect calls were not consuming significant database
    time.
    The database's maintenance windows were active during 100% of the analysis
    period.
    Regards
    Athish

    Few days are am facing serious of performance problem in our Production instanceFor production issues, please log a SR.
    Was this working before? If yes, any changes been done recently?
    Do you have the statistics collected up to date?
    Please see these docs.
    AutoInvoice Performance Issue When Processing Tax [ID 1059275.1]
    R12 : System Hangs When Attempting To Save Blanket Release After Applying Patch 11817843 [ID 1333336.1]
    Thanks,
    Hussein

Maybe you are looking for

  • How to append new row in rowset with parameter?

    Hi, In the data input page in prerender method I have this code to filter rowset with non existing id in the table to show empty table on the page: try {                        getSessionBean1().getKoordinatesRowSet().setObject(1, non_existing_id);  

  • After formatting my laptop I have lost my default hp software

    Due to slow down in my hp pavilion dm1 laptop i gave it to a local shop not hp shop he formated my laptop but I have lost the softwares like webcam e.t.c 

  • IMovie 11 Slideshow image quality issue

    Hi, when I am creating a slideshow with iMovie from still images, I have a severe loss of image quality. I have tried to search forums up and down, but did not find any help or solution for that. The loss of quality is kind of dramatic. Any ideas, su

  • Writting java graphics and textual data from java application into MS word

    By using POI API, I could write textual data into MS word by using java application. Could any one help me out how to write Java graphics(i.e. Writting JPanel) and textual data(i.e.IOStream data) both into MS word document. Thank you for time spent.

  • Can a signed applet run classes from disk?

    Hi all, I have a signed applet jar and a signed jar file somewhere on disk (I can ensure the jar file is available on client's machine before i run the applet). My applet doesn't let me have file io access from the classes in the jar file on disk. It