Why is package taking more time than expected?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siddiq
    New Member
    • Oct 2008
    • 3

    Why is package taking more time than expected?

    We have a package in production which has suddenly started consuming greater than normal time to execute. On debugging this further, we found the following:
    The package takes 5 mins to come out.
    The queries inside the package, if run seperately, come out in milliseconds in total.

    On looking through the sql trace when the package was run, it was found that an insert on a global Temp table is consuming around 5 mins (elapsed = 310 secs).

    call count cpu elapsed disk query current rows
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 55.55 310.37 396138 425556 19 65
    Fetch 0 0.00 0.00 0 0 0 0
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------
    total 2 55.55 310.37 396138 425556 19 65

    However, if the same set of sqls are run from outside the package, they run in milliseconds (with same results of course)
    So what is different in sqls running seperately, against running as part of a package? Why should the package take time?

    Any clues or pointers to what might be happening?
    There is activity seen on the temp tbs in the awr, which is expected because of the global temp tables.

    Thanks in advance.
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    What is your database version?

    Comment

    • siddiq
      New Member
      • Oct 2008
      • 3

      #3
      Hi.,
      I am using Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi

      Comment

      Working...