Performance estimates

Hello all,
We are designing a new system to be the back end of a network application. The basic premises are:
- very few simultaneous connections (probably no more than 4)
- datamodel consisting of some 20 tables, most of them tiny (300 rows or so)
- a couple of tables with approx. 300K rows
- most tables have 20 fields at most, 5 or 6 on average
- almost all fields are fixed width
- all users run a couple of different (simple) queries against one of
the main tables, with half a dozen joins against the tiny ones
- queries can be accessed via stored procedures or optimized in any
approppiate way
- there will be between 10 and 40 queries per second under normal load,
and up to 300 per second during peak load (a few minutes)
- query response time needs to be very fast, ideally about 50 milliseconds
The idea is to deploy this on a 10g RAC, consisting of two nodes of 1 CPU each, possibly small POWER5 systems. The physical DB will be stored in a shared high-end storage (FAStT), where the nodes will access through FiberChannel links.
Do you think it is possible to achieve this performance level (50 msec) with the proposed configuration?

It's possible yet irrelervant.
select * from table where pk_column='ABC' gives you result possible under 50 ms
select * from table1, table2, table3 when they have 300k rows, it gives you result for sure greater than 50 ms

Similar Messages

  • Advanced Queuing performance estimate ?

    Does anyone have any performance experience with using AQ on Unix. How many messages can be enqueued/dequeued per second ? This is of course very configuration/hardware dependent. But if anyone have any examples i would be very greatful.
    Thanks
    /Christian
    null

    ODP.NET does not support AQ but we will evaluate it in a later release.

  • Filesystem Suggestions for Oracle on Linux

    Hello. We've been running Oracle on Solaris with Veritas Volume Manager (w/ qio) for about 4 years now and we are gearing up for going Oracle (9i) on Linux (AS). Since we are just getting started I wanted to run through setting up a preliminary test machine and Oracle install (I.E., we don't want to spend too much $ just yet).
    Can anyone supply some feedback on the various filesystems that come with Redhat or that are available from the open source community (raw, ext3fs, xfs, reiserfs)? Eventually we may look at things like Veritas for Linux or OCFS, but for setting up a initial testbed, might yall recommend some pros and cons, perhaps some performance estimates of going raw, versus the various linux filesystems? Also, is there a good document available for setting up raw partitions on linux for oracle? Any and all feedback would be appreciated.

    Hi,
    Keep in mind, if you need to use large amount of data, with databank files bigger than 2GB, some people consider the reiserfs the better option. Pther way ext3 is a good one.
    Regards,
    Eduardo

  • DNS Benchmarks are important.

    Below are posted the results of a recent DNS Benchmark test using the DNS servers that I have set in my router DNS settings section.Not sure if the HH/HH3 has that option as I use a Belkin N1.
    The reason I have posted the below info is because after clicking the PPPoE settings and accepting the DNS servers that our ISP puts in automatically my performance was unreliable.
    So I unclicked the  "Get DNS from ISP" option and replaced the DNS servers with the ones in the report below,which judging by the benchmark report was a good move.
    The DNS benchmark tester I use allows you to setup a database of every DNS server that is nearest to you and reliable, [no router crashes,or modem cutouts],and a stable profile.
    Just google "DNSBench".
    The results summary, conclusions, and recommendations from your most recent run of this DNS benchmark are provided below. Please carefully consider the implications of making any changes to your system's current configuration before doing so.
    þ System has multiple redundant nameservers configured.
    This system is currently configured to use 2 separate nameservers for DNS name resolution. This is in keeping with recommended best practice (of having at least two different nameservers) so that the temporary failure of any single nameserver will not prevent all DNS name resolution.
    þ All system nameservers are alive & replying to queries.
    All of this system's 2 nameservers are working and replying to queries. This is terrific because if the system's primary nameserver were to become overloaded or unavailable, even briefly, one or more backup nameservers are standing by ready to supply DNS lookup services.
    þ System's nameservers are probably optimally ordered.
    Windows uses DNS servers in the order they are listed under the network adapter's properties, or when obtained automatically from an ISP, in the order provided by the ISP. Windows will fall back to using the second, third, and other nameservers only when the first listed nameserver fails to respond. So if the first nameserver happened to be very slow, but working, everything would be slowed down. Consequently, the order of nameserver listing should match their order of decreasing performance . . . which is probably how this system is currently configured:
         Usage Order   Nameserver IP   Speed Rank
               1      194. 74. 65. 68      1
               2      194. 72.  0. 98      2
    Why only "probably" ?
    Only "probably" because there wasn't enough of a statistically significant difference between their timings to be able to make any claims with at least 95% confidence.  Here are the details:
     When this benchmark is allowed to finish, it will have collected approximately one hundred and fifty (150) DNS performance samples from each nameserver being tested.  Although this is sufficient to generate a good average performance estimate, if the collection of sampled values are too widely spread apart (in other words, not a lot of agreement among samples), it is impossible to know with "statistical certainty" (to be 95% sure) how individual nameservers compare to each other.
     Therefore, even if the ranking shown above appears to be out of order, the differences are not statistically significant, and you should not be concerned.  If you were to re-run the benchmark you might get a different outcome.  This benchmark conclusion page will inform you when a problem exists that is statistically significant, and will then advise you that your DNS nameserver settings should be changed.  But that is not the case with the benchmark results that were just obtained.
    ý System nameservers are SLOWER than 14 public alternatives!
    This benchmark found 14 publicly available DNS nameservers that are reliably faster than the slowest nameserver currently being used by this system. If you were to adjust your system's configuration to use the faster of these nameservers instead of what it is currently using, your DNS lookup performance, and all use of the Internet, would be improved.
    Recommended Actions:
    With at least 95% certainty:  Based upon a statistical analysis of the spread in timing value samples received during the benchmark, there is at least a 95% certainty that the performance conclusions stated above are correct. But even so, since changing DNS nameservers requires thought and effort, it's something you want to be sure about. Therefore, since these results represent a single snapshot in time, you may wish to confirm that the faster alternative nameservers are consistently faster than your system's currently configured nameservers, and that those public alternatives don't have any negative characteristics such as being colored orange to signify that they redirect mistaken URLs to an advertising-laden search page rather than returning an error (which will be a concern to some users).
    You may also wish to check the relative performance at different times of day to make sure that the performance improvement over your system's current nameservers is reliable throughout the day.
    And you may wish to make sure that the alternative nameservers are enough faster than what you are currently using for the improvement to be worth changing away from what you're currently using. (This test is only saying that it's 95% sure they are any amount faster.)
    þ This system's nameservers are 100% reliable.
    DNS reliability is extremely important, since lookup requests that are dropped and ignored by nameservers cause significant delays in Internet access while the querying system waits for a reply. The system is then finally forced to reissue the query to the same or to backup nameservers. While your system is patiently waiting for a reply, you are impatiently waiting to get on with your Internet access.
    During this benchmark test, all of the system's nameservers tested returned a reply for every request sent. It doesn't get any better than that. Very nice.
    þ All of this system nameservers return errors.
    This is a GOOD thing!  Some DNS providers, such as OpenDNS and even the Earthlink, Roadrunner and Comcast ISPs, redirect incorrectly entered URLs to their own advertising-laden marketing-driven interception page instead of simply returning an error to the web browser. But this system's nameservers are returning errors when asked to lookup non-existent domain names.
    þ System nameservers are replying to all query types.
    During the development of this DNS Benchmark we discovered that the routers used by some pre-release testers were not returning results for the benchmark's Uncached and/or Dotcom testing queries. Even though these queries are admittedly unusual, they are completely valid. So the only conclusion was that those few routers were inherently defective. The good news here is that your nameservers are replying to these unusual but valid queries.
    The above is for info only and posted incase it might be of some use to anyone losing thier connection frequently.
    If the mods find this post out of order in any way,please delete it.

    Gibson Research have produced several useful tools over the years including this one.
    A list of their freeware is available here.

  • 32-bit Intel Core Duo ok with upcoming 64-bit Leopard?

    How well suited is the 32-bit Intel Core Duo in my MacBook Pro to run the future 64-bit Leopard OS? What would be the compromises?
    Should I sell my Core Duo now while I can (maybe...) and upgrade to the 64-bit Core2 Duo. Would a 32-bit chip such as the Core Duo struggle to operate efficiently - or at least as fast as it does under 32-bit Tiger - when run within the 64-bit Leopard OS?
    Cheers
    Ant

    You might find this tidibit (from AnandTech) )interesting, Kappy:
    "Why a 64-bit mode can actually be slower than a 32-bit counterpart
    If all else is equal, a 64-bit MPU will be slower than its 32-bit equivalent. A study conducted by DEC found that, on average, compiling for 64bit programs decreases performance by 5%. This is because 64-bit address pointers occupy more space, resulting in higher data cache miss rates. In fact, 64-bit ISAs still support 64-bit addressing and 32-bit data operands, specifically to keep code size down and the miss rate penalty to a minimum; thus 32-bit integer data is still going to be used when the larger range of 64-bit integers are not needed.
    What good is 64-bit computing?
    There is one good use for 64-bit integer arithmetic: 64-bit flat memory addressing. Offering memory addressing beyond 4GB, 64-bit addressing needs 64-bit general purpose registers and 64-bit integer arithmetic for memory pointer calculations. This obviously has no effect on 32-bit vs. 64-bit performance, since 64-bit memory addressing on a 32-bit processor is a moot point."
    So it's not clear that going 64-bit, in and of itself, would yield any improvement in performance; it may well be worse in some cases (and your analogy might well be true, depending on the cache algorhythms and efficiency).
    Certainly if one processor has a wider memory bus than another, then the first processor should, all else being equal, outperform the second processor. I can't find specs on the memory fetch for the Core Duo and the Core 2 Duo, so I can't say whether or not they differ. The PowerPC G5 processor actually has a 128-bit wide memory fetch (64-bit in and 64-bit out) though it's classified as a "64-bit processor" (based on it's memory address space, I would presume).
    So, as you allude, one has to be careful making performance estimates just based on a desciption of a processor being "32 bit" or "64 bit". We'll have to wait to see reasonable benchmarks between the Core Duo and the Core 2 Duo running a 64-bit OS before we'll really know what advantage, if any, there is.
    Cheers.
    Message was edited by: Dave Sawyer

  • Jni vs native

    How slower jni compare to native cpp implementation ? It would be great if there is some performance statistic available.

    Any benchmarking results would be very application-specific. It would depend very heavily on how many API calls are being made across JNI, how much data is being passed in those API calls, how much I/O is occurring and what other functionality is part of the application code. Event an attempt to say "on average, a JNI API call is X% slower than the equivalent CPP API call" would result in having X% be completely invalid for many kinds of applications with different characteristics.
    As stated in the other post, most customers choose the API based on their application development requirements and experience, not based on raw performance estimates.

  • BADI to perform a Cost Estimate Check in MD11

    I need a BADI to perform a cost estimate check in transaction MD11 whenever a planned order is getting created before SAVE. Can anyone please suggest me on this? The BADI MD_PLDORD_POST gets triggered after SAVE. I need a BADI which can be triggered before SAVE.

    Hi..
    You can define costing variants which have valuation variant for budgeted values parallel to the standard cost estimate  in Customizing for Product Cost Controlling.
    You can define target cost versions using above costing variants under the customizing transaction OKV6 as below picture.
    When you calculate variances, you can check “all target cost version” flag to calculate variances  for all target cost versions in the controlling area as below picture.
    You can analysis the difference between actual cost and several budget cost using target cost version as below picture.

  • Query performance issues - Poor cardinality estimate?

    Hi,
    I have a query which is taking far longer than estimated by the explain plan (estimate 1min, query still running after several hours).
    Plan hash value: 3287246760
    | Id  | Operation                             | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                      |                |     1 |   195 |  3795   (1)| 00:00:46 |
    |   1 |  VIEW                                 |                |     1 |   195 |  3795   (1)| 00:00:46 |
    |   2 |   WINDOW SORT                         |                |     1 |   151 |  3795   (1)| 00:00:46 |
    |   3 |    VIEW                               |                |     1 |   151 |  3794   (1)| 00:00:46 |
    |   4 |     SORT UNIQUE                       |                |     1 |   147 |  3794   (1)| 00:00:46 |
    |   5 |      WINDOW BUFFER                    |                |     1 |   147 |  3794   (1)| 00:00:46 |
    |   6 |       SORT GROUP BY PIVOT             |                |     1 |   147 |  3794   (1)| 00:00:46 |
    |   7 |        NESTED LOOPS                   |                |       |       |            |          |
    |   8 |         NESTED LOOPS                  |                |     1 |   147 |  3793   (1)| 00:00:46 |
    |   9 |          NESTED LOOPS                 |                |     3 |   297 |  1503   (1)| 00:00:19 |
    |* 10 |           HASH JOIN                   |                |   238 | 15470 |    75   (7)| 00:00:01 |
    |  11 |            MAT_VIEW ACCESS FULL       | VENTILATION    | 17994 |   404K|    35   (0)| 00:00:01 |
    |  12 |            VIEW                       |                | 17994 |   738K|    39  (11)| 00:00:01 |
    |  13 |             SORT UNIQUE               |                | 17994 |   702K|    39  (11)| 00:00:01 |
    |  14 |              WINDOW SORT              |                | 17994 |   702K|    39  (11)| 00:00:01 |
    |* 15 |               VIEW                    |                | 17994 |   702K|    37   (6)| 00:00:01 |
    |  16 |                WINDOW SORT            |                | 17994 |   632K|    37   (6)| 00:00:01 |
    |  17 |                 MAT_VIEW ACCESS FULL  | VENTILATION    | 17994 |   632K|    35   (0)| 00:00:01 |
    |  18 |           INLIST ITERATOR             |                |       |       |            |          |
    |* 19 |            TABLE ACCESS BY INDEX ROWID| LABEVENTS      |     1 |    34 |     6   (0)| 00:00:01 |
    |* 20 |             INDEX RANGE SCAN          | LABEVENTS_O5   |     5 |       |     3   (0)| 00:00:01 |
    |* 21 |          INDEX RANGE SCAN             | CHARTEVENTS_O5 |  4937 |       |    12   (0)| 00:00:01 |
    |* 22 |         TABLE ACCESS BY INDEX ROWID   | CHARTEVENTS    |     1 |    48 |   763   (0)| 00:00:10 |
    Predicate Information (identified by operation id):
      10 - access("ICUS"."SUBJECT_ID"="FVGT48H"."SUBJECT_ID" AND
                  SYS_EXTRACT_UTC("FVGT48H"."BEGIN_TIME")=SYS_EXTRACT_UTC("ICUS"."BEGIN_TIME"))
      15 - filter((INTERNAL_FUNCTION("END_TIME")-INTERNAL_FUNCTION("BEGIN_TIME"))DAY(9) TO
                  SECOND(9)>INTERVAL'+02 00:00:00' DAY(2) TO SECOND(0))
      19 - filter(SYS_EXTRACT_UTC("LE"."CHARTTIME")>=SYS_EXTRACT_UTC("FVGT48H"."BEGIN_TIME") AND
                  SYS_EXTRACT_UTC("LE"."CHARTTIME")<=SYS_EXTRACT_UTC("FVGT48H"."END_TIME"))
      20 - access("ICUS"."ICUSTAY_ID"="LE"."ICUSTAY_ID" AND ("LE"."ITEMID"=50013 OR
                  "LE"."ITEMID"=50019))
           filter("LE"."ICUSTAY_ID" IS NOT NULL)
      21 - access("LE"."ICUSTAY_ID"="CE"."ICUSTAY_ID")I tried removing the nested loops using the NO_USE_NL hints, which give the following plan:
    | Id  | Operation                            | Name           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                     |                |     1 |   195 |       | 22789   (1)| 00:04:34 |
    |   1 |  VIEW                                |                |     1 |   195 |       | 22789   (1)| 00:04:34 |
    |   2 |   WINDOW SORT                        |                |     1 |   151 |       | 22789   (1)| 00:04:34 |
    |   3 |    VIEW                              |                |     1 |   151 |       | 22788   (1)| 00:04:34 |
    |   4 |     SORT UNIQUE                      |                |     1 |   147 |       | 22788   (1)| 00:04:34 |
    |   5 |      WINDOW BUFFER                   |                |     1 |   147 |       | 22788   (1)| 00:04:34 |
    |   6 |       SORT GROUP BY PIVOT            |                |     1 |   147 |       | 22788   (1)| 00:04:34 |
    |*  7 |        HASH JOIN                     |                |     1 |   147 |       | 22787   (1)| 00:04:34 |
    |   8 |         VIEW                         |                | 17994 |   738K|       |    39  (11)| 00:00:01 |
    |   9 |          SORT UNIQUE                 |                | 17994 |   702K|       |    39  (11)| 00:00:01 |
    |  10 |           WINDOW SORT                |                | 17994 |   702K|       |    39  (11)| 00:00:01 |
    |* 11 |            VIEW                      |                | 17994 |   702K|       |    37   (6)| 00:00:01 |
    |  12 |             WINDOW SORT              |                | 17994 |   632K|       |    37   (6)| 00:00:01 |
    |  13 |              MAT_VIEW ACCESS FULL    | VENTILATION    | 17994 |   632K|       |    35   (0)| 00:00:01 |
    |* 14 |         HASH JOIN                    |                | 11873 |  1217K|  5800K| 22747   (1)| 00:04:33 |
    |* 15 |          HASH JOIN                   |                | 86060 |  4790K|       | 16141   (2)| 00:03:14 |
    |  16 |           MAT_VIEW ACCESS FULL       | VENTILATION    | 17994 |   404K|       |    35   (0)| 00:00:01 |
    |* 17 |           TABLE ACCESS FULL          | LABEVENTS      |   176K|  5869K|       | 16105   (2)| 00:03:14 |
    |  18 |          INLIST ITERATOR             |                |       |       |       |            |          |
    |  19 |           TABLE ACCESS BY INDEX ROWID| CHARTEVENTS    |   104K|  4911K|       |  6024   (1)| 00:01:13 |
    |* 20 |            INDEX RANGE SCAN          | CHARTEVENTS_O4 |   104K|       |       |   220   (1)| 00:00:03 |
    Predicate Information (identified by operation id):
       7 - access("ICUS"."SUBJECT_ID"="FVGT48H"."SUBJECT_ID" AND
                  SYS_EXTRACT_UTC("FVGT48H"."BEGIN_TIME")=SYS_EXTRACT_UTC("ICUS"."BEGIN_TIME"))
           filter(SYS_EXTRACT_UTC("LE"."CHARTTIME")>=SYS_EXTRACT_UTC("FVGT48H"."BEGIN_TIME") AND
                  SYS_EXTRACT_UTC("LE"."CHARTTIME")<=SYS_EXTRACT_UTC("FVGT48H"."END_TIME"))
      11 - filter((INTERNAL_FUNCTION("END_TIME")-INTERNAL_FUNCTION("BEGIN_TIME"))DAY(9) TO
                  SECOND(9)>INTERVAL'+02 00:00:00' DAY(2) TO SECOND(0))
      14 - access("LE"."ICUSTAY_ID"="CE"."ICUSTAY_ID")
           filter(SYS_EXTRACT_UTC("CHARTTIME")<SYS_EXTRACT_UTC("LE"."CHARTTIME"))
      15 - access("ICUS"."ICUSTAY_ID"="LE"."ICUSTAY_ID")
      17 - filter("LE"."ICUSTAY_ID" IS NOT NULL AND ("LE"."ITEMID"=50013 OR "LE"."ITEMID"=50019))
      20 - access("CE"."ITEMID"=185 OR "CE"."ITEMID"=186 OR "CE"."ITEMID"=190 OR "CE"."ITEMID"=3420)The cardinality estimate looks way off to me - I'm expecting several thousand rows. I have up-to-date statistics.
    Can anyone help?
    Thanks,
    Dan

    WITH chf_patients AS (
    -- Exclude patients with CHF by ICD9 code
    select subject_id,
           hadm_id
      from mimic2v26.icd9
    where code in ('398.91','402.01','402.91','428.0','428.0', '428.1', '404.13', '404.93', '428.9', '404.91')
    , icustays AS (
        /* Our ICU Stay population */
    SELECT *
      FROM MIMIC2V26.ICUSTAY_DETAIL
    WHERE ICUSTAY_AGE_GROUP = 'adult'
       AND SUBJECT_ID NOT IN (select subject_id from chf_patients)
    --   AND SUBJECT_ID < 50
    --select * from icustays;
    -- Combine ventilation periods separated by < 48 hours.
    , combine_ventilation as (
    select subject_id,
           icustay_id,
           begin_time,
    --       end_time as end_first_vent,
    --       lead(begin_time,1) over (partition by icustay_id order by begin_time) as next_begin_time,
    --       lead(begin_time,1) over (partition by icustay_id order by begin_time) - begin_time as time_to_next,
           case when (lead(begin_time,1) over (partition by icustay_id order by begin_time) - begin_time) < interval '2' day
            then lead(end_time,1) over (partition by icustay_id order by begin_time)
            else end_time end as end_time
      from mimic2devel.ventilation
    --select * from combine_ventilation;
    --select * from combine_ventilation where end_of_ventilation != end_time;
    -- Get the first ventilation period which is >  48 hours.
    , first_vent_gt_48hrs as (
    select distinct subject_id,
           first_value(begin_time) over (partition by subject_id order by begin_time) as begin_time,
           first_value(end_time) over (partition by subject_id order by begin_time) as end_time
      from combine_ventilation where end_time - begin_time > interval '48' hour
    --select * from first_vent_gt_48hrs;
    -- Find the ICU stay when it occurred
    , icustay_first_vent_gt_48hrs as (
    select fvgt48h.subject_id,
           icus.icustay_id,
           fvgt48h.begin_time,
           fvgt48h.end_time
      from first_vent_gt_48hrs fvgt48h
      join mimic2devel.ventilation icus on icus.subject_id = fvgt48h.subject_id and fvgt48h.begin_time = icus.begin_time
    --select /*+gather_plan_statistics*/ * from icustay_first_vent_gt_48hrs;
    , pao2_fio2_during_ventilation as (
    select /*+ NO_USE_NL(le ifvgt48h) */
           le.subject_id,
           le.hadm_id,
           le.icustay_id,
           charttime,
           case when itemid = 50019 then 'PAO2'
                when itemid = 50013 then 'FIO2'
           end as item_type,
           -- Some FIO2s are fractional instead of percentage
           case when itemid = 50013 and valuenum > 1 then round(valuenum / 100,2)
                else round(valuenum,2)
           end as valuenum
      from mimic2v26.labevents le
      join icustay_first_vent_gt_48hrs ifvgt48h on ifvgt48h.icustay_id = le.icustay_id and le.charttime between ifvgt48h.begin_time and ifvgt48h.end_time
    where le.itemid = 50019 or le.itemid = 50013
    --select * from pao2_fio2_during_ventilation;
    -- Check that FIO2s have valid range
    , vent_data_pivot as (
    select * from (
        select subject_id, hadm_id, icustay_id, charttime, item_type, valuenum from pao2_fio2_during_ventilation)
        pivot ( max(valuenum) as valuenum for item_type in ('FIO2' as fio2, 'PAO2' as pao2) )
    --select * from vent_data_pivot;
    -- Fill in prior FIO2 from chartevents
    , get_prior_fio2s as (
    select /*+ NO_USE_NL(vdp ce) */
           distinct
           vdp.subject_id,
           vdp.hadm_id,
           vdp.icustay_id,
           vdp.charttime as pao2_charttime,
           vdp.fio2_valuenum,
           vdp.pao2_valuenum,
    --       ce.itemid,
    --       ce.charttime as chart_charttime,
    --       ce.value1num,
           first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) as most_recent_fio2_raw,
           case when first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) > 1
              then round(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) / 100,2)
              else round(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc),2)
           end as most_recent_fio2,
           first_value(ce.charttime) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) as most_recent_fio2_charttime,
           vdp.charttime - first_value(ce.charttime) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) as time_since_fio2,
    --       first_value(ce.charttime) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) as most_recent_charttime
           case when first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) > 1
              then round(vdp.pao2_valuenum/(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) / 100),2)
              else round(vdp.pao2_valuenum/(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc)),2)
           end as pf_ratio,
           case when first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) > 1
              then
                case when vdp.pao2_valuenum/(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc) / 100) < 200 then 1 else 0 end
              else
                case when vdp.pao2_valuenum/(first_value(ce.value1num) over (partition by ce.icustay_id, vdp.charttime order by ce.charttime desc)) < 200 then 1 else 0 end
           end as pf_ratio_below_thresh
      from vent_data_pivot vdp
      join mimic2v26.chartevents ce on vdp.icustay_id = ce.icustay_id and ce.charttime < vdp.charttime
    where itemid in (190,3420,186,185)
    --select * from get_prior_fio2s order by icustay_id, charttime;
    , pf_data as (
    select subject_id,
           hadm_id,
           icustay_id,
           pao2_charttime,
           lead(pao2_charttime) over (partition by icustay_id order by pao2_charttime) as next_pao2_charttime,
           fio2_valuenum,
           pao2_valuenum,
           lead(pao2_valuenum) over (partition by icustay_id order by pao2_charttime) as next_pao2_valuenum,
           most_recent_fio2_raw,
           most_recent_fio2,
           most_recent_fio2_charttime,
           time_since_fio2,
           pf_ratio,
           lead(pf_ratio) over (partition by icustay_id order by pao2_charttime) as next_pf_ratio,
           pf_ratio_below_thresh,
           lead(pf_ratio_below_thresh) over (partition by icustay_id order by pao2_charttime) as next_pf_ratio_below_thresh
      from get_prior_fio2s
    select * from pf_data;Table structure is available here:
    http://mimic.physionet.org/schema/latest/
    Can I still get a TKPROF if the query doesn't complete? I'll have a go and post the results shortly.
    Thanks,
    Dan

  • Material Cost estimate modification

    Hi Experts
    I want to modified this report and add cost estimate value from MBEW (field is STPRS) for each material  to this report. I have used the table MBEW but unable to locate where to start.
    Can anyone have a look and comment on this report
    REPORT  command_extract                    .
    *CLASS cl_gui_control DEFINITION LOAD.
    *CLASS cl_gui_frontend_services DEFINITION LOAD.
    Tables
    TABLES:
      kna1,
      knb1,
      knvv,
      mara,
      mast,                                       "JPC20061107
      marc,
      makt,
      sscrfields.
    CONSTANTS: BEGIN OF gc_status,
                 acc  TYPE zcrstat1 VALUE ' ACC',
                 hol  TYPE zcrstat1 VALUE ' HOL',
                 sto  TYPE zcrstat1 VALUE ' STO',
                 ok   TYPE zcrstat1 VALUE '  OK',
                 hold TYPE zcrstat1 VALUE 'HOLD',
               END OF gc_status.
    CONSTANTS: BEGIN OF gc_reason,
                 000 TYPE zreason VALUE '000',
                 001 TYPE zreason VALUE '001',
                 002 TYPE zreason VALUE '002',
                 003 TYPE zreason VALUE '003',
                 004 TYPE zreason VALUE '004',
                 005 TYPE zreason VALUE '005',
                 006 TYPE zreason VALUE '006',
                 007 TYPE zreason VALUE '007',
                 008 TYPE zreason VALUE '008',
                 010 TYPE zreason VALUE '010',
                 011 TYPE zreason VALUE '011',
                 021 TYPE zreason VALUE '021',
                 022 TYPE zreason VALUE '022',
                 023 TYPE zreason VALUE '023',
                 024 TYPE zreason VALUE '024',
                 025 TYPE zreason VALUE '025',
                 026 TYPE zreason VALUE '026',
                 999 TYPE zreason VALUE '999',
               END OF gc_reason.
    TYPES: BEGIN OF ty_kna1_fields,
             kunnr TYPE kna1-kunnr,
             sperr TYPE kna1-sperr,
             aufsd TYPE kna1-aufsd,
             lifsd TYPE kna1-lifsd,
             faksd TYPE kna1-faksd,
             loevm TYPE kna1-loevm,
           END OF ty_kna1_fields.
    TYPES: BEGIN OF ty_knb1_fields,
             kunnr TYPE knb1-kunnr,
             bukrs TYPE knb1-bukrs,
             sperr TYPE knb1-sperr,
             loevm TYPE knb1-loevm,
           END OF ty_knb1_fields.
    TYPES: BEGIN OF ty_knvv_fields,
             kunnr TYPE knvv-kunnr,
             vkorg TYPE knvv-vkorg,
             vtweg TYPE knvv-vtweg,
             spart TYPE knvv-spart,
             aufsd TYPE knvv-aufsd,
             lifsd TYPE knvv-lifsd,
             faksd TYPE knvv-faksd,
           END OF ty_knvv_fields.
    TYPES: BEGIN OF ty_knkk_fields,
             kunnr TYPE knkk-kunnr,
             kkber TYPE knkk-kkber,
             ctlpc TYPE knkk-ctlpc,
             crblb TYPE knkk-crblb,
             knkli TYPE knkk-knkli,
             klimk TYPE knkk-klimk,
             skfor TYPE knkk-skfor,
             ssobl TYPE knkk-ssobl,
           END OF ty_knkk_fields.
    TYPES: BEGIN OF ty_cust_stat_output,
             kunnr(10) TYPE c, "Customer #
             stat(4)   TYPE c, "Customer status
           END OF ty_cust_stat_output.
    TYPES:
      BEGIN OF ty_customers,
        kunnr(10)  TYPE c,  " Customer #
        div1(1)    TYPE c,  " Pipe delimiter
        name1(32)  TYPE c,  " Customer name
        div2(1)    TYPE c,  " Pipe delimiter
        altkn(8)   TYPE c,  " Old Customer #
        div3(1)    TYPE c,  " Pipe delimiter
        stras(30)  TYPE c,  " Street
        div4(1)    TYPE c,  " Pipe delimiter
        ort01(20)  TYPE c,  " City
        div5(1)    TYPE c,  " Pipe delimiter
        regio(3)   TYPE c,  " State
        div6(1)    TYPE c,  " Pipe delimiter
        pstlz(4)   TYPE c,  " Postcode
        div7(1)    TYPE c,  " Pipe delimiter
        telf1(14)  TYPE c,                                      " Phone 1
        div8(1)    TYPE c,  " Pipe delimiter
        telf2(14)  TYPE c,                                      " Phone 2
        div9(1)    TYPE c,  " Pipe delimiter
        erdat(10)  TYPE c,  " date
        div10(1)   TYPE c,  " Pipe delimiter
        splant(2)  TYPE c,  " plant
        div11(1)   TYPE c,  " Pipe delimiter
      END OF ty_customers,
      it_ty_customers TYPE ty_customers OCCURS 0,
      BEGIN OF ty_custstat,
        kunnr(11)  TYPE c,  " Customer #
        company(2) TYPE c,  " #
        status(3)  TYPE c,  " acc,cod,hol,
      END OF ty_custstat,
      it_ty_custstat TYPE ty_custstat OCCURS 0.
    TYPES:
      BEGIN OF ty_materialm,
        matnr(12)  TYPE c,  " Material #
        maktx2(40) TYPE c,  " Command sales desc.
        maktx(16)  TYPE c,  " Basic description
        extwg(6)   TYPE c,  " External Material Group
        flag1(1)   TYPE c,  "
        flag2(1)   TYPE c,  "
        flag3(1)   TYPE c,  "
        flag4(1)   TYPE c,  "
      END OF ty_materialm,
      it_ty_materialm TYPE ty_materialm OCCURS 0,
      BEGIN OF ty_materialp,
        matnr(12)  TYPE c,  " Material #
        werks(4)   TYPE c,  " plant
        batch(1)   TYPE c,  " download to batch
      END OF ty_materialp,
      it_ty_materialp TYPE ty_materialp OCCURS 0.
    TYPES:
      BEGIN OF ty_bom,
        matnr(12)  TYPE c,  " Material #
        werks(4)   TYPE c,  " Plant
        posnr(3)   TYPE c,  " position
        idnrk(12)  TYPE c,  " BOM material #
        menge(10)  TYPE c,  " Quantity
        meins(3)   TYPE c,  " Unit of Measure
      END OF ty_bom,
      it_ty_bom TYPE ty_bom OCCURS 0,
    *Start of block of changes for JPC20061107
      BEGIN OF ty_bom_sapfmt,
        matnr   TYPE MAST-MATNR,  " Material #
        werks   TYPE MAST-WERKS,  " Plant
        posnr   TYPE STPO-POSNR,  " position
        idnrk   TYPE STPO-IDNRK,  " BOM material #
        menge   TYPE STPO-MENGE,  " Quantity
        meins   TYPE STPO-MEINS,  " Unit of Measure
        potx1   TYPE STPO-POTX1,  " Text description for BOM
      END OF ty_bom_sapfmt.
    BEGIN OF ty_bomlist,
       matnr      LIKE mast-matnr,  " Material #
       stlnr      LIKE mast-stlnr,  " BOM #
       posnr      LIKE stpo-posnr,  " BOM item#
       idnrk      LIKE stpo-idnrk,  " BOM material #
       menge      LIKE stpo-menge,  " BOM material qty
       meins      LIKE stpo-meins,  " BOM material uom
    END OF ty_bomlist,
    it_ty_bomlist TYPE ty_bomlist OCCURS 0.
    *Ending block of changes for JPC20061107
    Selection screen definition
    SELECTION-SCREEN: BEGIN OF BLOCK gen WITH FRAME TITLE text-001.
    PARAMETERS:
    p_dir like rlgrap-filename obligatory, " extract directory
      p_ccust TYPE c DEFAULT ' ' AS CHECKBOX,   " Check box customers
      p_cmatm TYPE c DEFAULT ' ' AS CHECKBOX,   " Check box Materials
      p_cbom  TYPE c DEFAULT ' ' AS CHECKBOX,   " Check box BOMs
      p_ccst  TYPE c DEFAULT ' ' AS CHECKBOX.   " Check box credit stat
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-006.
    PARAMETERS:
      p_gui RADIOBUTTON GROUP rg1 USER-COMMAND u01,
      p_svr RADIOBUTTON GROUP rg1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK a.
    SELECTION-SCREEN: END OF BLOCK gen.
    SELECTION-SCREEN: BEGIN OF BLOCK cust WITH FRAME TITLE text-002.
    PARAMETERS:
      p_dcust LIKE filepath-pathintern DEFAULT 'Z_COMMAND_CUST_EXTRACT',
      p_fcust LIKE rlgrap-filename,
      p_dcomp LIKE knb1-bukrs,
      p_dsale LIKE knvv-vkorg,
      p_dwerk(3) TYPE c.
    SELECTION-SCREEN: END OF BLOCK cust.
    SELECTION-SCREEN: BEGIN OF BLOCK matnr WITH FRAME TITLE text-003.
    PARAMETERS:
      p_dmatm LIKE filepath-pathintern
                   DEFAULT 'Z_COMMAND_MATERIAL_EXTRACT',
      p_fmatm LIKE rlgrap-filename,
      p_fmatp LIKE rlgrap-filename,
      p_dwerks LIKE marc-werks,
      p_dspras LIKE makt-spras,
      p_dbatch(1) TYPE c,
      p_dflag1(1) TYPE c,
      p_dflag2(1) TYPE c,
      p_dflag3(1) TYPE c,
      p_dflag4(1) TYPE c.
    SELECT-OPTIONS:
      s_dextwg FOR mara-extwg.
    SELECTION-SCREEN: END OF BLOCK matnr.
    SELECTION-SCREEN: BEGIN OF BLOCK bom WITH FRAME TITLE text-004.
    PARAMETERS:
      p_dbom LIKE filepath-pathintern DEFAULT 'Z_COMMAND_BOM_EXTRACT',
      p_fbom LIKE rlgrap-filename.
    p_bwerks LIKE mast-werks.          "Made a select-optoin JPC20061107
    SELECT-OPTIONS:
      s_bmatnr FOR MARA-MATNR,                                "JPC20061107
      s_bwerks FOR MAST-WERKS no-extension no intervals,      "JPC20061107
      s_bextwg FOR mara-extwg.
    SELECTION-SCREEN: END OF BLOCK bom.
    SELECTION-SCREEN: BEGIN OF BLOCK ccst WITH FRAME TITLE text-005.
    PARAMETERS:
      p_dccst LIKE filepath-pathintern
                   DEFAULT 'Z_COMMAND_CUST_STAT_EXTRACT',
      p_fccst LIKE rlgrap-filename,
      p_fccst2 LIKE rlgrap-filename,
      p_fccstl LIKE rlgrap-filename.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-007.
    PARAMETERS: p_csall RADIOBUTTON GROUP gp2.
    PARAMETERS: p_csdlt RADIOBUTTON GROUP gp2 DEFAULT 'X'.
    PARAMETERS: p_append RADIOBUTTON GROUP GP3 DEFAULT 'X', "Append files output to server for cust credit data ?
                p_owrite RADIOBUTTON GROUP GP3.
    SELECTION-SCREEN END OF BLOCK b.
    SELECT-OPTIONS:
      s_kunnr FOR kna1-kunnr.
    SELECTION-SCREEN: END OF BLOCK ccst.
    DATA: clsdir TYPE REF TO cl_gui_frontend_services.
    DATA: strfolder TYPE string.
    DATA: folderln TYPE i.
    DATA: gva_error(1) TYPE c VALUE ' '.
    Initial procedure on START ***************
    INITIALIZATION.
      p_fcust = 'CUST.prn'.
      p_fmatm = 'MATM.prn'.
      p_fmatp = 'MATP.prn'.
      p_fbom  = 'BOM.prn'.
      p_fccst = 'CCSTAT.prn'.
      p_fccst2 = 'CCSTATC.prn'.
      p_fccstl = 'CCSTATL.prn'.
      s_dextwg-option = 'BT'.
      s_dextwg-low = '1'.
      s_dextwg-high = '8'.
      APPEND s_dextwg.
      s_bextwg-option = 'BT'.
      s_bextwg-low = '1'.
      s_bextwg-high = '1'.
      APPEND s_bextwg.
    AT SELECTION-SCREEN.
      IF p_ccust EQ 'X' AND ( p_fcust IS INITIAL OR p_dcust IS INITIAL ).
        MESSAGE s000(zppu)
        WITH 'You must specify the file details for the customer data'.
        gva_error = 'X'.
      ENDIF.
      IF p_cmatm EQ 'X' AND ( p_fmatm IS INITIAL OR
                              p_fmatp IS INITIAL OR
                              p_dmatm IS INITIAL ).
        MESSAGE s001(zppu)
        WITH 'You must specify the file details for the material data'.
        gva_error = 'X'.
      ENDIF.
      IF p_cbom EQ 'X' AND ( p_fbom IS INITIAL OR p_dbom IS INITIAL ).
        MESSAGE s002(zppu)
        WITH 'You must specify the file details for the BOM data'.
        gva_error = 'X'.
      ENDIF.
      IF p_cbom EQ 'X'.
        IF s_bwerks-low is initial.
          MESSAGE s002(zppu)
            WITH 'You must specify a plant to run BOM extract for'.
          gva_error = 'X'.
        ENDIF.
        IF LINES( s_bwerks ) > 1.
          MESSAGE s002(zppu)
            WITH 'You can only specify 1 plant for BOM extract'.
          gva_error = 'X'.
        ENDIF.
      ENDIF.
      IF p_ccst EQ 'X' AND ( p_fccst IS INITIAL OR
                             p_fccst2 IS INITIAL OR
                             p_fccstl IS INITIAL OR
                             p_dccst IS INITIAL ).
        MESSAGE s002(zppu)
        WITH 'You must specify the file details for the customer'
             'status data'.
        gva_error = 'X'.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM user_command.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fcust.
      PERFORM get_gui_filename USING p_dcust p_fcust.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatm.
      PERFORM get_gui_filename USING p_dmatm p_fmatm.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatp.
      PERFORM get_gui_filename USING p_dmatm p_fmatp.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fbom.
      PERFORM get_gui_filename USING p_dbom p_fbom.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst.
      PERFORM get_gui_filename USING p_dccst p_fccst.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst2.
      PERFORM get_gui_filename USING p_dccst p_fccst2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccstl.
      PERFORM get_gui_filename USING p_dccst p_fccstl.
    END-OF-SELECTION.
    Data selection execution.
      DATA: lwa_kna1 TYPE kna1,
            lwa_knb1 TYPE knb1,
            lwa_knvv TYPE knvv.
      DATA: lwa_marc TYPE marc,
            lwa_mara TYPE marav,
            lwa_makt TYPE makt.
      DATA: lit_marav TYPE marav OCCURS 0.
      DATA: lit_customers TYPE it_ty_customers,
            lwa_customers TYPE ty_customers.
      DATA: lit_custstat  TYPE it_ty_custstat,
            lwa_custstat  TYPE ty_custstat.
      DATA: lit_materialm TYPE it_ty_materialm,
            lwa_materialm TYPE ty_materialm.
      DATA: lit_materialp TYPE it_ty_materialp,
            lwa_materialp TYPE ty_materialp.
    *(del)DATA: lwa_bomlist TYPE ty_bomlist,           "JPC20061107
    *(del)  lit_bomlist TYPE it_ty_bomlist.            "JPC20061107
      DATA: lwa_bom TYPE ty_bom_sapfmt,
            lit_bom TYPE it_ty_bom WITH HEADER LINE.   "JPC20061107
          lit_bom TYPE it_ty_bom.                    "JPC20061107
      DATA: output_file   TYPE string.
      DATA: lock_file     TYPE string.
      DATA: lva_mssage    TYPE string.
      DATA: lva_matnr(18) TYPE n.
      DATA: lva_date      TYPE datum.
      DATA: txtper(3)     TYPE c.
      DATA: custper       TYPE i.
      DATA: custcount     TYPE i.
      DATA: itemnum       TYPE i.
      CHECK gva_error <> 'X'.
      IF p_ccust EQ 'X'. " Do the customer file extract
        PERFORM extract_customer_details.
      ENDIF.
      IF p_cmatm EQ 'X'. " Do the Material file extract
        PERFORM extract_material_details.
      ENDIF.
      IF p_cbom EQ 'X'. " Do the BOM file extract
        PERFORM extract_bom_details.
      ENDIF.
      IF p_ccst EQ 'X'.  " Do the customer credit status file extract
        PERFORM extract_credit_status_details.
      ENDIF.
    *&      Form  extract_customer_details
          text
    -->  p1        text
    <--  p2        text
    FORM extract_customer_details.
      SELECT * FROM knb1
      INTO lwa_knb1
      WHERE bukrs = p_dcomp.
        MOVE-CORRESPONDING lwa_knb1 TO lwa_customers.
        MOVE-CORRESPONDING lwa_knb1 TO lwa_custstat.
        MOVE '#' TO lwa_custstat-company.
        MOVE p_dwerk TO lwa_customers-splant.
    WG1K903075: Start Delete---*
         move: '|' to lwa_customers-div1,
               '|' to lwa_customers-div2,
               '|' to lwa_customers-div3,
               '|' to lwa_customers-div4,
               '|' to lwa_customers-div5,
               '|' to lwa_customers-div6,
               '|' to lwa_customers-div7,
               '|' to lwa_customers-div8,
               '|' to lwa_customers-div9,
               '|' to lwa_customers-div10,
               '|' to lwa_customers-div11.
    WG1K903075: End Delete-----*
    WG1K903075: Start Insert---*
        MOVE: ' ' TO lwa_customers-div1,
              ' ' TO lwa_customers-div2,
              ' ' TO lwa_customers-div3,
              ' ' TO lwa_customers-div4,
              ' ' TO lwa_customers-div5,
              ' ' TO lwa_customers-div6,
              ' ' TO lwa_customers-div7,
              ' ' TO lwa_customers-div8,
              ' ' TO lwa_customers-div9,
              ' ' TO lwa_customers-div10,
              ' ' TO lwa_customers-div11.
    WG1K903075: End Insert-----*
        APPEND lwa_customers TO lit_customers.
        APPEND lwa_custstat TO lit_custstat.
      ENDSELECT.
      DESCRIBE TABLE lit_customers LINES custcount.
      LOOP AT lit_customers INTO lwa_customers.
        txtper = 100 * sy-tabix / custcount.
        custper = txtper.
        SELECT SINGLE * FROM kna1
        INTO lwa_kna1
        WHERE kunnr = lwa_customers-kunnr.
        MOVE-CORRESPONDING lwa_kna1 TO lwa_customers.
        lva_date = lwa_customers-erdat.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = lva_date
          IMPORTING
            date_external            = lwa_customers-erdat
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        REPLACE ALL OCCURRENCES OF '.'
        IN lwa_customers-erdat WITH '/'.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = lwa_customers-kunnr
          IMPORTING
            output = lwa_customers-kunnr.
        WRITE: lwa_customers-kunnr RIGHT-JUSTIFIED TO lwa_customers-kunnr.
        MODIFY lit_customers FROM lwa_customers.
    Percentage indicator display
        lva_mssage = 'Extracting customers'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = custper
            text       = lva_mssage.
      ENDLOOP.
      IF p_gui IS INITIAL.
        PERFORM get_file_path USING p_dcust p_fcust output_file.
        OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc EQ 0.
          LOOP AT lit_customers INTO lwa_customers.
            TRANSFER lwa_customers TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
      ELSE.
        MOVE p_fcust TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename = output_file
            filetype = 'ASC'
          TABLES
            data_tab = lit_customers
          EXCEPTIONS
            OTHERS   = 11.
      ENDIF.
      output_file = custcount.
      CONCATENATE
        output_file
        ' Customers extracted'
      INTO
        lva_mssage.
       message lva_mssage type 'I'.
    ENDFORM.                    " extract_customer_details
    *&      Form  extract_material_details
          text
    -->  p1        text
    <--  p2        text
    FORM extract_material_details.
       select maramatnr maramaktx
              maramatkl marcwerks
      SELECT *
      FROM marav AS mara
        INNER JOIN marc AS marc
          ON marc~matnr EQ mara~matnr
      INTO CORRESPONDING FIELDS OF lwa_mara
      WHERE marc~werks = p_dwerks
        AND mara~spras = 'EN'
        AND mara~extwg IN s_dextwg.
        MOVE-CORRESPONDING lwa_mara TO lwa_materialm.
        WRITE: lwa_mara-matnr TO lwa_materialm-matnr.
        MOVE: p_dflag1 TO lwa_materialm-flag1,
              p_dflag2 TO lwa_materialm-flag2,
              p_dflag3 TO lwa_materialm-flag3,
              p_dflag4 TO lwa_materialm-flag4.
        APPEND lwa_materialm TO lit_materialm.
      ENDSELECT.
      DESCRIBE TABLE lit_materialm LINES custcount.
      LOOP AT lit_materialm INTO lwa_materialm.
        txtper = 100 * sy-tabix / custcount.
        custper = txtper.
        CLEAR lwa_materialp.
        CLEAR lwa_mara.
        MOVE: lwa_materialm-matnr TO lwa_materialp-matnr,
              p_dwerks            TO lwa_materialp-werks,
              p_dbatch            TO lwa_materialp-batch.
        APPEND lwa_materialp TO lit_materialp.
        MOVE: lwa_materialm-matnr TO lva_matnr.
        MOVE: lva_matnr TO lwa_mara-matnr.
        SELECT SINGLE maktx FROM makt
        INTO lwa_materialm-maktx2
        WHERE matnr = lwa_mara-matnr
        AND spras = p_dspras.
        IF lwa_materialm-maktx2 IS INITIAL.
          lwa_materialm-maktx2 = lwa_materialm-maktx.
        ENDIF.
        MODIFY lit_materialm FROM lwa_materialm.
    Percentage indicator display
        lva_mssage = 'Extracting materials'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = custper
            text       = lva_mssage.
      ENDLOOP.
      IF p_gui IS INITIAL.
        PERFORM get_file_path USING p_dmatm p_fmatm output_file.
        OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc EQ 0.
          LOOP AT lit_materialm INTO lwa_materialm.
            TRANSFER lwa_materialm TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
      ELSE.
        MOVE p_fmatm TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = output_file
            filetype              = 'ASC'
            write_field_separator = ' '
          TABLES
            data_tab              = lit_materialm
          EXCEPTIONS
            OTHERS                = 11.
      ENDIF.
      IF p_gui IS INITIAL.
        PERFORM get_file_path USING p_dmatm p_fmatp output_file.
        OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc EQ 0.
          LOOP AT lit_materialp INTO lwa_materialp.
            TRANSFER lwa_materialp TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
      ELSE.
        MOVE p_fmatp TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = output_file
            filetype              = 'ASC'
            write_field_separator = ' '
          TABLES
            data_tab              = lit_materialp
          EXCEPTIONS
            OTHERS                = 11.
      ENDIF.
      REFRESH lit_materialm.
    ENDFORM.                    " extract_material_details
    *&      Form  extract_bom_details
          text
    -->  p1        text
    <--  p2        text
    FORM extract_bom_details.
    Lines below commented out and replaced with SELECT from ABAP Query run from
    transaction ZBOM.  Previously duplicate materials were selected. JPC20061107
    REFRESH lit_materialm.
    SELECT *
    FROM marav AS mara
       INNER JOIN marc AS marc
         ON marcmatnr EQ maramatnr
    INTO CORRESPONDING FIELDS OF lwa_mara
    WHERE marc~werks = p_bwerks
       AND mara~spras = 'EN'
       AND mara~extwg IN s_bextwg.
       APPEND lwa_mara TO lit_marav.
    ENDSELECT.
    DESCRIBE TABLE lit_marav LINES custcount.
    LOOP AT lit_marav INTO lwa_mara.
    Percentage indicator calculation
       txtper = 100 * sy-tabix / custcount.
       custper = txtper.
       SELECT
         mast~matnr
         mast~stlnr
         stpo~posnr
         stpo~idnrk
         stpo~menge
         stpo~meins
       FROM mast AS mast
         LEFT OUTER JOIN stpo AS stpo
           ON stpostlnr EQ maststlnr
    INTO lwa_bomlist
    WHERE mast~matnr = lwa_mara-matnr.
         CLEAR lwa_bom.
         MOVE-CORRESPONDING lwa_bomlist TO lwa_bom.
         WRITE: lwa_bomlist-matnr TO lwa_bom-matnr.
         IF lwa_bomlist-idnrk IS INITIAL.
           WRITE: 'BACKBIN' TO lwa_bom-idnrk.
         ELSE.
           WRITE: lwa_bomlist-idnrk TO lwa_bom-idnrk.
         ENDIF.
         MOVE: lwa_bomlist-posnr TO itemnum.
         WRITE: itemnum TO lwa_bom-posnr RIGHT-JUSTIFIED.
           write: lwa_bomlist-menge
           to lwa_bom-menge
           decimals 2.
         MOVE: p_bwerks TO lwa_bom-werks.
         APPEND lwa_bom TO lit_bom.
       ENDSELECT.
    Percentage indicator display
       lva_mssage = 'Extracting material B.O.Ms'.
       CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
           percentage = custper
           text       = lva_mssage.
    ENDLOOP.
      select MASTMATNR MASTWERKS STPOPOSNR STPOIDNRK STPOMENGE STPOMEINS            "JPC20061220
        select MAST~MATNR MAST~WERKS STPO~POSNR STPO~IDNRK STPO~MENGE STPO~MEINS STPO~POTX1 "JPC20061220
          into lwa_bom
          from ( MAST
               inner join STKO
               on  STKO~STLAL = MAST~STLAL
               and STKO~STLNR = MAST~STLNR
               and STKO~WRKAN = MAST~WERKS
               inner join MARA  as MARA_H
               on  MARA_H~MATNR = MAST~MATNR
               left outer join STAS
               on  STAS~STLAL = STKO~STLAL
               and STAS~STLNR = STKO~STLNR
               and STAS~STLTY = STKO~STLTY
               inner join STPO
               on  STPO~STLKN = STAS~STLKN
               and STPO~STLNR = STAS~STLNR
               and STPO~STLTY = STAS~STLTY
             inner join MARA                   JPC20061220
               left outer join MARA             "JPC20061220
               on  MARA~MATNR = STPO~IDNRK )
             where MARA_H~MATNR in s_bmatnr
               and MAST~WERKS   in s_bwerks
               and MARA_H~EXTWG in s_bextwg.
        clear lit_bom.
        WRITE lwa_bom-matnr TO lit_bom-matnr.
        MOVE  lwa_bom-werks TO lit_bom-werks.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = lwa_bom-posnr
          IMPORTING
            output = lit_bom-posnr.
        SHIFT lit_bom-posnr right deleting trailing space.
        IF lwa_bom-idnrk IS INITIAL.
        WRITE 'BACKBIN'     TO lit_bom-idnrk.               JPC20061220
          WRITE lwa_bom-potx1 TO lit_bom-idnrk.              "JPC20061220
        ELSE.
          WRITE lwa_bom-idnrk TO lit_bom-idnrk.
        ENDIF.
        MOVE: lwa_bom-menge TO lit_bom-menge,
              lwa_bom-meins TO lit_bom-meins.
        APPEND lit_bom.
      ENDSELECT.
      SORT lit_bom ascending.
    Ending for lines inserted for change 20061107
      IF p_gui IS INITIAL.  "write to server
        PERFORM get_file_path USING p_dbom p_fbom output_file.
        OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc EQ 0.
          custcount = lines( lit_bom ).
          LOOP AT lit_bom.
            txtper = 100 * sy-tabix / custcount.
            custper = txtper.
            lva_mssage = 'Extracting material B.O.Ms'.
            CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
              EXPORTING percentage = custper
                        text       = lva_mssage.
            TRANSFER lit_bom TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
      ELSE.
        MOVE p_fbom TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = output_file
            filetype              = 'ASC'
            write_field_separator = ' '
          TABLES
            data_tab              = lit_bom
          EXCEPTIONS
            OTHERS                = 11.
      ENDIF.
    ENDFORM.                    " extract_bom_details
    *&      Form  get_file_path
          text
         -->P_LOGICAL_PATH_NAME   text
         -->P_FILENAME            text
         -->P_FILENAME_WITH_PATH  text
    FORM get_file_path USING p_logical_path_name p_filename
                             p_filename_with_path.
      DATA: l_opsys TYPE sy-opsys,
            l_blank_filename TYPE c,
            l_filename TYPE string.
      IF p_gui IS INITIAL.
        MOVE 'WN32' TO l_opsys.
      ELSE.
        MOVE 'WN' TO l_opsys.
      ENDIF.
      IF p_filename IS INITIAL.
        MOVE 'XXX' TO l_filename.
        MOVE 'X' TO l_blank_filename.
      ELSE.
        MOVE p_filename TO l_filename.
      ENDIF.
      CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
        EXPORTING
          logical_path               = p_logical_path_name
          operating_system           = l_opsys
          file_name                  = l_filename
        IMPORTING
          file_name_with_path        = p_filename_with_path
        EXCEPTIONS
          path_not_found             = 1
          missing_parameter          = 2
          operating_system_not_found = 3
          file_system_not_found      = 4
          OTHERS                     = 5.
      IF NOT l_blank_filename IS INITIAL.
        REPLACE ALL OCCURRENCES OF 'XXX' IN p_filename_with_path WITH space.
      ENDIF.
    ENDFORM.                    "get_file_path
    *&      Form  value_request_p_fcust
          text
    -->  p1        text
    <--  p2        text
    FORM get_gui_filename USING p_path p_filename.
      DATA: l_fdir TYPE string.
      CHECK NOT p_gui IS INITIAL.
      PERFORM get_file_path USING p_path space
                                  l_fdir.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = l_fdir
          mask             = ',.prn,.prn.'
          title            = 'Select Excel file for download'
        IMPORTING
          filename         = p_filename
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
    ENDFORM.                    " value_request_p_fcust
    *&      Form  extract_credit_status_details
          text
    -->  p1        text
    <--  p2        text
    FORM extract_credit_status_details .
      DATA: lt_credit_stat   TYPE STANDARD TABLE OF zint_credit_stat,
            l_credit_stat    TYPE zint_credit_stat,
            l_current_stat1  TYPE zcrstat1,
            l_current_stat2  TYPE zcrstat2,
            l_current_reason TYPE zreason,
            lt_output_stat   TYPE STANDARD TABLE OF zint_credit_stat,
            l_output_stat    TYPE zint_credit_stat,
            lt_output1       TYPE STANDARD TABLE OF ty_cust_stat_output,
            lt_output2       TYPE STANDARD TABLE OF ty_cust_stat_output,
            l_output         TYPE ty_cust_stat_output.
      SELECT a~mandt a~kunnr a~name1 b~curstat1 b~curstat2 b~curtimestamp
             b~curreason b~prevstat1 b~prevstat2 b~prvtimestamp
             b~prevreason
        INTO TABLE lt_credit_stat
        FROM kna1 AS a
        LEFT OUTER JOIN zint_credit_stat AS b
        ON a~kunnr = b~kunnr
        WHERE a~kunnr IN s_kunnr.
      DESCRIBE TABLE lt_credit_stat LINES custcount.
      LOOP AT lt_credit_stat INTO l_credit_stat.
        txtper = 100 * sy-tabix / custcount.
        custper = txtper.
        PERFORM determine_current_status USING l_credit_stat-kunnr
                                               l_current_stat1
                                               l_current_stat2
                                               l_current_reason.
        IF NOT p_csdlt IS INITIAL.
        Only do delta download
          IF  l_current_stat1 NE l_credit_stat-curstat1 OR
              l_current_stat2 NE l_credit_stat-curstat2.
            PERFORM add_record_to_output TABLES lt_output_stat
                                         USING  l_current_stat1
                                                l_current_stat2
                                                l_current_reason
                                                l_credit_stat.
          ENDIF.
        ELSE.
        Download all records
          PERFORM add_record_to_output TABLES lt_output_stat
                                       USING  l_current_stat1
                                              l_current_stat2
                                              l_current_reason
                                              l_credit_stat.
        ENDIF.
      Percentage indicator display
        lva_mssage = 'Extracting customer status'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = custper
            text       = lva_mssage.
      ENDLOOP.
    Create output table
      LOOP AT lt_output_stat INTO l_output_stat.
        CLEAR l_output.
        WRITE l_output_stat-kunnr TO l_output-kunnr.
        SHIFT l_output-kunnr RIGHT DELETING TRAILING space.
        MOVE l_output_stat-curstat1 TO l_output-stat.
        APPEND l_output TO lt_output1.
        MOVE l_output_stat-curstat2 TO l_output-stat.
        APPEND l_output TO lt_output2.
      ENDLOOP.
      SORT lt_output1.
      SORT lt_output2.
      IF p_gui IS INITIAL.
      Lock File
        PERFORM get_file_path USING p_dccst p_fccstl lock_file.
      If the file already exists then abort processing
        OPEN DATASET lock_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 8.
          MESSAGE s002(zppu)
            WITH 'Lock file' lock_file 'already exists on server,'
                 'processing aborted'.
          LEAVE PROGRAM.
        ENDIF.
        OPEN DATASET lock_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
          MESSAGE s002(zppu)
            WITH 'Lock file' lock_file 'cannot be opened on the server,'
                 'processing aborted'.
          LEAVE PROGRAM.
        ENDIF.
      File 1
        PERFORM get_file_path USING p_dccst p_fccst output_file.
    If user requests cust status data to be appended use different OPEN
        IF p_append is initial.
          OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        ELSE.
          OPEN DATASET output_file FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
        ENDIF.
        IF sy-subrc EQ 0.
          LOOP AT lt_output1 INTO l_output.
            TRANSFER l_output TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
      File 2
        PERFORM get_file_path USING p_dccst p_fccst2 output_file.
    If user requests cust status data to be appended use different OPEN
        IF p_append is initial.
          OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        ELSE.
          OPEN DATASET output_file FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
        ENDIF.
        IF sy-subrc EQ 0.
          LOOP AT lt_output2 INTO l_output.
            TRANSFER l_output TO output_file.
          ENDLOOP.
          CLOSE DATASET output_file.
        ELSE.
          MESSAGE s002(zppu)
            WITH 'Dataset' output_file 'cannot be opened on the server'.
        ENDIF.
        DELETE DATASET lock_file.
      ELSE.
        MOVE p_fccst TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename = output_file
            filetype = 'ASC'
          TABLES
            data_tab = lt_output1
          EXCEPTIONS
            OTHERS   = 11.
        MOVE p_fccst2 TO output_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename = output_file
            filetype = 'ASC'
          TABLES
            data_tab = lt_output2
          EXCEPTIONS
            OTHERS   = 11.
      ENDIF.
      IF NOT p_svr IS INITIAL.
        PERFORM update_status_table TABLES lt_output_stat.
      ENDIF.
      output_file = custcount.
      CONCATENATE
        output_file
        ' Customers extracted'
      INTO
        lva_mssage.
    ENDFORM.                    " extract_credit_status_details
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    FORM user_command .
      LOOP AT SCREEN.
        IF screen-name EQ 'P_DCUST' OR
           screen-name EQ '%_P_DCUST_%_APP_%-TEXT' OR
           screen-name EQ 'P_DMATM' OR
           screen-name EQ '%_P_DMATM_%_APP_%-TEXT' OR
           screen-name EQ 'P_DBOM' OR
           screen-name EQ '%_P_DBOM_%_APP_%-TEXT' OR
           screen-name EQ 'P_DCCST' OR
           screen-name EQ '%_P_DCCST_%_APP_%-TEXT' OR
           screen-name EQ 'P_FCCSTL' OR
           screen-name EQ '%_P_FCCSTL_%_APP_%-TEXT'.
          IF p_gui IS INITIAL.
            screen-input = 1.
            screen-output = 1.
            screen-invisible = 0.
            screen-active = 1.
          ELSE.
            screen-input = 0.
            screen-output = 0.
            screen-invisible = 1.
            screen-active = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " user_command
    *&      Form  determine_current_status
          text
         -->P_L_CREDIT_STAT_KUNNR  text
         -->P_L_CURRENT_STAT1  text
         -->P_L_CURRENT_STAT2  text
    FORM determine_current_status USING p_kunnr p_stat1 p_stat2 p_reason.
      STATICS: lt_kna1 TYPE STANDARD TABLE OF ty_kna1_fields,
               lt_knb1 TYPE STANDARD TABLE OF ty_knb1_fields,
               lt_knvv TYPE STANDARD TABLE OF ty_knvv_fields,
               lt_knkk TYPE STANDARD TABLE OF ty_knkk_fields.
      DATA: l_kna1  TYPE ty_kna1_fields,
            l_knb1  TYPE ty_knb1_fields,
            l_knvv  TYPE ty_knvv_fields,
            l_knkk  TYPE ty_knkk_fields,
            l_faedt TYPE rfpos-faedt,
            l_days  TYPE p,
            l_used  TYPE rf02l-klprz.
      IF lt_kna1[] IS INITIAL.
        PERFORM load_kna1 TABLES lt_kna1.
      ENDIF.
      IF lt_knb1[] IS INITIAL.
        PERFORM load_knb1 TABLES lt_knb1.
      ENDIF.
      IF lt_knvv[] IS INITIAL.
        PERFORM load_knvv TABLES lt_knvv.
      ENDIF.
      IF lt_knkk[] IS INITIAL.
        PERFORM load_knkk TABLES lt_knkk.
      ENDIF.
      MOVE gc_status-acc TO p_stat1.
      MOVE gc_status-ok  TO p_stat2.
      MOVE gc_reason-000 TO p_reason.
    Customer Block/Unblock
      READ TABLE lt_kna1 INTO l_kna1 WITH KEY kunnr = p_kunnr BINARY SEARCH.
      IF sy-subrc EQ 0.
        IF NOT l_kna1-sperr IS INITIAL.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-001  TO p_reason.
        ENDIF.
        IF l_kna1-aufsd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-002  TO p_reason.
        ENDIF.
        IF l_kna1-lifsd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-003  TO p_reason.
        ENDIF.
        IF l_kna1-faksd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-004  TO p_reason.
        ENDIF.
        IF NOT l_kna1-loevm IS INITIAL.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-999  TO p_reason.
        ENDIF.
      ENDIF.
      CHECK p_stat1 NE gc_status-sto.
      LOOP AT lt_knb1 INTO l_knb1 WHERE kunnr EQ p_kunnr.
        IF NOT l_kna1-sperr IS INITIAL.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-005  TO p_reason.
        ENDIF.
        IF NOT l_knb1-loevm IS INITIAL.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-999  TO p_reason.
        ENDIF.
        IF p_stat1 EQ gc_status-sto.
          EXIT.
        ENDIF.
      ENDLOOP.
      CHECK p_stat1 NE gc_status-sto.
      LOOP AT lt_knvv INTO l_knvv WHERE kunnr EQ p_kunnr.
        IF l_knvv-aufsd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-006  TO p_reason.
        ENDIF.
        IF l_knvv-lifsd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-007  TO p_reason.
        ENDIF.
        IF l_knvv-faksd EQ '01'.
          MOVE gc_status-sto  TO p_stat1.
          MOVE gc_status-hold TO p_stat2.
          MOVE gc_reason-008  TO p_reason.
        ENDIF.
        IF p_stat1 EQ gc_status-sto.
          EXIT.
        ENDIF.
      ENDLOOP.
      CHECK p_stat1 NE gc_status-sto.
      READ TABLE lt_knkk INTO l_knkk WITH KEY kunnr = p_kunnr
                                              kkber = 'BP01'
                                     BINARY SEARCH.
      IF sy-subrc EQ 0.
      Exceeded Trading Terms
        IF l_knkk-ctlpc EQ 'Z03' OR
           l_knkk-ctlpc EQ 'Z04' OR
           l_knkk-ctlpc EQ 'Z05'.
          CALL FUNCTION 'CUSTOMER_OLDEST_OPEN_ITEM'
            EXPORTING
              i_kkber      = l_knkk-kkber
              i_kunnr      = l_knkk-kunnr
            IMPORTING
              e_faedt      = l_faedt
            EXCEPTIONS
              invalid_call = 1
              no_bukrs     = 2
              no_items     = 3
              OTHERS       = 4.
          IF sy-subrc EQ 0.
            l_days = sy-datum - l_faedt.
          ELSE.
            l_days = 0.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z03' AND l_knkk-crblb IS INITIAL AND
             l_days GT 45.
            MOVE gc_status-hol  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-021  TO p_reason.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z04' AND l_knkk-crblb IS INITIAL AND
             l_days GT 40.
            MOVE gc_status-hol  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-022  TO p_reason.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z05' AND l_knkk-crblb IS INITIAL AND
             l_days GT 30.
            MOVE gc_status-hol  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-023  TO p_reason.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z03' AND NOT l_knkk-crblb IS INITIAL AND
             l_days GT 45.
            MOVE gc_status-sto  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-024  TO p_reason.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z04' AND NOT l_knkk-crblb IS INITIAL AND
             l_days GT 40.
            MOVE gc_status-sto  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-025  TO p_reason.
          ENDIF.
          IF l_knkk-ctlpc EQ 'Z05' AND NOT l_knkk-crblb IS INITIAL AND
             l_days GT 30.
            MOVE gc_status-sto  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-026  TO p_reason.
          ENDIF.
          CHECK p_stat1 NE gc_status-sto.
      Exceeded Credit Limit Checks
          PERFORM get_credit_exposure USING l_knkk-knkli l_knkk-kkber
                                            l_knkk-ctlpc l_knkk-klimk
                                            l_knkk-skfor l_knkk-ssobl
                                            l_used.
          IF l_used GE 95 AND l_knkk-crblb IS INITIAL.
            MOVE gc_status-hol  TO p_stat1.
            MOVE gc_status-hold TO p_stat2.
            MOVE gc_reason-010  TO p_reason.
          ENDIF.
          IF l_used GE 95 AND NOT l_knkk-crblb IS INITIAL.
            MOVE gc_status-

    Yes thread closed
    Prioz

  • Performance(statspack) related problem

    Anybodyu can suggest me how to improve the database performance as many uiser are complaining that they are getting data very slow........
    i have also used statspack analyzer.......
    STATSPACK report for
    DB Name DB Id Instance Inst Num Release Cluster Host
    NEOSOFT 399087012 neosoft 1 9.2.0.7.0 NO APP
    Snap Id Snap Time Sessions Curs/Sess Comment
    Begin Snap: 1 16-May-08 10:20:15 435 2.2
    End Snap: 3 16-May-08 10:24:12 442 2.2
    Elapsed: 3.95 (mins)
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
    Buffer Cache: 352M Std Block Size: 8K
    Shared Pool Size: 200M Log Buffer: 1,024K
    Load Profile
    ~~~~~~~~~~~~ Per Second Per Transaction
    Redo size: 23,125.82 7,966.31
    Logical reads: 6,050.15 2,084.14
    Block changes: 96.53 33.25
    Physical reads: 1,103.40 380.10
    Physical writes: 16.60 5.72
    User calls: 189.40 65.24
    Parses: 29.92 10.31
    Hard parses: 8.69 2.99
    Sorts: 6.97 2.40
    Logons: 0.11 0.04
    Executes: 29.25 10.08
    Transactions: 2.90
    % Blocks changed per Read: 1.60 Recursive Call %: 31.70
    Rollback per transaction %: 0.29 Rows per Sort: 472.41
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 100.00 Redo NoWait %: 100.00
    Buffer Hit %: 82.01 In-memory Sort %: 99.21
    Library Hit %: 89.76 Soft Parse %: 70.95
    Execute to Parse %: -2.29 Latch Hit %: 99.95
    Parse CPU to Parse Elapsd %: 100.93 % Non-Parse CPU: 84.62
    Shared Pool Statistics Begin End
    Memory Usage %: 94.72 94.24
    % SQL with executions>1: 39.68 38.62
    % Memory for SQL w/exec>1: 39.34 38.76
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    db file scattered read 39,162 38 39.49
    CPU time 28 29.48
    db file sequential read 42,173 28 29.24
    direct path read 1,193 1 .59
    SQL*Net more data to client 31,629 1 .53
    Wait Events for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> s - second
    -> cs - centisecond - 100th of a second
    -> ms - millisecond - 1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
    Avg
    Total Wait wait Waits
    Event Waits Timeouts Time (s) (ms) /txn
    db file scattered read 39,162 0 38 1 56.9
    db file sequential read 42,173 0 28 1 61.3
    direct path read 1,193 0 1 0 1.7
    SQL*Net more data to client 31,629 0 1 0 46.0
    log file sync 683 0 0 0 1.0
    control file sequential read 184 0 0 1 0.3
    db file parallel write 61 0 0 1 0.1
    control file parallel write 78 0 0 0 0.1
    log file parallel write 732 0 0 0 1.1
    direct path write 30 0 0 0 0.0
    SQL*Net break/reset to clien 10 0 0 0 0.0
    LGWR wait for redo copy 3 0 0 0 0.0
    SQL*Net message from client 44,675 0 577 13 64.9
    virtual circuit status 47,524 4 145 3 69.1
    SQL*Net message to client 44,674 0 0 0 64.9
    SQL*Net more data from clien 260 0 0 0 0.4
    Background Wait Events for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> ordered by wait time desc, waits desc (idle events last)
    Avg
    Total Wait wait Waits
    Event Waits Timeouts Time (s) (ms) /txn
    control file sequential read 80 0 0 2 0.1
    db file parallel write 61 0 0 1 0.1
    control file parallel write 78 0 0 0 0.1
    log file parallel write 732 0 0 0 1.1
    LGWR wait for redo copy 3 0 0 0 0.0
    rdbms ipc message 993 242 2,054 2069 1.4
    pmon timer 79 79 234 2962 0.1
    smon timer 13 0 228 17520 0.0
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    92,160 36 2,560.0 6.4 0.41 0.37 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    75,042 33 2,274.0 5.2 0.23 0.29 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    68,310 27 2,530.0 4.8 0.27 0.27 2037438344
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    48,617 31 1,568.3 3.4 0.16 0.22 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    45,060 20 2,253.0 3.1 0.17 0.18 3400961035
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    42,976 17 2,528.0 3.0 0.14 0.17 3744553745
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36,114 78 463.0 2.5 0.13 0.11 4262998487
    Module: In Patient 2.1.152.exe
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    25,102 11 2,282.0 1.8 0.06 0.10 812077776
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    24,984 36 694.0 1.7 0.09 0.07 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    23,213 1 23,213.0 1.6 1.59 2.83 2435229694
    Module: SQL*Plus
    BEGIN statspack.snap(i_snap_level=>7); END;
    22,930 10 2,293.0 1.6 0.14 0.09 3466778893
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    22,680 10 2,268.0 1.6 0.08 0.09 3786189544
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    20,340 9 2,260.0 1.4 0.13 0.08 3649693145
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    19,460 42 463.3 1.4 0.09 0.06 3858576624
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    8,084 4 2,021.0 3.1 0.14 1.08 4198744706
    Module: Out Patient 2.1.41.exe
    Select Max(BillNo) as Bno From PatientsRegistration Where regdt
    = to_date('01/04/2008','dd/mm/yyyy') and regdt <= to_date('31/03/2009','dd/mm/yyyy')
    7,302 1 7,302.0 2.8 0.13 0.51 2116660478
    Module: In Patient 2.1.157.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09212'
    7,302 1 7,302.0 2.8 0.06 0.41 3612969128
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09037'
    7,302 1 7,302.0 2.8 0.19 0.51 3981413559
    Module: In Patient 2.1.152.exe
    sELECT * FROM BillPharmacy WHERE BillPharmacy.pATIENtid= 'PAT090
    37' order by to_number((issueno))
    7,300 1 7,300.0 2.8 0.14 0.69 136284863
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09037'
    7,299 1 7,299.0 2.8 0.20 0.77 2137420337
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09154'
    7,298 1 7,298.0 2.8 0.13 0.43 1007690124
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T08301'
    7,298 1 7,298.0 2.8 0.13 0.58 3087447381
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09154'
    7,061 1 7,061.0 2.7 0.13 0.97 2993688253
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09146'
    7,058 1 7,058.0 2.7 0.39 0.76 1202603169
    Module: In Patient 2.1.152.exe
    SELECT BILLHDR.BILLNO, BILLHDR.BILLDT, BILLHDR.BALANCE, BILLHDR.
    TOTAL, BILLHDR.NETAMOUNT,IPINFO.type as orgtype, BILLHDR.PREVAD
    V , IPInfo.IpNO, IPInfo.REGDT,IPInfo.REGTM, IPInfo.Name, IPInfo.
    ADDRESS1,IPINFO.relativenm ,Rooms.roomno , Beds.BEDNO, ROOMTYPES
    , decode(IPINFO.sex,1,'Male','Female')sex,IPINFO.AGE ||' '||dec
    6,640 1 6,640.0 2.5 0.13 1.06 796742944
    Module: In Patient 2.1.152.exe
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    select discount,discamount from billpharmacy where patientid='PA
    T09123'
    4,617 4 1,154.3 1.8 0.19 0.94 2042905630
    Module: Out Patient 2.1.41.exe
    SELECT NVL(Max(MoneyReciept.mrBillNo),0) AS MaxOfBillNob FROM Mo
    neyReciept where generalopd = 0
    4,496 3 1,498.7 1.7 0.06 0.57 2718453880
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208970TS000002' order by trackdate,tracktime
    4,494 3 1,498.0 1.7 0.13 0.74 3290276624
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R207032T0000351' order by trackdate,tracktime
    4,451 3 1,483.7 1.7 0.20 0.99 768943678
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208613TS000002' order by trackdate,tracktime
    4,091 4 1,022.8 1.6 0.19 1.62 266509601
    Module: In Patient 2.1.152.exe
    SELECT IPInfo.IPNo ,IPInfo.name,doctorvisit.date_r ,unithdr.drna
    me , doctorvisit.visitid FROM Doctorvisit , IPInfo,unithdr wher
    e Doctorvisit.Patid = IPInfo.PatID and Doctorvisit.doctorid=unit
    hdr.unitid and doctorvisit.date_r >=to_date('06/05/2008','fmdd/m
    m/yyyy') order by IPInfo.IPNo
    3,933 5 786.6 1.5 0.14 1.29 2546712787
    Module: Diagnotech 2.2.49.exe
    Select max(BillNo) as Bno From MoneyReciept where rcdt >= to_dat
    e('01/04/2008','dd/mm/yyyy') and rcdt <= to_date('31/03/2009','d
    d/mm/yyyy')
    3,439 3 1,146.3 1.3 0.25 1.89 2816864569
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R207242T0000104' order by trackdate,tracktime
    3,129 2 1,564.5 1.2 0.06 0.88 1803349496
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208962TS000002' order by trackdate,tracktime
    3,065 4 766.3 1.2 0.17 1.30 54282346
    Module: In Patient 2.1.157.exe
    Select * from track where tablenm = 'FRMDOCTORVISIT' and primkey
    id = 'VI048354' order by trackdate,tracktime
    2,834 3 944.7 1.1 0.17 1.57 165470279
    Module: Diagnotech 2.2.49.exe
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208926TS000002' order by trackdate,tracktime
    2,769 3 923.0 1.1 0.13 1.28 3812904405
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208892TS000002' order by trackdate,tracktime
    2,730 3 910.0 1.0 0.19 1.21 680462328
    Module: In Patient 2.1.157.exe
    select * from DoctorVisit where Date_r >= to_date('06/05/2008','
    dd/mm/yyyy') and Date_r <= to_date('16/05/2008','dd/mm/yyyy')
    2,526 2 1,263.0 1.0 0.58 1.14 4043595143
    Module: SQL*Plus
    INSERT INTO STATS$SQL_SUMMARY ( SNAP_ID , DBID , INSTANCE_NUMBER
    , TEXT_SUBSET , SHARABLE_MEM , SORTS , MODULE , LOADED_VERSIONS
    , FETCHES , EXECUTIONS , LOADS , INVALIDATIONS , PARSE_CALLS ,
    DISK_READS , BUFFER_GETS , ROWS_PROCESSED , COMMAND_TYPE , ADDRE
    SS , HASH_VALUE , VERSION_COUNT , CPU_TIME , ELAPSED_TIME , OUTL
    2,484 1 2,484.0 0.9 0.19 0.91 33028691
    Module: Diagnotech 2.2.49.exe
    select * from requisitions where upper(reqno) = '180800'
    2,483 1 2,483.0 0.9 0.13 0.93 2943168498
    Module: Diagnotech 2.2.49.exe
    Update Requisitions Set Collected = 0 Where TRIM(ReqID) ='R20987
    8'
    2,482 1 2,482.0 0.9 0.11 0.74 2336722822
    Module: Diagnotech 2.2.49.exe
    Update Requisitions Set Collected = 0 Where TRIM(ReqID) ='R20987
    7'
    2,480 1 2,480.0 0.9 0.06 0.67 650704065
    Module: In Patient 2.1.152.exe
    select sum(can.returnamt) refamt from diagnotech.cancellationhd
    r can,diagnotech.requisitions req where can.reqid = req.reqid an
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    283 283 1.0 0.00 0.00 1283498366
    Module: Diagnotech 2.2.49.exe
    Select to_char(sysdate,'fmdd/mm/yyyy HH24:mi:ss am') as abc from
    OPTIONS
    238 76 0.3 0.00 0.00 4274598960
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, tim
    estamp#, sample_size, minimum, maximum, distcnt, lowval, hival,
    density, col#, spare1, spare2, avgcln from hist_head$ where obj#
    =:1 and intcol#=:2
    126 126 1.0 0.00 0.00 2168100061
    Module: Diagnotech 2.2.49.exe
    select * from departments where deptid = 'DEP00004'
    114 0 0.0 0.00 0.00 4073347083
    select grantor#, grantee#, privilege#, sequence#, nvl(option$,0)
    from objauth$ where obj#=:1 and col#=:2
    112 112 1.0 0.00 0.00 3687727603
    insert into col$(obj#,name,intcol#,segcol#,type#,length,precisio
    n#,scale,null$,offset,fixedstorage,segcollength,deflength,defaul
    t$,col#,property,charsetid,charsetform,spare1,spare2,spare3)valu
    es(:1,:2,:3,:4,:5,:6,decode(:7,0,null,:7),decode(:5,2,decode(:8,
    -127/*MAXSB1MINAL*/,null,:8),178,:8,179,:8,180,:8,181,:8,182,:8,
    99 99 1.0 0.00 0.00 3468666020
    select text from view$ where rowid=:1
    84 84 1.0 0.00 0.00 2997854589
    insert into access$(d_obj#,order#,columns,types) values (:1,:2,:
    3,:4)
    84 84 1.0 0.00 0.00 3951809012
    insert into dependency$(d_obj#,d_timestamp,order#,p_obj#,p_times
    tamp,d_owner#, property)values (:1,:2,:3,:4,:5,:6, :7)
    78 0 0.0 0.00 0.00 3867936055
    Module: Out Patient 2.1.41.exe
    commit
    78 78 1.0 0.00 0.00 4262998487
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    44 44 1.0 0.00 0.00 3216099004
    Module: Diagnotech 2.2.49.exe
    select * from options
    42 42 1.0 0.00 0.00 3858576624
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'IPINFO' escape '\'
    36 540 15.0 0.01 0.01 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36 36 1.0 0.00 0.00 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    34 34 1.0 0.00 0.00 857250417
    Module: Diagnotech 2.2.46.exe
    select * from departments where deptid = 'DEP00031'
    33 43,442 1,316.4 0.04 0.05 502973950
    Module: Pharmacy 2.0.174.exe
    SELECT substr(UPPER(MedMast.MedNm),1,50) MedNm , MedSubCat.MSCOD
    E ,MEDMAST.POTENCY ,substr(genericnm,1,50) genericnm, sum(dmeddt
    ls.currqty) stock, MedMast.medid FROM MedMast , MedSubCat,dmedd
    tls where UPPER(MEDMAST.MEDNM) LIKE '%%' and medmast.medid = d
    meddtls.medid and MEDMAST.SubCatID = MedSubCat.MSCatID and dmed
    33 132 4.0 0.01 0.01 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 124 4.0 0.01 0.01 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 1.0 0.00 0.00 3993731530
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'OTS1' escape '\' and ac.table_name like 'DOCTORINFO' escape
    28 28 1.0 0.00 0.00 737183288
    Module: Diagnotech 2.2.49.exe
    Select * From CReqno
    27 0 0.0 0.00 0.00 246231567
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    283 283 3.99 1283498366
    Module: Diagnotech 2.2.49.exe
    Select to_char(sysdate,'fmdd/mm/yyyy HH24:mi:ss am') as abc from
    OPTIONS
    126 126 1.78 2168100061
    Module: Diagnotech 2.2.49.exe
    select * from departments where deptid = 'DEP00004'
    99 99 1.40 3468666020
    select text from view$ where rowid=:1
    78 78 1.10 3867936055
    Module: Out Patient 2.1.41.exe
    commit
    78 78 1.10 4262998487
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    44 44 0.62 3216099004
    Module: Diagnotech 2.2.49.exe
    select * from options
    42 42 0.59 3858576624
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'IPINFO' escape '\'
    36 36 0.51 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36 36 0.51 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    34 34 0.48 857250417
    Module: Diagnotech 2.2.46.exe
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    select * from departments where deptid = 'DEP00031'
    33 33 0.47 502973950
    Module: Pharmacy 2.0.174.exe
    SELECT substr(UPPER(MedMast.MedNm),1,50) MedNm , MedSubCat.MSCOD
    E ,MEDMAST.POTENCY ,substr(genericnm,1,50) genericnm, sum(dmeddt
    ls.currqty) stock, MedMast.medid FROM MedMast , MedSubCat,dmedd
    tls where UPPER(MEDMAST.MEDNM) LIKE '%%' and medmast.medid = d
    meddtls.medid and MEDMAST.SubCatID = MedSubCat.MSCatID and dmed
    33 33 0.47 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 0.44 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 0.44 3993731530
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'OTS1' escape '\' and ac.table_name like 'DOCTORINFO' escape
    30 15 0.42 3067006941
    delete from dependency$ where d_obj#=:1
    28 28 0.39 737183288
    Module: Diagnotech 2.2.49.exe
    Select * From CReqno
    27 27 0.38 246231567
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DISSUEDTLSP' e
    27 27 0.38 445844524
    Module: In Patient 2.1.152.exe
    select nvl(tarrifflg,0) as tf from sourcehdr where sourceid = ''
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    27 27 0.38 2037438344
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    22 22 0.31 3073477137
    select u.name,o.name, t.update$, t.insert$, t.delete$, t.enabled
    from obj$ o,user$ u,trigger$ t where t.baseobject=:1 and t.ob
    j#=o.obj# and o.owner#=u.user# order by o.obj#
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    CPU used by this session 2,821 11.9 4.1
    CPU used when call started 2,826 11.9 4.1
    CR blocks created 15 0.1 0.0
    DBWR buffers scanned 5,873 24.8 8.5
    DBWR checkpoint buffers written 167 0.7 0.2
    DBWR checkpoints 0 0.0 0.0
    DBWR free buffers found 5,653 23.9 8.2
    DBWR lru scans 17 0.1 0.0
    DBWR make free requests 17 0.1 0.0
    DBWR summed scan depth 5,873 24.8 8.5
    DBWR transaction table writes 1 0.0 0.0
    DBWR undo block writes 228 1.0 0.3
    SQL*Net roundtrips to/from client 89,026 375.6 129.4
    active txn count during cleanout 156 0.7 0.2
    background checkpoints completed 0 0.0 0.0
    background checkpoints started 0 0.0 0.0
    background timeouts 243 1.0 0.4
    branch node splits 0 0.0 0.0
    buffer is not pinned count 1,225,066 5,169.1 1,780.6
    buffer is pinned count 1,069,472 4,512.5 1,554.5
    bytes received via SQL*Net from c 4,334,045 18,287.1 6,299.5
    bytes sent via SQL*Net to client 79,310,906 334,645.2 115,277.5
    calls to get snapshot scn: kcmgss 14,976 63.2 21.8
    calls to kcmgas 942 4.0 1.4
    calls to kcmgcs 166 0.7 0.2
    change write time 19 0.1 0.0
    cleanout - number of ktugct calls 182 0.8 0.3
    cleanouts and rollbacks - consist 5 0.0 0.0
    cleanouts only - consistent read 18 0.1 0.0
    cluster key scan block gets 206,010 869.2 299.4
    cluster key scans 81,803 345.2 118.9
    commit cleanout failures: block l 0 0.0 0.0
    commit cleanout failures: callbac 11 0.1 0.0
    commit cleanout failures: cannot 0 0.0 0.0
    commit cleanouts 2,731 11.5 4.0
    commit cleanouts successfully com 2,720 11.5 4.0
    commit txn count during cleanout 87 0.4 0.1
    consistent changes 15 0.1 0.0
    consistent gets 1,412,564 5,960.2 2,053.2
    consistent gets - examination 572,440 2,415.4 832.0
    cursor authentications 531 2.2 0.8
    data blocks consistent reads - un 15 0.1 0.0
    db block changes 22,877 96.5 33.3
    db block gets 21,323 90.0 31.0
    deferred (CURRENT) block cleanout 1,548 6.5 2.3
    dirty buffers inspected 19 0.1 0.0
    enqueue conversions 52 0.2 0.1
    enqueue releases 4,639 19.6 6.7
    enqueue requests 4,640 19.6 6.7
    enqueue timeouts 0 0.0 0.0
    enqueue waits 0 0.0 0.0
    execute count 6,932 29.3 10.1
    free buffer inspected 19 0.1 0.0
    free buffer requested 258,870 1,092.3 376.3
    hot buffers moved to head of LRU 2,520 10.6 3.7
    immediate (CR) block cleanout app 23 0.1 0.0
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    immediate (CURRENT) block cleanou 502 2.1 0.7
    index fast full scans (full) 163 0.7 0.2
    index fetch by key 380,673 1,606.2 553.3
    index scans kdiixs1 86,708 365.9 126.0
    leaf node 90-10 splits 22 0.1 0.0
    leaf node splits 64 0.3 0.1
    logons cumulative 25 0.1 0.0
    messages received 806 3.4 1.2
    messages sent 806 3.4 1.2
    no buffer to keep pinned count 0 0.0 0.0
    no work - consistent read gets 779,017 3,287.0 1,132.3
    opened cursors cumulative 7,669 32.4 11.2
    parse count (failures) 2 0.0 0.0
    parse count (hard) 2,060 8.7 3.0
    parse count (total) 7,091 29.9 10.3
    parse time cpu 434 1.8 0.6
    parse time elapsed 430 1.8 0.6
    physical reads 261,506 1,103.4 380.1
    physical reads direct 3,529 14.9 5.1
    physical writes 3,935 16.6 5.7
    physical writes direct 3,529 14.9 5.1
    physical writes non checkpoint 3,839 16.2 5.6
    pinned buffers inspected 0 0.0 0.0
    prefetched blocks 175,966 742.5 255.8
    prefetched blocks aged out before 0 0.0 0.0
    process last non-idle time 270 1.1 0.4
    recovery blocks read 0 0.0 0.0
    recursive calls 20,832 87.9 30.3
    recursive cpu usage 296 1.3 0.4
    redo blocks written 11,309 47.7 16.4
    redo buffer allocation retries 0 0.0 0.0
    redo entries 12,097 51.0 17.6
    redo log space requests 0 0.0 0.0
    redo log space wait time 0 0.0 0.0
    redo ordering marks 1 0.0 0.0
    redo size 5,480,820 23,125.8 7,966.3
    redo synch time 30 0.1 0.0
    redo synch writes 689 2.9 1.0
    redo wastage 160,348 676.6 233.1
    redo write time 29 0.1 0.0
    redo writer latching time 0 0.0 0.0
    redo writes 732 3.1 1.1
    rollback changes - undo records a 2 0.0 0.0
    rollbacks only - consistent read 10 0.0 0.0
    rows fetched via callback 235,269 992.7 342.0
    session connect time 0 0.0 0.0
    session logical reads 1,433,886 6,050.2 2,084.1
    session pga memory 45,074,044 190,185.8 65,514.6
    session pga memory max 49,946,024 210,742.7 72,596.0
    session uga memory max 3,455,708 14,581.1 5,022.8
    shared hash latch upgrades - no w 54,598 230.4 79.4
    shared hash latch upgrades - wait 0 0.0 0.0
    sorts (disk) 13 0.1 0.0
    sorts (memory) 1,639 6.9 2.4
    sorts (rows) 780,425 3,292.9 1,134.3
    summed dirty queue length 239 1.0 0.4
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    switch current to new buffer 172 0.7 0.3
    table fetch by rowid 612,799 2,585.7 890.7
    table fetch continued row 626 2.6 0.9
    table scan blocks gotten 459,367 1,938.3 667.7
    table scan rows gotten 18,523,828 78,159.6 26,924.2
    table scans (long tables) 128 0.5 0.2
    table scans (short tables) 1,655 7.0 2.4
    transaction rollbacks 1 0.0 0.0
    transaction tables consistent rea 0 0.0 0.0
    transaction tables consistent rea 0 0.0 0.0
    user calls 44,888 189.4 65.2
    user commits 686 2.9 1.0
    user rollbacks 2 0.0 0.0
    workarea executions - multipass 0 0.0 0.0
    workarea executions - onepass 24 0.1 0.0
    workarea executions - optimal 2,433 10.3 3.5
    write clones created in foregroun 0 0.0 0.0
    Tablespace IO Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->ordered by IOs (Reads + Writes) desc
    Tablespace
    Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    DIAGNOTECH
    61,945 261 0.7 1.9 64 0 0 0.0
    IP
    10,753 45 1.2 9.5 23 0 0 0.0
    SYSTEM
    5,668 24 1.2 3.2 22 0 0 0.0
    OTS1
    2,456 10 1.5 7.8 19 0 0 0.0
    TEMP
    1,429 6 0.6 2.5 739 3 0 0.0
    INVENTORY
    478 2 3.5 1.3 49 0 0 0.0
    UNDOTBS1
    0 0 0.0 229 1 0 0.0
    INDX
    15 0 2.0 1.0 0 0 0 0.0
    PAYROLL
    1 0 20.0 4.0 0 0 0 0.0
    File IO Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->ordered by Tablespace, File
    Tablespace Filename
    Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    DIAGNOTECH F:\ORACLE\ORADATA\NEOSOFT\DIAGNOTECH1.ORA
    61,945 261 0.7 1.9 64 0 0
    INDX F:\ORACLE\ORADATA\NEOSOFT\INDX01.DBF
    15 0 2.0 1.0 0 0 0
    INVENTORY F:\ORACLE\ORADATA\NEOSOFT\INVENTORY1.ORA
    478 2 3.5 1.3 49 0 0
    IP F:\ORACLE\ORADATA\NEOSOFT\IP1.ORA
    10,753 45 1.2 9.5 23 0 0
    OTS1 F:\ORACLE\ORADATA\NEOSOFT\OTS11.ORA
    2,456 10 1.5 7.8 19 0 0
    PAYROLL F:\ORACLE\ORADATA\NEOSOFT\PAYROLL1.ORA
    1 0 20.0 4.0 0 0 0
    SYSTEM F:\ORACLE\ORADATA\NEOSOFT\SYSTEM01.DBF
    5,668 24 1.2 3.2 22 0 0
    TEMP F:\ORACLE\ORADATA\NEOSOFT\TEMP01.DBF
    1,429 6 0.6 2.5 739 3 0
    UNDOTBS1 F:\ORACLE\ORADATA\NEOSOFT\UNDOTBS01.DBF
    0 0 229 1 0
    Buffer Pool Statistics for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Standard block size Pools D: default, K: keep, R: recycle
    -> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k
    Free Write Buffer
    Number of Cache Buffer Physical Physical Buffer Complete Busy
    P Buffers Hit % Gets Reads Writes Waits Waits Waits
    D 44,044 82.0 1,432,475 257,328 406 0 0 0
    Instance Recovery Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> B: Begin snapshot, E: End snapshot
    Targt Estd Log File Log Ckpt Log Ckpt
    MTTR MTTR Recovery Actual Target Size Timeout Interval
    (s) (s) Estd IOs Redo Blks Redo Blks Redo Blks Redo Blks Redo Blks
    B 87 19 3628 65684 64450 184320 64450
    E 87 20 4063 69805 69805 184320 69805
    Buffer Pool Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> Only rows with estimated physical reads >0 are displayed
    -> ordered by Block Size, Buffers For Estimate (default block size first)
    Size for Size Buffers for Est Physical Estimated
    P Estimate (M) Factr Estimate Read Factor Physical Reads
    D 32 .1 4,004 67.25 19,260,129,810
    D 64 .2 8,008 42.95 12,300,910,895
    D 96 .3 12,012 32.00 9,165,118,680
    D 128 .4 16,016 25.62 7,338,010,607
    D 160 .5 20,020 17.54 5,022,366,182
    D 192 .5 24,024 11.74 3,361,228,965
    D 224 .6 28,028 7.05 2,020,169,694
    D 256 .7 32,032 3.94 1,127,930,012
    D 288 .8 36,036 2.32 663,835,521
    D 320 .9 40,040 1.44 413,674,540
    D 352 1.0 44,044 1.00 286,377,525
    D 384 1.1 48,048 0.75 215,831,108
    D 416 1.2 52,052 0.60 171,670,371
    D 448 1.3 56,056 0.51 145,708,247
    D 480 1.4 60,060 0.45 128,439,943
    D 512 1.5 64,064 0.40 114,053,332
    D 544 1.5 68,068 0.37 104,584,674
    D 576 1.6 72,072 0.34 96,792,591
    D 608 1.7 76,076 0.32 92,596,531
    D 640 1.8 80,080 0.31 89,929,979
    PGA Aggr Target Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> B: Begin snap E: End snap (rows dentified with B or E contain data
    which is absolute i.e. not diffed over the interval)
    -> PGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory
    -> Auto PGA Target - actual workarea memory target
    -> W/A PGA Used - amount of memory used for all Workareas (manual + auto)
    -> %PGA W/A Mem - percentage of PGA memory allocated to workareas
    -> %Auto W/A Mem - percentage of workarea memory controlled by Auto Mem Mgmt
    -> %Man W/A Mem - percentage of workarea memory under manual control
    PGA Cache Hit % W/A MB Processed Extra W/A MB Read/Written
    88.2 213 29
    %PGA %Auto %Man
    PGA Aggr Auto PGA PGA Mem W/A PGA W/A W/A W/A Global Mem
    Target(M) Target(M) Alloc(M) Used(M) Mem Mem Mem Bound(K)
    B 24 7 24.4 0.4 1.6 .0 100.0 1,228
    E 24 8 23.8 0.0 .0 .0 .0 1,228
    PGA Aggr Target Histogram for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Optimal Executions are purely in-memory operations
    Low High
    Optimal Optimal Total Execs Optimal Execs 1-Pass Execs M-Pass Execs
    8K 16K 2,000 2,000 0 0
    16K 32K 55 55 0 0
    32K 64K 28 28 0 0
    64K 128K 50 50 0 0
    128K 256K 110 110 0 0
    256K 512K 26 26 0 0
    512K 1024K 176 158 18 0
    1M 2M 8 4 4 0
    4M 8M 2 0 2 0
    PGA Memory Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value
    where Estd PGA Overalloc Count is 0
    Estd Extra Estd PGA Estd PGA
    PGA Target Size W/A MB W/A MB Read/ Cache Overalloc
    Est (MB) Factr Processed Written to Disk Hit % Count
    12 0.5 417.1 207.2 67.0 1
    18 0.8 417.1 89.3 82.0 0
    24 1.0 417.1 46.4 90.0 0
    29 1.2 417.1 46.4 90.0 0
    34 1.4 417.1 46.4 90.0 0
    38 1.6 417.1 13.2 97.0 0
    43 1.8 417.1 11.1 97.0 0
    48 2.0 417.1 11.1 97.0 0
    72 3.0 417.1 11.1 97.0 0
    96 4.0 417.1 11.1 97.0 0
    144 6.0 417.1 0.0 100.0 0
    192 8.0 417.1 0.0 100.0 0
    Rollback Segment Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->A high value for "Pct Waits" suggests more rollback segments may be required
    ->RBS stats may not be accurate between begin and end snaps when using Auto Undo
    managment, as RBS may be dynamically created and dropped as needed
    Trans Table Pct Undo Bytes
    RBS No Gets Waits Written Wraps Shrinks Extends
    0 15.0 0.00 0 0 0 0
    1 412.0 0.00 831,990 1 0 1
    2 48.0 0.00 61,500 0 0 0
    3 87.0 0.00 132,404 0 0 0
    4 79.0 0.00 66,626 0 0 0
    5 71.0 0.00 91,284 0 0 0
    6 40.0 0.00 15,474 0 0 0
    7 660.0 0.00 547,536 1 0 1
    8 168.0 0.00 21,762 0 0 0
    9 86.0 0.00 10,108 0 0 0
    10 295.0 0.00 156,468 0 0 0
    Rollback Segment Storage for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->Optimal Size should be larger than Avg Active
    RBS No Segment Size Avg Active Optimal Size Maximum Size
    0 385,024 0 385,024
    1 9,625,600 806,999 16,900,096
    2 5,365,760 711,094 8,511,488
    3 5,365,760 664,381 9,560,064
    4 5,365,760 763,735 8,511,488
    5 5,365,760 672,648 9,625,600
    6 5,365,760 677,906 9,560,064
    7 6,414,336 647,093 8,511,488
    8 5,365,760 628,652 10,608,640
    9 5,365,760 769,325 9,560,064
    10 5,365,760 622,015 9,560,064
    Undo Segment Summary for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Undo segment block stats:
    -> uS - unexpired Stolen, uR - unexpired Released, uU - unexpired reUsed
    -> eS - expired Stolen, eR - expired Released, eU - expired reUsed
    Undo Undo Num Max Qry Max Tx Snapshot Out of uS/uR/uU/
    TS# Blocks Trans Len (s) Concurcy Too Old Space eS/eR/eU
    1 695 1,032,965 12 1 0 0 0/0/0/0/0/0
    Undo Segment Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> ordered by Time desc
    Undo Num Max Qry Max Tx Snap Out of uS/uR/uU/
    End Time Blocks Trans Len (s) Concy Too Old Space eS/eR/eU
    16-May 10:22 695 ######## 12 1 0 0 0/0/0/0/0/0
    Latch Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
    willing-to-wait latch get requests
    ->"NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests
    ->"Pct Misses" for both should be very close to 0.0
    Pct Avg Wait Pct
    Get Get Slps Time NoWait NoWait
    Latch Requests Miss /Miss (s) Requests Miss
    Consistent RBA 732 0.0 0 0
    FAL request queue 1 0.0 0 0
    FIB s.o chain latch 12 0.0 0 0
    FOB s.o list latch 27 0.0 0 0
    SQL memory manager latch 2 0.0 0 79 0.0
    SQL memory manager worka 7,245 0.0 0 0
    active checkpoint queue 169 0.0 0 0
    archive control 10 0.0 0 0
    archive process latch 7 0.0 0 0
    cache buffer handles 12,078 0.0 0 0
    cache buffers chains 2,602,999 0.0 0.0 0 506,781 0.0
    cache buffers lru chain 858 0.0 0 615,593 0.0
    channel handle pool latc 37 0.0 0 0
    channel operations paren 265 0.0 0 0
    checkpoint queue latch 30,545 0.0 0 893 0.0
    child cursor hash table 16,079 0.0 0 0
    dml lock allocation 2,674 0.0 0 0
    dummy allocation 43 0.0 0 0
    enqueue hash chains 9,313 0.0 0 0
    enqueues 9,405 0.0 0 0
    event group latch 5 0.0 0 0
    hash table column usage 0 0 55,565 0.0
    hash table modification 1 0.0 0 0
    kmcptab latch 78 0.0 0 0
    kmcpvec latch 0 0 78 0.0
    ktm global data 13 0.0 0 0
    lgwr LWN SCN 742 0.0 0 0
    library cache 193,957 0.0 0.0 0 6,959 0.4
    library cache load lock 110 0.0 0 0
    library cache pin 63,420 0.0 0 0
    library cache pin alloca 43,208 0.0 0 0
    list of block allocation 49 0.0 0 0
    loader state object free 34 0.0 0 0
    message pool operations 26 0.0 0 0
    messages 2,866 0.0 0 0
    mostly latch-free SCN 742 0.0 0 0
    multiblock read objects 164,572 0.0 0.0 0 0
    ncodef allocation latch 3 0.0 0 0
    object stats modificatio 1,669 0.0 0 0
    post/wait queue 1,029 0.0 0 683 0.0
    process allocation 11 0.0 0 5 0.0
    process group creation 11 0.0 0 0
    redo allocation 13,617 0.0 0.0 0 0
    redo copy 0 0 12,145 0.0
    redo writing 2,533 0.0 0 0
    row cache enqueue latch 215,027 0.0 0.0 0 0
    row cache objects 218,418 0.0 0.0 0 472 0.0
    sequence cache 99 0.0 0 0
    session allocation 8,683 0.0 0 0
    session idle bit 94,091 0.0 0 0
    Latch Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
    willing-to-wait latch get requests
    ->"NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests
    ->"Pct Misses" for both should be very close to 0.0
    Pct Avg Wait Pct
    Get Get Slps Time NoWait NoWait
    Latch Requests Miss /Miss (s) Requests Miss
    session switching 3 0.0 0 0
    session timer 80 0.0 0 0
    shared pool 160,825 0.0 0.0 0 0
    sim partition latch 0 0 35 0.0
    simulator hash latch 63,337 0.0 0 0
    simulator lru latch 4,437 0.0 0 16,447 0.0
    sort extent pool 129 0.0 0 0
    transaction allocation 47 0.0 0 0
    transaction branch alloc 3 0.0 0 0
    undo global data 3,091 0.0 0 0
    user lock 114 0.0 0 0
    virtual circuit buffers 540,157 0.4 0.0 0 0
    virtual circuit queues 256,196 0.0 0.0 0 0
    virtual circuits 89,002 0.0 0 0
    Top 5 Logical Reads per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Logical Reads Threshold: 10000
    Subobject Obj. Logical
    Owner Tablespace Object Name Name Type Reads %Total
    DIAGNOTECH DIAGNOTECH REQUISITIONS TABLE 162,064 11.66
    SYS SYSTEM I_OBJ1 INDEX 115,328 8.30
    SYS SYSTEM OBJ$ TABLE 113,328 8.15
    SYS SYSTEM I_IND1 INDEX 109,584 7.88
    IP IP BILLPHARMACY TABLE 89,328 6.43
    Top 5 Physical Reads per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Physical Reads Threshold: 1000
    Subobject Obj. Physical
    Owner Tablespace Object Name Name Type Reads %Total
    IP IP BILLPHARMACY TABLE 86,212 34.43
    DIAGNOTECH DIAGNOTECH REQUISITIONS TABLE 79,487 31.74
    DIAGNOTECH DIAGNOTECH TRACK TABLE 33,193 13.25
    IP SYSTEM TRACK TABLE 17,926 7.16
    OTS1 OTS1 MONEYRECIEPT TABLE 10,036 4.01
    Top 5 Row Lock Waits per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Row Lock Waits Threshold: 100
    Row
    Subobject Obj. Lock
    Owner Tablespace Object Name Name Type Waits %Total
    IP IP BILLID4064 INDEX 1 100.00
    Dictionary Cache Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Pct Misses" should be very low (< 2% in most cases)
    ->"Cache Usage" is the number of cache entries being used
    ->"Pct SGA" is the ratio of usage to allocated size for that cache
    Get Pct Scan Pct Mod Final
    Cache Requests Miss Reqs Miss Reqs Usage
    dc_histogram_defs 22,135 1.1 0 0 3,348
    dc_object_ids 26,251 0.0 0 0 625
    dc_objects 4,895 0.1 0 15 960
    dc_profiles 21 0.0 0 0 1
    dc_rollback_segments 273 0.0 0 0 12
    dc_segments 11,239 0.1 0 0 604
    dc_sequences 3 33.3 0 3 6
    dc_tablespaces 19,449 0.0 0 0 5
    dc_user_grants 2,814 0.0 0 0 17
    dc_usernames 886 0.0 0 0 15
    dc_users 22,542 0.0 0 0 20
    Library Cache Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Pct Misses" should be very low
    Get Pct Pin Pct Invali-
    Namespace Requests Miss Requests Miss Reloads dations
    BODY 445 0.0 445 0.0 0 0
    CLUSTER 397 0.0 121 0.0 0 0
    SQL AREA 7,041 28.0 24,030 16.9 55 23
    TABLE/PROCEDURE 8,324 0.0 15,082 0.6 18 0
    TRIGGER 953 0.0 953 0.0 0 0
    Shared Pool Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> Note there is often a 1:Many correlation between a single logical object
    in the Library Cache, and the physical number of memory objects associated
    with it. Therefore comparing the number of Lib Cache objects (e.g. in
    v$librarycache), with the number of Lib Cache Memory Objects is invalid
    Estd
    Shared Pool SP Estd Estd Estd Lib LC Time
    Size for Size Lib Cache Lib Cache Cache Time Saved Estd Lib Cache
    Estim (M) Factr Size (M) Mem Obj Saved (s) Factr Mem Obj Hits
    104 .5 97 21,986 47,321 1.0 22,910,514
    128 .6 120 27,657 47,381 1.0 22,988,994
    152 .8 143 32,965 47,422 1.0 23,048,924
    176 .9 166 38,101 47,451 1.0 23,094,145
    200 1.0 189 42,541 47,474 1.0 23,126,910
    224 1.1 212 47,258 47,492 1.0 23,155,651
    248 1.2 235 52,101 47,508 1.0 23,180,673
    272 1.4 258 56,800 47,521 1.0 23,202,200
    296 1.5 283 61,512 47,532 1.0 23,220,564
    320 1.6 306 65,892 47,540 1.0 23,235,720
    344 1.7 329 70,532 47,547 1.0 23,246,826
    368 1.8 352 75,208 47,553 1.0 23,257,346
    392 2.0 375 81,494 47,559 1.0 23,268,801
    416 2.1 411 88,685 47,565 1.0 23,279,344
    SGA Memory Summary for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    SGA regions Size in Bytes
    Database Buffers 369,098,752
    Fixed Size 455,784
    Redo Buffers 1,191,936
    Variable Size 436,207,616
    sum 806,954,088
    SGA breakdown difference for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Pool Name Begin value End value % Diff
    java free memory 83,886,080 83,886,080 0.00
    large free memory 63,891,136 64,350,992 0.72
    large session heap 19,994,944 19,535,088 -2.30
    shared 1M buffer 2,098,176 2,098,176 0.00
    shared Checkpoint queue 1,129,216 1,129,216 0.00
    shared DML lock 1,028,764 1,028,764 0.00
    shared FileOpenBlock 6,564,072 6,564,072 0.00
    shared KGK heap 3,756 3,756 0.00
    shared KGLS heap 2,584,540 2,431,584 -5.92
    shared KQR M PO 2,844,672 2,768,896 -2.66
    shared KQR S PO 249,880 250,652 0.31
    shared KQR S SO 7,936 7,936 0.00
    shared KSXR pending messages que 841,036 841,036 0.00
    shared KSXR receive buffers 1,033,000 1,033,000 0.00
    shared MTTR advisory 59,288 59,288 0.00
    shared PL/SQL DIANA 3,179,412 3,015,708 -5.15
    shared PL/SQL MPCODE 388,924 241,096 -38.01
    shared PLS non-lib hp 3,688 3,688 0.00
    shared VIRTUAL CIRCUITS 2,564,620 2,564,620 0.00
    shared db_handles 1,080,000 1,080,000 0.00
    shared dictionary cache 2,137,216 2,137,216 0.00
    shared enqueue 1,676,824 1,676,824 0.00
    shared event statistics per sess 18,675,020 18,675,020 0.00
    shared fixed allocation callback 388 388 0.00
    shared free memory 14,167,016 15,470,156 9.20
    shared joxs heap init 4,220 4,220 0.00
    shared ktlbk state objects 778,960 778,960 0.00
    shared library cache 43,962,768 43,051,344 -2.07
    shared message pool freequeue 665,792 665,792 0.00
    shared miscellaneous 41,742,904 42,080,748 0.81
    shared parameters 3,224 9,272 187.59
    shared processes 1,500,000 1,500,000 0.00
    shared sessions 3,998,480 3,998,480 0.00
    shared sim memory hea 195,212 195,212 0.00
    shared sql area 111,345,832 111,177,960 -0.15
    shared table definiti 16,576 15,240 -8.06
    shared transaction 1,852,092 1,852,092 0.00
    shared trigger defini 26,236 24,148 -7.96
    shared trigger inform 592 592 0.00
    shared trigger source 304 304 0.00
    buffer_cache 369,098,752 369,098,752 0.00
    fixed_sga 455,784 455,784 0.00
    log_buffer 1,180,672 1,180,672 0.00
    init.ora Parameters for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    End value
    Parameter Name Begin value (if different)
    background_dump_dest F:\oracle\admin\neosoft\bdump
    compatible 9.2.0.0.0
    control_files F:\oracle\oradata\neosoft\control
    core_dump_dest F:\oracle\admin\neosoft\cdump
    db_block_size 8192
    db_cache_size 369098752
    db_domain
    db_file_multiblock_read_count 16
    db_name neosoft
    dispatchers (PROTOCOL=TCP)
    fast_start_mttr_target 300
    hash_join_enabled TRUE
    instance_name neosoft
    java_pool_size 83886080
    large_pool_size 83886080
    open_cursors 300
    pga_aggregate_target 25165824
    processes 1500
    query_rewrite_enabled FALSE
    remote_login_passwordfile EXCLUSIVE
    shared_pool_size 209715200
    sort_area_size 524288
    star_transformation_enabled FALSE
    timed_statistics TRUE
    undo_management AUTO
    undo_retention 10800
    undo_tablespace UNDOTBS1
    user_dump_dest F:\oracle\admin\neosoft\udump
    End of Report

    How did you calculated all these ratios............I looked through the formatted output of the Statspack report, specifically the setion "SQL ordered by reads for DB" and found these SQL statements which are performing a large number of physical reads. Most of the SQL statements have similar WHERE clauses, except for the constants to the right of the = :
    Physical Reads  Executions  Reads per Exec %Total Time (s)  Time (s) Hash Value
              8,084            4        2,021.0    3.1     0.14      1.08 4198744706
    Module: Out Patient 2.1.41.exe
    Select Max(BillNo) as Bno From PatientsRegistration Where regdt
    = to_date('01/04/2008','dd/mm/yyyy') and regdt <= to_date('31/03/2009','dd/mm/yyyy')
              7,302            1        7,302.0    2.8     0.13      0.51 2116660478
    Module: In Patient 2.1.157.exe
    select discount,discamount from billpharmacy where patientid='PAT09212'
              7,302            1        7,302.0    2.8     0.06      0.41 3612969128
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09037'
              7,302            1        7,302.0    2.8     0.19      0.51 3981413559
    Module: In Patient 2.1.152.exe
    sELECT * FROM BillPharmacy WHERE BillPharmacy.pATIENtid= 'PAT09037' order by to_number((issueno))
              7,300            1        7,300.0    2.8     0.14      0.69  136284863
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09037'
              7,299            1        7,299.0    2.8     0.20      0.77 2137420337
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09154'
              7,298            1        7,298.0    2.8     0.13      0.43 1007690124
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT08301'
              7,298            1        7,298.0    2.8     0.13      0.58 3087447381
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09154'
              7,061            1        7,061.0    2.7     0.13      0.97 2993688253
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09146'
    and on what basis you one should have to find out
    which query causing the problem....
    i also wanted to learn how to read the
    statspack.........I personally do not like Statspack reports, but there are several very good sources for understanding Statspack reports:
    http://jonathanlewis.wordpress.com/2006/11/29/analysing-statspack-pt1/
    http://jonathanlewis.wordpress.com/statspack-examples/
    Metalink Note:232443.1 (How to Identify Resource Intensive SQL for Tuning)
    Metalink Note:390374.1 (Oracle Performance Diagnostic Guide (OPDG))
    Metalink Note:228913.1 (Systemwide Tuning using STATSPACK Reports)
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Help on performance with dynamic query

    Hi All,
      We are using SQL Server 2008R2. In our one of report we are using Dynamic query and it is taking more time to retrieve the data. to retrieve 32 records it is taking 13-15 secs. In my observation in a table variable, created more than 60 columns. In
    the SP called one more sp with insert statement.
    Please let me know how i can improve performance of the SP.
    I know that i have to provide the SP  for observation but unfortunately I cannot provide the SP. Please guide me how i can achieve this .
    I tried with temp tables by creating indexes on temp tables but i couldn't find improvement in performance. 
    Waiting for valuable replies.

    First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.
    There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.
    We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable.
    It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.
    You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates
    are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't
    have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to get the value from textInput Component to perform calculation?

    I need some help here...I'm trying to get the value of user input from the TextInput Component which is the age, height and weight to calculate the bmr and display the result in member("result").text.
    How am i suppose to let the integer pass through in order for me to perform calculation? Would appreciate if anyone can help me out with this, thanks!
    Below are the formula :
    The Harris Benedict equation estimates BMR:
    For women: (9.56 x w) + (1.85 x h) – (4.68 x a) + 655
    For men: (13.75 x w) + (5 x h) – (6.76 x a) + 66

    Assumed that this section is only for male ...it still show error saying script error : String expected for
    on mouseDown
       member("result").text = (13.75 * value(member("weightText").text)) + (5 * value(member("heightText").text)) - (6.76 * value(member("ageText").text)) + 66
    end
    Do i have to add in "put sprite(x).text -- where x is the number of the sprite that is the text input." ?

  • Cost component not splitting at the time of Rune the tine of Cost Estimate

    http//
    Hi,
    We are in developing phase for Product costing for coal mine project ,
    we have raise coal material with Non component BOM , and Routing is only one activity with 400- Raised Coal Qty-MT ,
    We upload the plan with Production cost center -activity type and cost element ( as per cost component -we have 10 cost component  as per below )
    RM - Blasting
    Production Overhead
    Power - Main
    Stores,Spare,Consum
    Repairs & Maint
    Lease & Hire Char-PM
    Power - Auxiliary
    Depreciation
    Over Burden
    Development
    we done the plan for Amount and Qty by KP06,KP26  and update plan price but system not calculate the cost component splitting in cost estimate as per planning while only one item showing for all cost to Production Overhead cost component
    Production Overhead cost component which assign the secondary cost element which is assign to activity type 400
    can any one help me to how we can resolve this issue
    Please find attached document

    Hi,
    Here I am providing the necessity and importance of splitting structure, will share the configuration steps once you go through the following and get the comfort level.
                        Expense Analysis and Splitting in Manufacturing Cost Centers
    Introduction In SAP Cost center work as a cost responsibility center, where all the expenses and cost are stored and analyzed for the purpose of management decision making.
    The cost could be fixed or variable in nature. The difference between variable and fixed costs can be made in various ways in product costing in CO module.
    Fixed costs represent the static costs incurred by the organization, which doesn’t change on the basis on manufacturing activities, which remain constant irrespective of production activities like rent for the premises, salaries of office staff etc.
    On the other hand, variable cost varies based on the level of production activities; if production activities increase then variable cost also increased like electricity consumes raw material charges etc.
    However all the variable cost doesn’t vary in direct proportion by quantity of goods produced.
    In this document will try to define; how the Expenses analysis and splitting of cost done in manufacturing cost centers.
    From controlling prospective, fixed cost remain constant regardless of operating activities, but if these factor changes, variable cost will fluctuate.
    Basically raw material costs represent variable cost, but in this document main focused will be given to distinguish fixed and variable activity cost.
    The segregation between fixed and variable cost is optional and is derived from the configuration and master data configured in cost center accounting and overhead accounting.
    Activity Price:
    There are different methods that could be used in cost center accounting to determine the activity price. The simple way is the manually enter “Fixed” and “Variable” Activity cost (KP26).
    However there are other methods used in Cost center Planning and Budgeting that automatically calculate the fixed and variable activity price.
    Here the focused will be given on Planning and Budgeting activity and automatic calculation of plan activity rate in cost center.
    This method aggregate planned costs by cost element and capacity by plan unit to calculate the activity price.
    Activity independent costs are segregated among different activities based on Splitting Structure, while activity dependent cost directly used for the purpose of variable activity rate calculation.   
    Fixed Activity Cost:
    In product costing all those cost, which doesn’t vary based on the activities in manufacturing cost will represent fixed cost.
    In a manufacturing cost centers there may be two or more activities performed.
    To calculate the activities rate, the fixed costs are distributed to various activities on the basis of Splitting Structure defined for cost center.  
    Variable Activity Cost:
    Variable activity cost, which directly depend upon the activity type and fluctuate based on increase or decrease in manufacturing activities. In SAP variable activity cost are directly linked to the respective activity.
    Activity Prices: Fixed and Variable Split
    In Cost Center Accounting dividing the cost between Fixed and Variable requires appropriate split to be made in the cost entered for the activity. The process is described below:
    i.  Variable cost would be planned at activity level and expenses should be maintained at cost element in the manufacturing cost center by assigning activity and cost element combination.
    In other word, the expenses should be planned on Activity type at the time of primary cost planning (KP06).
    Then the variable activity rates are calculated on Total cost planned at Activity divided by Total number of activity planned at that cost center (i.e. capacity in KP26)
    ii. Fixed cost would be planned at independent of activity type. These costs are maintained in KP06 at cost element level on manufacturing cost center.
    Then the fixed costs are distributed on various activity types on the basis of Splitting structure defined at OKEW.
    In Splitting Structure we define the rules, how the fixed cost will be distributed to Activities. For the purpose of this document, considering split of fixed cost on the basis of Capacity maintained in KP26.
    Regards,
    Pavan kumar Arvapally

  • Performance issue on Date filter

    In my where condition I wanted a date filter on sale date.  I want all sales after 9/1/2014.   
    CASE1
    If I explicitly use date filter like 
    SaleDate > '2014-09-01 00:00:00:000' I am getting the result in 2 seconds.
    CASE2
    Since I may need to use this data value again, I created a date table with single column "date" and loaded the value '2014-09-01 00:00:00:000' . 
    So now my where is like 
    SaleDate > (Select date from dateTable)
    When I run this , the result does not show up even after 10 mins. Both date types are datetime. I am baffled.  Why is this query not coming up with the result?

    As mentioned by Erland, for the optimizer, both situation are very different. With a literal, the optimizer can properly estimate the number of qualifying rows and adapt the query plan appropriately. With a scalar subquery, the value is unknown at compile
    time, and the optimizer will use heuristics to accommodate any value. In this case, the selection for all rows more recent than September 1st 2014 is probably a small percentage of the table.
    I can't explain why the optimizer or engine goes awry, because the subquery's result is a scalar, and shouldn't result in such long runtime. If you are unlucky, the optimizer expanded the query and actually joins the two tables. That would make the indexes
    on table dateTable relevant, as well as distribution and cardinality of dateTable's row values. If you want to know, you would have to inspect the (actual) query plan.
    In general, I don't think your approach is a smart thing to do. I don't know why you want to have your selection date in a table (as opposed to a parameter of a stored procedure), but if you want to stick to it, maybe you should break the query up into something
    like this. The optimizer would still have to use heuristics (instead of more reliable estimates), but some unintended consequences could disappear.
    Declare @min_date datetime
    Set @min_date = (SELECT date FROM dateTable)
    SELECT ...
    FROM ...
    WHERE SaleDate > @min_date
    If you use a parameter (or an appropriate query hint), you will probably get performance close to your first case.
    Gert-Jan

  • [Consolidation-Locked] Lightroom 4.1 Performance

    hello my lightroom 4.1 copy is so slow, in the develop module when switching between raw files the "loading" logo keeps spinning for a long time before I can edit the file, and the same happens when I click on the image to zoom in, takes forever to do so.
    I run windows 7 64 bit
    Xeon 16 core 2.4 gb
    32 gb ram
    the OS and the raw files are on two seperate sata 6 SSD drives
    theres is no way  it should be so slow to simply switch from raw files or zoom in?
    Even in loupe mode when clicking on a file to zoom it takes forever.
    Photoshop cs6 camera raw does not show performance issues, when importing the same raw image in photoshop zooming in is immediate instead of many many seconds in lightroom.
    I tried the optimization suggestion by adobe, setting the camera raw cache to more than 10gb, optimizing the catalog etc... but nothing changes. (http://helpx.adobe.com/lightroom/kb/optimize-performance-lightroom.html)
    If you have any suggestion I am very interested because at the moment it is very frustating to use the software
    Message title was edited by: Brett N

    Hello All, finished a chat today with Adobe help. Thought I would post this info for those having the same trouble. For reference, my specs for the new machine I built are:
    Win7, 64-bit; 16GB ram; 4-core AMD Phenom processor 3.2 GHz; SSD with Win, Photoshop & LightRoom installed on it; Nvidia GeForce 560 1GB; photos on secondary drive. CS5 12.1x64, LR4.1 CR 7.1
    Installed 4.1 updated viseo drivers, tried all the "remedies" such as enlarging & clearing the cache, etc. Nothing worked. LR was SLOW SLOW, taking 5-9 seconds to be load and accept adjustments each time I selected a new image to adjust (no big deal for 10-20 images, but for 800 image weddings from 2 cameras, quite a long time to wait on the computer!!!) Called Adobe, they said they were aware of performance issues on some machines, and were working on it.
    Got on Adobe chat help today. The following is the conversation, with superfluous comments etc. edited out. The simple procedure sped my LR performance up by at least 60-70% in my estimate. Amen.
    I do not surf the forums, and this is only my second post ever, so please don't expect me to answer questions right away, though I'm sure others will. I am just posting this conversation so that others might try the same, and maybe it will help them. Good luck!
    Help Chat with Adobe's "William", June 11, 2012:
    William: I understand that you're experiencing performance issue. Am I correct?
    Jojo: Oh yes
    William: Please close all windows except this chat window.
    William: Click on Start button.
    William: Type %appdata% in the search box and press Enter.
    William: Double click on Adobe folder.
    William: Check for the folder of Lightroom and rename it to "OldLightroom".
    William: Click on Start button.
    William: Type %temp% and press Enter.
    William: It will open Temp folder.
    William: Empty the files and folders inside it.
    Jojo: ok done. it still has files that could not be deleted for Win Explorer and Google Chrome (the browser I use)
    William: Okay.
    William: Launch Lightroom and check if you're getting the same issue.
    Jojo: that seems to have sped it up significant;y
    William: Perfect.
    William: Please double check if that works fine now.
    Jojo: Much faster, but all of my presets are gone
    Jojo: Export presets, etc
    William: It was due to corrupt preference that was causing this issue.
    William: Close Lightroom.
    William: Click on Start button.
    William: Type %appdata% in the search box and press Enter.
    William: Double click on Adobe folder.
    William: Check for the folder of Lightroom and rename it to "2OldLightroom".
    William: Now check for the folder "OldLightroom" and rename it to ""Lightroom".
    William: After that open Preferences folder inside it.
    William: Check for the file "Lightroom 4 Preferences.agprefs" and rename it to "OldLightroom 4 Preferences.agprefs".
    William: Launch Lightroom and check if that works fine for you.
    Jojo: Oh yes, that's working well!
    William: Perfect.
    Jojo: Much better!
    William: You can start working with the product smoothly now.
    William: Great.
    William: I'm happy to help you.
    Jojo: Hey, are they fixing this in a release? I know a lot of photographers who are VERY upset about this performance issue
    Jojo: I was ready to change back to LR3
    William: Corrupt preference may cause Lightroom to work slow.
    William: We renamed the preference file and it is working fine.

Maybe you are looking for

  • Acrobat 9 - Damaged File

    I have Acrobat 9 and have been using it since August 08 with no problem.  Recently,  when I email files Adobe printed from .xls or .doc files the received pdf won't open and the recipient gets the message "THERE WAS AN ERROR OPENING THIS DOCUMENT.  T

  • Question about using scrollRectToVisible?

    hello all: From the java doc, it says that "void scrollRectToVisible(Rectangle) (in JComponent) If the component is in a container that supports scrolling, such as a scroll pane, then calling this method scrolls the scroll pane such that the specifie

  • HT4914 Apple TV 3 with OS 6 doesn't work with iTunes Match.

    My Apple TV only shows me my purchases from iTunes Store All my computers work with iTunes Match perfect Have you any ideas?

  • Text Problem in JTextPane

    im trying to save some unicode characters and images from a JTextPane in jdk1.6 through following code: FileOutputStream fstrm = new FileOutputStream(f); ObjectOutput ostrm = new ObjectOutputStream(fstrm);          ostrm.writeObject(textPane.getStyle

  • JNLP version problem

    Hi, I've added a version id for each resource in my JNLP file <jar href="/MinFinCtx/WSTest/jars/ctx.be.jar" version="1"/> <jar href="/MinFinCtx/WSTest/jars/ctx.com.jar" version="1"/> When I try to lauch my application I receive the following error me