R12.2 Apps DBA. Powered by Blogger.

R12.2 Concurrent Programs running slow.

No comments :
we have submitted several requests for the program “APDBA Item Interface” which are running for close to 20mins for a batch of 500 records each. During Mock & in UAT the same programs run in less than 5mins for a batch of 500 records.
Per ADDM recommendation (and AWR report proves it) we should focus on following SQL statement:
   Recommendation 1: SQL Tuning
   Estimated benefit is 3.28 active sessions, 69.89% of total activity.
   --------------------------------------------------------------------
   Action
      Run SQL Tuning Advisor on the SELECT statement with SQL_ID
      "839f9mtcmu5yn".
      Related Object
         SQL statement with SQL_ID 839f9mtcmu5yn.
         SELECT COUNT(*) FROM MTL_SYSTEM_ITEMS_B MSI WHERE INVENTORY_ITEM_ID
         IN ( SELECT I.INVENTORY_ITEM_ID FROM MTL_PARAMETERS MP,
         MTL_SYSTEM_ITEMS_INTERFACE I, MTL_DESCR_ELEMENT_VALUES MDEV WHERE
         I.PROCESS_FLAG = :B3 AND I.SET_PROCESS_ID = :B2 AND
         I.TRANSACTION_TYPE = :B1 AND I.ITEM_CATALOG_GROUP_ID =
         MSI.ITEM_CATALOG_GROUP_ID AND I.ORGANIZATION_ID = MP.ORGANIZATION_ID
         AND I.ORGANIZATION_ID = MP.MASTER_ORGANIZATION_ID AND
         I.INVENTORY_ITEM_ID=MDEV.INVENTORY_ITEM_ID AND I.ORGANIZATION_ID
         <>MSI.ORGANIZATION_ID )
   Rationale
      The SQL spent 95% of its database time on CPU, I/O and Cluster waits.
      This part of database time may be improved by the SQL Tuning Advisor.
   Rationale
      Database time for this SQL was divided as follows: 100% for SQL
      execution, 0% for parsing, 0% for PL/SQL execution and 0% for Java
      execution.
   Rationale
      SQL statement with SQL_ID "839f9mtcmu5yn" was executed 1139 times and
      had an average elapsed time of 2.3 seconds.
   Rationale
      Top level calls to execute the PL/SQL statement with SQL_ID
      "3hmqs17s6sgn1" are responsible for 100% of the database time spent on
      the SELECT statement with SQL_ID "839f9mtcmu5yn".
      Related Object
         SQL statement with SQL_ID 3hmqs17s6sgn1.
         BEGIN BIO_INV_ITEMPDH_PKG.main(:errbuf,:rc,:A0,:A1); END;
~~~

As has been advised we have run SQL tuning advisor for SQL ID 839f9mtcmu5yn.
There is a bunch of recommendations have been produced but we recommend to try to apply the SQL profile in-first:
~~~
  Recommendation (estimated benefit: 99.76%)
  ------------------------------------------
  - Consider accepting the recommended SQL profile.
    execute dbms_sqltune.accept_sql_profile(task_name => 'SQL_tun_20160202',
            task_owner => 'SYS', replace => TRUE);
  Validation results
  ------------------
  The SQL profile was tested by executing both its plan and th
e original plan
  and measuring their respective execution statistics. A plan
may have been
  only partially executed if the other could be run to completio
n in less time.
                           Original Plan  With SQL Profile  %
 Improved
                           -------------  ----------------  --------
--
  Completion Status:            COMPLETE          COMPLETE
  Elapsed Time (s):               3.476156           .030605      99.11
 %
  CPU Time (s):                    3.458475           .028995      99.16 %
  User I/O Time (s):                  0           .00138
4
  Buffer Gets:                         636679              1463      99.77 %
  Physical Read Requests:             0
6
  Physical Write Requests:            0                 0
  Physical Read Bytes:                0             57344
  Physical Write Bytes:               0                 0
  Rows Processed:                     1
  1
  Fetches:                                 1                 1
  Executions:                           1                 1
  Notes
  -----
  1. Statistics for the original plan were averaged over 1 executions.
  2. Statistics for the SQL profile plan were averaged over 10 executions.
 
  AWR Report.
  From AWR report:
~~~
Elapsed:   120.08 (mins) =  7,204.8 (sec)
DB Time:   563.57 (mins) = 33,814.2 (sec)
NUM_CPUS 72
--
Available DB time = NUM_CPU's * (elapsed_time between snapshots) * 60 (sec) 
 =  72 * 120.08 * 60 = 518,745.6 (sec)
Thus actual DB time (33,814.2 sec) is just a little part of Available DB time (518,745.6 sec), it means that not much time was spent on DB side for observed period.
Solution:
SQL> select name from v$database;
NAME
---------
EBSPRD
SQL> sho user
USER is "SYS"
SQL> execute dbms_sqltune.accept_sql_profile(task_name => 'SQL_tun_20160202', task_owner => 'SYS', replace => TRUE);
PL/SQL procedure successfully completed.
SQL>  select NAME,CREATED,TYPE,status from dba_sql_profiles;
NAME
------------------------------
CREATED
----------------------------------
TYPE    STATUS
------- --------
SYS_SQLPROF_0152a14edd900000
02-FEB-16 04.27.26.000000 AM
MANUAL  ENABLED
SYS_SQLPROF_01487ff300e00000
29-JAN-16 10.04.01.000000 AM
MANUAL  ENABLED
NAME
------------------------------
CREATED
-----------------------------------
TYPE    STATUS
------- --------
SYS_SQLPROF_0134d7c544630001
29-JAN-16 10.04.01.000000 AM
MANUAL  ENABLED
SYS_SQLPROF_0134d7b014e40000
29-JAN-16 10.04.02.000000 AM
NAME
------------------------------
CREATED
-----------------------------------
TYPE    STATUS
------- --------
MANUAL  ENABLED
Now the threads are completing in 2 minutes.

No comments :

Post a Comment

Note: only a member of this blog may post a comment.