Tuning the sql query

Hi All,
I have query in using oracle report , its taking long time to run the report when we run for 1 month period , even its taking time trying with 1 or 2 days also .
below is the query , here we are using most of the VIew also , please help me how to improve the perfomance of this.what needs to concentrate mainly here . please help me out. Thanks in advance.
SELECT                                                                  
         pd.segment20 discipline,
           ppx.employee_number,
         SUBSTR (ppx.full_name, 1, 50) fullname,
           pj.NAME designation,
         horg.NAME department,
           SUM (a.measure) hours,
         d.segment1 projectnumber,
           d.NAME projectname,
           pat.task_name    
FROM     per_analysis_criteria pd,
         per_people_x ppx,
         per_jobs_v pj,
         hr_all_organization_units horg,
         hxc_time_building_blocks a,
           pa_projects_all d,
           pa_tasks pat,
         hxc_time_attribute_usages b,
         hxc_time_attributes c,
         hxc_time_building_blocks DAY,
         hxc_time_building_blocks TIME,
         per_assignments_x pax,
         hxc_timecard_summary summary,
         per_person_analyses pe,
         per_special_info_types_v pf
   WHERE pax.organization_id  = horg.organization_id
     AND pd.id_flex_num                  = pf.id_flex_num
     AND pd.analysis_criteria_id        = pe.analysis_criteria_id
     AND pax.job_id          = pj.job_id
     AND c.attribute1        = pat.project_id
     AND c.attribute2        = pat.task_id
     AND a.time_building_block_id = b.time_building_block_id
     AND d.project_id        = c.attribute1
     AND pat.task_id         = c.attribute2
     AND b.time_attribute_id = c.time_attribute_id
     AND a.parent_building_block_id   = DAY.time_building_block_id
     AND a.parent_building_block_ovn  = DAY.object_version_number
     AND DAY.parent_building_block_id = TIME.time_building_block_id
     AND DAY.parent_building_block_ovn= TIME.object_version_number
     AND TIME.time_building_block_id  = summary.timecard_id
     AND TIME.object_version_number   = summary.timecard_ovn
     AND a.resource_id                = ppx.person_id
     AND ppx.person_id                       = pax.person_id
     AND pf.id_flex_num                  = pe.id_flex_num
     AND pe.person_id                       = ppx.person_id
     AND pf.business_group_id             = pe.business_group_id
     AND a.object_version_number        = b.time_building_block_ovn
     AND pax.primary_flag                  = 'Y'
     AND summary.approval_status        = 'APPROVED'
     AND a.SCOPE                            = 'DETAIL'
     AND pf.NAME                            = 'SEC Staff Movement'
     AND c.attribute_category             = 'PROJECTS'
     AND d.segment1 LIKE '905%'
     AND DAY.start_time                      >= :p_start_date
     AND TRUNC (DAY.stop_time, 'DD')  <= :p_end_date
     AND SYSDATE BETWEEN a.date_from    AND a.date_to
     AND SYSDATE BETWEEN DAY.date_from  AND DAY.date_to
     AND SYSDATE BETWEEN TIME.date_from AND TIME.date_to
     AND a.object_version_number =
                  (SELECT MAX (b.object_version_number)
                     FROM hxc_time_building_blocks b
                    WHERE b.time_building_block_id = a.time_building_block_id)
     AND pe.date_from = (SELECT MAX (xsm.date_from)
                           FROM xsec_staff_movement xsm
                          WHERE xsm.emp_person_id = ppx.person_id)
GROUP BY pd.segment20,
         ppx.employee_number,
         SUBSTR (ppx.full_name, 1, 50),
         pj.NAME,
         horg.NAME,
         d.segment1,
         d.NAME,
         pat.task_name
[\pre]
Thanks
RG
Message was edited by:
        user549459                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Hi Rob , I managed to recreate the plan table and below is the out put. please help me out
PLAN_TABLE_OUTPUT
| Id  | Operation                                                |  Name                          | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT                                         |                                |     1 |   573 |   383 |
|   1 |  SORT GROUP BY                                           |                                |     1 |   573 |   380 |
|*  2 |   FILTER                                                 |                                |       |       |       |
|   3 |    NESTED LOOPS                                          |                                |     1 |   573 |   355 |
|   4 |     NESTED LOOPS                                         |                                |     1 |   554 |   353 |
|   5 |      NESTED LOOPS                                        |                                |     1 |   529 |   351 |
|   6 |       NESTED LOOPS                                       |                                |     1 |   484 |   349 |
|   7 |        NESTED LOOPS                                      |                                |     1 |   461 |   348 |
|   8 |         NESTED LOOPS                                     |                                |     1 |   417 |   347 |
|   9 |          NESTED LOOPS                                    |                                |     1 |   394 |   345 |
|  10 |           NESTED LOOPS                                   |                                |     1 |   379 |   342 |
|  11 |            NESTED LOOPS                                  |                                |     1 |   328 |   181 |
|  12 |             NESTED LOOPS                                 |                                |     1 |   305 |   180 |
|  13 |              NESTED LOOPS                                |                                |     1 |   297 |   179 |
|  14 |               NESTED LOOPS                               |                                |     1 |   287 |   178 |
|  15 |                NESTED LOOPS                              |                                |     1 |   256 |   177 |
|  16 |                 NESTED LOOPS                             |                                |     1 |   215 |   173 |
PLAN_TABLE_OUTPUT
|  17 |                  NESTED LOOPS                            |                                |     1 |    97 |   171 |
|  18 |                   NESTED LOOPS                           |                                |     1 |    71 |   169 |
|* 19 |                    HASH JOIN                             |                                |     1 |    59 |     5 |
|  20 |                     NESTED LOOPS                         |                                |     1 |    51 |     2 |
|* 21 |                      TABLE ACCESS BY INDEX ROWID         | FND_ID_FLEX_STRUCTURES_TL      |     1 |    37 |     2 |
|* 22 |                       INDEX RANGE SCAN                   | FND_ID_FLEX_STRUCTURES_TL_N1   |     1 |       |     1 |
|* 23 |                      INDEX UNIQUE SCAN                   | FND_ID_FLEX_STRUCTURES_U1      |     1 |    14 |       |
|  24 |                     TABLE ACCESS FULL                    | PER_SPECIAL_INFO_TYPES         |    45 |   360 |     2 |
|  25 |                    TABLE ACCESS BY INDEX ROWID           | PER_ANALYSIS_CRITERIA          |  1527 | 18324 |   164 |
|* 26 |                     INDEX RANGE SCAN                     | PER_ANALYSIS_CRITERIA_N1       |  1768 |       |     6 |
|* 27 |                   TABLE ACCESS BY INDEX ROWID            | PER_PERSON_ANALYSES            |     1 |    26 |     2 |
|* 28 |                    INDEX RANGE SCAN                      | PER_PERSON_ANALYSES_FK2        |     3 |       |     1 |
|* 29 |                  TABLE ACCESS BY INDEX ROWID             | PER_ALL_PEOPLE_F               |     1 |   118 |     2 |
|* 30 |                   INDEX RANGE SCAN                       | PER_PEOPLE_F_PK                |     1 |       |     1 |
|  31 |                    SORT AGGREGATE                        |                                |     1 |   417 |       |
|  32 |                     NESTED LOOPS OUTER                   |                                |     1 |   417 |    25 |
|  33 |                      NESTED LOOPS OUTER                  |                                |     1 |   319 |    23 |
|  34 |                       NESTED LOOPS OUTER                 |                                |     1 |   221 |    21 |
|  35 |                        NESTED LOOPS OUTER                |                                |     1 |   217 |    21 |
|  36 |                         NESTED LOOPS OUTER               |                                |     1 |   213 |    21 |
|  37 |                          NESTED LOOPS OUTER              |                                |     1 |   209 |    21 |
PLAN_TABLE_OUTPUT
|  38 |                           NESTED LOOPS OUTER             |                                |     1 |   205 |    21 |
|* 39 |                            HASH JOIN                     |                                |     1 |   201 |    21 |
|  40 |                             NESTED LOOPS                 |                                |     1 |   177 |    18 |
|  41 |                              NESTED LOOPS                |                                |     1 |    51 |    17 |
|* 42 |                               TABLE ACCESS BY INDEX ROWID| PER_ALL_ASSIGNMENTS_F          |     1 |    33 |     5 |
|* 43 |                                INDEX RANGE SCAN          | PER_ASSIGNMENTS_F_N12          |     3 |       |     2 |
|  44 |                               TABLE ACCESS BY INDEX ROWID| PER_PERSON_ANALYSES            |     1 |    18 |    12 |
|* 45 |                                INDEX RANGE SCAN          | PER_PERSON_ANALYSES_N3         |     1 |       |     1 |
|  46 |                              TABLE ACCESS BY INDEX ROWID | PER_ANALYSIS_CRITERIA          |     1 |   126 |     1 |
|* 47 |                               INDEX UNIQUE SCAN          | PER_ANALYSIS_CRITERIA_PK       |     1 |       |       |
|* 48 |                             TABLE ACCESS FULL            | FND_ID_FLEX_STRUCTURES         |     1 |    24 |     2 |
|* 49 |                            INDEX UNIQUE SCAN             | PA_TASKS_U1                    |     1 |     4 |       |
|* 50 |                           INDEX UNIQUE SCAN              | PA_TASKS_U1                    |     1 |     4 |       |
|* 51 |                          INDEX UNIQUE SCAN               | PA_TASKS_U1                    |     1 |     4 |       |
|* 52 |                         INDEX UNIQUE SCAN                | PA_PROJECTS_U1                 |     1 |     4 |       |
|* 53 |                        INDEX UNIQUE SCAN                 | PA_PROJECTS_U1                 |     1 |     4 |       |
|* 54 |                       TABLE ACCESS BY INDEX ROWID        | PER_ALL_PEOPLE_F               |     1 |    98 |     2 |
|* 55 |                        INDEX RANGE SCAN                  | PER_PEOPLE_F_PK                |     1 |       |     1 |
|* 56 |                      TABLE ACCESS BY INDEX ROWID         | PER_ALL_PEOPLE_F               |     1 |    98 |     2 |
|* 57 |                       INDEX RANGE SCAN                   | PER_PEOPLE_F_PK                |     1 |       |     1 |
|* 58 |                 TABLE ACCESS BY INDEX ROWID              | PER_ALL_ASSIGNMENTS_F          |     1 |    41 |     4 |
PLAN_TABLE_OUTPUT
|* 59 |                  INDEX RANGE SCAN                        | PER_ASSIGNMENTS_F_N12          |     3 |       |     1 |
|  60 |                TABLE ACCESS BY INDEX ROWID               | HR_ALL_ORGANIZATION_UNITS      |     1 |    31 |     1 |
|* 61 |                 INDEX UNIQUE SCAN                        | HR_ORGANIZATION_UNITS_PK       |     1 |       |       |
|  62 |               TABLE ACCESS BY INDEX ROWID                | PER_JOBS                       |     1 |    10 |     1 |
|* 63 |                INDEX UNIQUE SCAN                         | PER_JOBS_PK                    |     1 |       |       |
|* 64 |              TABLE ACCESS BY INDEX ROWID                 | PER_JOB_GROUPS                 |     1 |     8 |     1 |
|* 65 |               INDEX UNIQUE SCAN                          | PER_JOB_GROUPS_PK              |     1 |       |       |
|  66 |             TABLE ACCESS BY INDEX ROWID                  | PER_JOBS_TL                    |     1 |    23 |     1 |
|* 67 |              INDEX UNIQUE SCAN                           | PER_JOBS_TL_PK                 |     1 |       |       |
|* 68 |            TABLE ACCESS BY INDEX ROWID                   | HXC_TIME_BUILDING_BLOCKS       |     8 |   408 |   161 |
|* 69 |             INDEX RANGE SCAN                             | HXC_TIME_BUILDING_BLOCKS_FK2   |   543 |       |     5 |
|  70 |           TABLE ACCESS BY INDEX ROWID                    | HXC_TIME_ATTRIBUTE_USAGES      |     1 |    15 |     3 |
|* 71 |            INDEX RANGE SCAN                              | HXC_TIME_ATTRIBUTE_USAGES_FK2  |     1 |       |     2 |
|* 72 |          TABLE ACCESS BY INDEX ROWID                     | HXC_TIME_ATTRIBUTES            |     1 |    23 |     2 |
|* 73 |           INDEX UNIQUE SCAN                              | HXC_TIME_ATTRIBUTES_PK         |     1 |       |     1 |
|* 74 |         TABLE ACCESS BY INDEX ROWID                      | PA_PROJECTS_ALL                |     1 |    44 |     1 |
|* 75 |          INDEX UNIQUE SCAN                               | PA_PROJECTS_U1                 |     1 |       |       |
|* 76 |        TABLE ACCESS BY INDEX ROWID                       | PA_TASKS                       |     1 |    23 |     1 |
|* 77 |         INDEX UNIQUE SCAN                                | PA_TASKS_U1                    |     1 |       |       |
|* 78 |       TABLE ACCESS BY INDEX ROWID                        | HXC_TIME_BUILDING_BLOCKS       |     1 |    45 |     2 |
|* 79 |        INDEX UNIQUE SCAN                                 | HXC_TIME_BUILDING_BLOCKS_PK    |     1 |       |     1 |
PLAN_TABLE_OUTPUT
|* 80 |      TABLE ACCESS BY INDEX ROWID                         | HXC_TIME_BUILDING_BLOCKS       |     1 |    25 |     2 |
|* 81 |       INDEX UNIQUE SCAN                                  | HXC_TIME_BUILDING_BLOCKS_PK    |     1 |       |     1 |
|* 82 |     TABLE ACCESS BY INDEX ROWID                          | HXC_TIMECARD_SUMMARY           |     1 |    19 |     2 |
|* 83 |      INDEX UNIQUE SCAN                                   | HXC_TIMECARD_SUMMARY_PK        |     1 |       |     1 |
|  84 |    SORT AGGREGATE                                        |                                |     1 |     9 |       |
|  85 |     FIRST ROW                                            |                                |     1 |     9 |     3 |
|* 86 |      INDEX RANGE SCAN (MIN/MAX)                          | HXC_TIME_BUILDING_BLOCKS_PK    |    10M|       |     3 |
Predicate Information (identified by operation id):
   2 - filter("SYS_ALIAS_1"."OBJECT_VERSION_NUMBER"= (SELECT /*+ */ MAX("B"."OBJECT_VERSION_NUMBER")
              "HXC"."HXC_TIME_BUILDING_BLOCKS" "B" WHERE "B"."TIME_BUILDING_BLOCK_ID"=:B1))
  19 - access("X"."ID_FLEX_NUM"="B"."ID_FLEX_NUM")
  21 - filter("T"."ID_FLEX_CODE"='PEA')
  22 - access("T"."ID_FLEX_STRUCTURE_NAME"='SEC Staff Movement' AND "T"."LANGUAGE"=:B1)
  23 - access("B"."APPLICATION_ID"="T"."APPLICATION_ID" AND "B"."ID_FLEX_CODE"="T"."ID_FLEX_CODE" AN
              "B"."ID_FLEX_NUM"="T"."ID_FLEX_NUM")
       filter("B"."ID_FLEX_CODE"='PEA')
  26 - access("PD"."ID_FLEX_NUM"="X"."ID_FLEX_NUM")
PLAN_TABLE_OUTPUT
  27 - filter("X"."ID_FLEX_NUM"="PE"."ID_FLEX_NUM" AND "X"."BUSINESS_GROUP_ID"="PE"."BUSINESS_GROUP_
  28 - access("PD"."ANALYSIS_CRITERIA_ID"="PE"."ANALYSIS_CRITERIA_ID")
  29 - filter(DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS"."HR_SECURITY"."SHOW_PERSON"
              ID","SYS_ALIAS_2"."CURRENT_APPLICANT_FLAG","SYS_ALIAS_2"."CURRENT_EMPLOYEE_FLAG","SYS_ALIAS_2
              S_2"."EMPLOYEE_NUMBER","SYS_ALIAS_2"."APPLICANT_NUMBER","SYS_ALIAS_2"."NPW_NUMBER"))='TRUE' A
              "SYS_ALIAS_2"."BUSINESS_GROUP_ID"=DECODE("APPS"."HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"SYS_ALI
              S"."HR_GENERAL"."GET_BUSINESS_GROUP_ID"()))
  30 - access("PE"."PERSON_ID"="SYS_ALIAS_2"."PERSON_ID" AND "SYS_ALIAS_2"."EFFECTIVE_END_DATE">=TRU
              "SYS_ALIAS_2"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!))
       filter("SYS_ALIAS_2"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!) AND
              "SYS_ALIAS_2"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!) AND "PE"."DATE_FROM"= (SELECT /*+ */ MAX
              "PA"."PA_TASKS" "PAT3","PA"."PA_TASKS" "PAT2","PA"."PA_TASKS" "PAT1","HR"."PER_ALL_PEOPLE_F"
              "PAP","PA"."PA_PROJECTS_ALL" "PAP2","PA"."PA_PROJECTS_ALL" "PAP1","APPLSYS"."FND_ID_FLEX_STRU
              "D","HR"."PER_ALL_ASSIGNMENTS_F" "PAA","HR"."PER_PERSON_ANALYSES" "B","HR"."PER_ANALYSIS_CRIT
              "A"."ANALYSIS_CRITERIA_ID"="B"."ANALYSIS_CRITERIA_ID" AND "B"."PERSON_ID"="PAA"."PERSON_ID" A
              "PAA"."PERSON_ID"=:B2 AND "PAA"."PRIMARY_FLAG"='Y' AND DECODE("APPS"."HR_SECURITY"."VIEW_ALL"
              ITY"."SHOW_RECORD"('PER_ALL_ASSIGNMENTS_F',"PAA"."ASSIGNMENT_ID",TO_CHAR("PAA"."PERSON_ID"),"
              ' AND "PAA"."BUSINESS_GROUP_ID"=DECODE("APPS"."HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAA"."BUS
              ERAL"."GET_BUSINESS_GROUP_ID"()) AND "PAA"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!) AND
              "PAA"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!) AND "A"."ID_FLEX_NUM"="D"."ID_FLEX_NUM" AND
              "D"."ID_FLEX_STRUCTURE_CODE"='SEC_STAFF_MOVEMENT' AND "PAP1"."PROJECT_ID"(+)=TO_NUMBER("A"."S
PLAN_TABLE_OUTPUT
              "PAP2"."PROJECT_ID"(+)=TO_NUMBER("A"."SEGMENT3") AND "PAP"."PERSON_ID"(+)=TO_NUMBER("A"."SEGM
              DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS"."HR_SECURITY"."SHOW_PERSON"("PAP".
              APPLICANT_FLAG"(+),"PAP"."CURRENT_EMPLOYEE_FLAG"(+),"PAP"."CURRENT_NPW_FLAG"(+),"PAP"."EMPLOY
              NUMBER"(+),"PAP"."NPWNUMBER"(+)))='TRUE' AND "PAP"."BUSINESS_GROUP_ID"(+)=DECODE("APPS"."HR
              'Y',"PAP"."BUSINESS_GROUP_ID"(+),"APPS"."HR_GENERAL"."GET_BUSINESS_GROUP_ID"()) AND
              "PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!) AND "PAP"."EFFECTIVE_END_DATE"(+)>=TRUNC(SY
              "PAP"."PERSON_ID"(+)=TO_NUMBER("A"."SEGMENT11") AND DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),
              "."SHOW_PERSON"("PAP"."PERSON_ID"(+),"PAP"."CURRENT_APPLICANT_FLAG"(+),"PAP"."CURRENT_EMPLOYE
              FLAG"(+),"PAP"."EMPLOYEE_NUMBER"(+),"PAP"."APPLICANT_NUMBER"(+),"PAP"."NPW_NUMBER"(+)))='TRUE
              "PAP"."BUSINESS_GROUP_ID"(+)=DECODE("APPS"."HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAP"."BUSINE
              ERAL"."GET_BUSINESS_GROUP_ID"()) AND "PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!) AND
              "PAP"."EFFECTIVE_END_DATE"(+)>=TRUNC(SYSDATE@!) AND "PAT1"."TASK_ID"(+)=TO_NUMBER("A"."SEGMEN
              "PAT2"."TASK_ID"(+)=TO_NUMBER("A"."SEGMENT18") AND "PAT3"."TASK_ID"(+)=TO_NUMBER("A"."SEGMENT
  39 - access("A"."ID_FLEX_NUM"="D"."ID_FLEX_NUM")
  42 - filter("PAA"."PRIMARY_FLAG"='Y' AND DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS
              ECORD"('PER_ALL_ASSIGNMENTS_F',"PAA"."ASSIGNMENT_ID",TO_CHAR("PAA"."PERSON_ID"),"PAA"."ASSIGN
              "PAA"."BUSINESS_GROUP_ID"=DECODE("APPS"."HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAA"."BUSINESS_
              "GET_BUSINESS_GROUP_ID"()))
  43 - access("PAA"."PERSON_ID"=:B1 AND "PAA"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!) AND
              "PAA"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!))
       filter("PAA"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!) AND "PAA"."EFFECTIVE_END_DATE">=TRUNC(S
PLAN_TABLE_OUTPUT
  45 - access("B"."PERSON_ID"="PAA"."PERSON_ID")
       filter("B"."PERSON_ID"=:B1)
  47 - access("A"."ANALYSIS_CRITERIA_ID"="B"."ANALYSIS_CRITERIA_ID")
  48 - filter("D"."ID_FLEX_STRUCTURE_CODE"='SEC_STAFF_MOVEMENT')
  49 - access("PAT3"."TASK_ID"(+)=TO_NUMBER("A"."SEGMENT21"))
  50 - access("PAT2"."TASK_ID"(+)=TO_NUMBER("A"."SEGMENT18"))
  51 - access("PAT1"."TASK_ID"(+)=TO_NUMBER("A"."SEGMENT2"))
  52 - access("PAP2"."PROJECT_ID"(+)=TO_NUMBER("A"."SEGMENT3"))
  53 - access("PAP1"."PROJECT_ID"(+)=TO_NUMBER("A"."SEGMENT1"))
  54 - filter(DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS"."HR_SECURITY"."SHOW_PERSON"
              PAP"."CURRENT_APPLICANT_FLAG"(+),"PAP"."CURRENT_EMPLOYEE_FLAG"(+),"PAP"."CURRENT_NPW_FLAG"(+)
              AP"."APPLICANT_NUMBER"(+),"PAP"."NPW_NUMBER"(+)))='TRUE' AND "PAP"."BUSINESS_GROUP_ID"(+)=DEC
              BG_PROFILE"(),'Y',"PAP"."BUSINESS_GROUP_ID"(+),"APPS"."HR_GENERAL"."GET_BUSINESS_GROUP_ID"())
  55 - access("PAP"."PERSON_ID"(+)=TO_NUMBER("A"."SEGMENT11") AND "PAP"."EFFECTIVE_END_DATE"(+)>=TRU
              "PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!))
       filter("PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!) AND "PAP"."EFFECTIVE_END_DATE"(+)>=T
  56 - filter(DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS"."HR_SECURITY"."SHOW_PERSON"
              PAP"."CURRENT_APPLICANT_FLAG"(+),"PAP"."CURRENT_EMPLOYEE_FLAG"(+),"PAP"."CURRENT_NPW_FLAG"(+)
              AP"."APPLICANT_NUMBER"(+),"PAP"."NPW_NUMBER"(+)))='TRUE' AND "PAP"."BUSINESS_GROUP_ID"(+)=DEC
              BG_PROFILE"(),'Y',"PAP"."BUSINESS_GROUP_ID"(+),"APPS"."HR_GENERAL"."GET_BUSINESS_GROUP_ID"())
  57 - access("PAP"."PERSON_ID"(+)=TO_NUMBER("A"."SEGMENT4") AND "PAP"."EFFECTIVE_END_DATE"(+)>=TRUN
PLAN_TABLE_OUTPUT
              "PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!))
       filter("PAP"."EFFECTIVE_START_DATE"(+)<=TRUNC(SYSDATE@!) AND "PAP"."EFFECTIVE_END_DATE"(+)>=T
  58 - filter("PAA"."PRIMARY_FLAG"='Y' AND DECODE("APPS"."HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"APPS
              ECORD"('PER_ALL_ASSIGNMENTS_F',"PAA"."ASSIGNMENT_ID",TO_CHAR("PAA"."PERSON_ID"),"PAA"."ASSIGN
              "PAA"."BUSINESS_GROUP_ID"=DECODE("APPS"."HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAA"."BUSINESS_
              "GET_BUSINESS_GROUP_ID"()))
  59 - access("SYS_ALIAS_2"."PERSON_ID"="PAA"."PERSON_ID" AND "PAA"."EFFECTIVE_END_DATE">=TRUNC(SYSD
              "PAA"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!))
       filter("PAA"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!) AND "PAA"."EFFECTIVE_END_DATE">=TRUNC(S
  61 - access("PAA"."ORGANIZATION_ID"="HORG"."ORGANIZATION_ID")
  63 - access("PAA"."JOB_ID"="JOB"."JOB_ID")
  64 - filter("JGR"."INTERNAL_NAME"='HR_'||TO_CHAR("JOB"."BUSINESS_GROUP_ID"))
  65 - access("JOB"."JOB_GROUP_ID"="JGR"."JOB_GROUP_ID")
  67 - access("JBT"."JOB_ID"="JOB"."JOB_ID" AND "JBT"."LANGUAGE"=:B1)
  68 - filter("SYS_ALIAS_1"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL AND "SYS_ALIAS_1"."PARENT_BUILDIN
              NULL AND "SYS_ALIAS_1"."DATE_FROM"<=SYSDATE@! AND "SYS_ALIAS_1"."DATE_TO">=SYSDATE@!)
  69 - access("SYS_ALIAS_1"."RESOURCE_ID"="SYS_ALIAS_2"."PERSON_ID" AND "SYS_ALIAS_1"."SCOPE"='DETAI
  71 - access("SYS_ALIAS_1"."TIME_BUILDING_BLOCK_ID"="B"."TIME_BUILDING_BLOCK_ID" AND
              "SYS_ALIAS_1"."OBJECT_VERSION_NUMBER"="B"."TIME_BUILDING_BLOCK_OVN")
  72 - filter("C"."ATTRIBUTE_CATEGORY"='PROJECTS')
  73 - access("B"."TIME_ATTRIBUTE_ID"="C"."TIME_ATTRIBUTE_ID")
PLAN_TABLE_OUTPUT
  74 - filter("D"."SEGMENT1" LIKE '905%')
  75 - access("D"."PROJECT_ID"=TO_NUMBER("C"."ATTRIBUTE1"))
  76 - filter("PAT"."PROJECT_ID"=TO_NUMBER("C"."ATTRIBUTE1"))
  77 - access("PAT"."TASK_ID"=TO_NUMBER("C"."ATTRIBUTE2"))
  78 - filter("DAY"."PARENT_BUILDING_BLOCK_ID" IS NOT NULL AND "DAY"."PARENT_BUILDING_BLOCK_OVN" IS
              "DAY"."START_TIME">=:Z AND TRUNC("DAY"."STOP_TIME",'fmdd')<=:Z AND "DAY"."DATE_FROM"<=SYSDATE
              "DAY"."DATE_TO">=SYSDATE@!)
  79 - access("SYS_ALIAS_1"."PARENT_BUILDING_BLOCK_ID"="DAY"."TIME_BUILDING_BLOCK_ID" AND
              "SYS_ALIAS_1"."PARENT_BUILDING_BLOCK_OVN"="DAY"."OBJECT_VERSION_NUMBER")
  80 - filter("TIME"."DATE_FROM"<=SYSDATE@! AND "TIME"."DATE_TO">=SYSDATE@!)
  81 - access("DAY"."PARENT_BUILDING_BLOCK_ID"="TIME"."TIME_BUILDING_BLOCK_ID" AND
              "DAY"."PARENT_BUILDING_BLOCK_OVN"="TIME"."OBJECT_VERSION_NUMBER")
  82 - filter("TIME"."OBJECT_VERSION_NUMBER"="SUMMARY"."TIMECARD_OVN" AND "SUMMARY"."APPROVAL_STATUS
  83 - access("TIME"."TIME_BUILDING_BLOCK_ID"="SUMMARY"."TIMECARD_ID")
  86 - access("B"."TIME_BUILDING_BLOCK_ID"=:B1)
[\pre]
Note: cpu costing is off
Message was edited by:
        user549459                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

Similar Messages

  • Tuning the sql query when we have 30 Million records

    Hi Friends,
    I have query which takes around 25 to 30 Minutes to retrieve 9 Million records.
    Oracle version=11.2.0.2
    OS=Solaris 10 64bit
    query details
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    AS 
    SELECT  A."ORDERID", A."USERORDERID", A."ORDERSIDE", A."ORDERTYPE",
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, a.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND (A.MessageSequence, A.OrderID) IN (
                SELECT  max(C.MessageSequence), C.OrderID
                  FROM  tibex_Order C
                  WHERE LastInstRejectCode = 'OK'
                  GROUP By C.OrderID
          AND a.OrderStatus IN (
                SELECT OrderStatus
                  FROM  tibex_orderStatusEnum
                  WHERE ShortDesc IN (
                          'ORD_OPEN', 'ORD_EXPIRE', 'ORD_CANCEL', 'ORD_FILLED','ORD_CREATE','ORD_PENDAMD','ORD_PENDCAN'
      UNION ALL
      SELECT  A.ORDERID, A.USERORDERID, A.ORDERSIDE, A.ORDERTYPE,
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, A.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND orderstatus in (
                SELECT  orderstatus
                  FROM  tibex_orderStatusEnum
                  WHERE ShortDesc in ('ORD_REJECT')
          AND 1 IN (
                  SELECT count(*)
                    FROM tibex_order c
                    WHERE c.orderid=a.orderid
                      AND c.instrumentID=a.instrumentID
    /Tried by modifying the query but same result was not retrieved but it was Quicker 6 min.Can Somebody check where i am going wrong.
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    AS   
    WITH REJ AS
    SELECT ROWID RID
    FROM   TIBEX_ORDER
    WHERE  ORDERSTATUS = (SELECT ORDERSTATUS
                          FROM   TIBEX_ORDERSTATUSENUM
                          WHERE  SHORTDESC = 'ORD_REJECT')
    REJ1 AS
    SELECT ROWID RID
    FROM   TIBEX_ORDER
    WHERE  ORDERSTATUS NOT IN (SELECT ORDERSTATUS
                               FROM   TIBEX_ORDERSTATUSENUM
                               WHERE  SHORTDESC = 'ORD_NOTFND'
                               OR     SHORTDESC = 'ORD_REJECT')
    SELECT O.*,
           P.QSID
    FROM   TIBEX_ORDER O,
           TIBEX_PARTICIPANT P
    WHERE  O.PARTICIPANTID = P.PARTICIPANTID
    AND    O.ROWID IN (
                       SELECT RID
                       FROM   (
                               SELECT   ROWID RID,
                                        ORDERSTATUS,
                                        RANK () OVER (PARTITION BY ORDERID ORDER BY MESSAGESEQUENCE ASC) R
                               FROM     TIBEX_ORDER
                       WHERE  R = 1
                       AND    RID IN (SELECT RID FROM REJ)
    UNION ALL
    SELECT O.*,
           P.QSID
    FROM   TIBEX_ORDER O,
           TIBEX_PARTICIPANT P
    WHERE  O.PARTICIPANTID = P.PARTICIPANTID
    AND    O.ROWID IN (
                       SELECT RID
                       FROM   (
                               SELECT   ROWID RID,
                                        ORDERSTATUS,
                                        RANK () OVER (PARTITION BY ORDERID ORDER BY MESSAGESEQUENCE DESC) R
                               FROM     TIBEX_ORDER
                       WHERE  R = 1
                       AND    RID IN (SELECT RID FROM REJ1)
                      );Regards
    NM

    Hi Satish,
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    (ORDERID, USERORDERID, ORDERSIDE, ORDERTYPE, ORDERSTATUS,
    BOARDID, TIMEINFORCE, INSTRUMENTID, REFERENCEID, PRICETYPE,
    PRICE, AVERAGEPRICE, QUANTITY, MINIMUMFILL, DISCLOSEDQTY,
    REMAINQTY, AON, PARTICIPANTID, ACCOUNTTYPE, ACCOUNTNO,
    CLEARINGAGENCY, LASTINSTRESULT, LASTINSTMESSAGESEQUENCE, LASTEXECUTIONID, NOTE,
    TIMESTAMP, QTYFILLED, MEID, LASTINSTREJECTCODE, LASTEXECPRICE,
    LASTEXECQTY, LASTINSTTYPE, LASTEXECUTIONCOUNTERPARTY, VISIBLEQTY, STOPPRICE,
    LASTEXECCLEARINGAGENCY, LASTEXECACCOUNTNO, LASTEXECCPCLEARINGAGENCY, MESSAGESEQUENCE, LASTINSTUSERALIAS,
    BOOKTIMESTAMP, PARTICIPANTIDMM, MARKETSTATE, PARTNEREXID, LASTEXECSETTLEMENTCYCLE,
    LASTEXECPOSTTRADEVENUETYPE, PRICELEVELPOSITION, PREVREFERENCEID, EXPIRYTIMESTAMP, MATCHTYPE,
    LASTEXECUTIONROLE, MDENTRYID, PEGOFFSET, HALTREASON, COMPARISONPRICE,
    ENTEREDPRICETYPE, ISPEX, CLEARINGHANDLING, QSID)
    AS
    SELECT  A."ORDERID", A."USERORDERID", A."ORDERSIDE", A."ORDERTYPE",
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, a.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND (A.MessageSequence, A.OrderID) IN ( SELECT MAX (C.MessageSequence), C.OrderID
               FROM tibex_Order C
                 WHERE c.LastInstRejectCode = 'OK'
                 and a.OrderID=c.OrderID
                   GROUP BY C.OrderID)
          AND a.OrderStatus IN (2,4,5,6,1,9,10)
      UNION ALL
      SELECT  A.ORDERID, A.USERORDERID, A.ORDERSIDE, A.ORDERTYPE,
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, A.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND orderstatus=3
          AND 1 IN (
                  SELECT count(*)
                    FROM tibex_order c
                    WHERE c.orderid=a.orderid
                      AND c.instrumentID=a.instrumentID
    select * from TIBEX_ORDERSBYQSIDVIEW where participantid='NITE';
    Current SQL using Temp Segment and Look for Column TEMPSEG_SIZE_MB
           SID TIME                OPERATION                 ESIZE        MEM    MAX MEM       PASS TEMPSEG_SIZE_MB
           183 11/10/2011:13:38:44 HASH-JOIN                    43         43       1556          1            1024
           183 11/10/2011:13:38:44 GROUP BY (HASH)            2043       2072       2072          0            4541Edited by: NM on 11-Oct-2011 04:38

  • How to view the sql query?

    hi,
      how to view the sql query formed from the xml structure in the receiver jdbc?

    You can view SAP Note at
    http://service.sap.com/notes
    But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
    Reason and Prerequisites
    You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
    Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
    Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
    When you want to use a parameter documented here, please be aware to which category it belongs!
    Solution
    The following list shows all available parameters of category 1 or 2. Please note:
    Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
    Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
    The default value of a parameter is always chosen that it does not change the standard functionality
    JDBC Receiver Adapter Parameters
    1. Parameter name: "logSQLStatement"
                  Parameter type: boolean
                  Parameter value: true for any string value, false only for empty string
                  Parameter value default: false (empty String)
                  Available with: SP9
                  Category: 2
                  Description:
                  When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
                  This should be used only during the test phase and not in productive scenarios.
    Regards,
    Prateek

  • How to get cm:search to use the max attribute when creating the SQL query?

    When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
    We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
    The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
    Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?

    Hi Erik,
    The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
    -Ryan

  • How to find out which Tables have been accessed without looking at the SQL query ?

    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]
    null

    PRECISE/SQL can help you if you have access to it
    2nd option can be that turn on SQL_TRACE
    Run executable of ur c++ program
    it will create a trace file in user_dump_dest
    and then using TKPROF u can see all quesries and their plan also.
    HTH
    Gagan Deep Singh
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by (jagdeeps):
    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]<HR></BLOCKQUOTE>
    null

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • How to display the out put of the sql query in a text file using forms

    I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz

    Have a look at the text_io package:
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
    cheers

  • Find out the sql query for special characters.

    Hi,
    I have the emp table with column name first_name.In that table i have lot records with first_name inlcudes the below mentioned special characters.
    ¡ , ¿, ,Ä,Å,ä,ª,À,Á,Ã,à,á,ã,å,Æ,æ,Ç,ç,È,É,Ê,Ë,è,é,ê,ë,Ì,Í,Î, Ï,ì,í,î,ï, Ñ,ñ, ô, º, Ò, Ó, Ô, Õ, Ö, Ø, ò, ó, õ, ö, ø, ß, Û, Ù, Ú, Ü,ù, ú, û, ü, ÿ,
    I am looking for the records with includes the above mentioned special characters in the first_name column.
    Can u please give the sql query to find out the records.
    Thanks&Regards
    N.Sivaraman

    I am looking for the records with includes the above mentioned special characters in the first_name column.One way would be:
    select emp.*
      from emp,
           table (
             sys.odcivarchar2list ('¡',
                                   'Ä',
                                   'Å',
                                   'ä',
                                   'ª',
                                   'À',
                                   'Á',
                                   'Ã',
                                   'à',
                                   'á',
                                   'ã',
                                   'å',
                                   'Æ',
                                   'æ',
                                   'Ç',
                                   'ç',
                                   'È',
                                   'É',
                                   'Ê',
                                   'Ë',
                                   'è',
                                   'é',
                                   'ê',
                                   'ë',
                                   'Ì',
                                   'Í',
                                   'Î',
                                   'Ï',
                                   'ì',
                                   'í',
                                   'î',
                                   'ï',
                                   'Ñ',
                                   'ñ',
                                   'ô',
                                   'º',
                                   'Ò',
                                   'Ó',
                                   'Ô',
                                   'Õ',
                                   'Ö',
                                   'Ø',
                                   'ò',
                                   'ó',
                                   'õ',
                                   'ö',
                                   'ø',
                                   'ß',
                                   'Û',
                                   'Ù',
                                   'Ú',
                                   'Ü',
                                   'ù',
                                   'ú',
                                   'û',
                                   'ü',
                                   'ÿ'
    where instr (ename, column_value) > 0

  • The SQL query is not executing

    Hi
    I have the following situation: In a project we designed our reports calling a stored procedure the exits in a MS SQL Server 200 database. The Stored Procedures works fine and when they are used in the report everything works perfectly.
    The reports are being made with CR DEsigner 11, when the designer ends them, ha pass them to me and we put them in our java web application. I open them and even preview them since the Crystal Reprots Perspective of Eclipse and I can see the data, so everything to this point is OK.
    The problem comes when I change of connection, I'm trying to connect every report to the same host and database, and when the reprot is displayed in the browser there is no data. I profile the SQL commands that are executed when the report is requested and I found that the reprot is not executing the stored procedure.
    I guess because i'm connectring the report to the same database and host that was used when the report is created and i'm also passing exactly the same parameters of the stored procedure, then report thinks that it doesn't have executing again becuase it will be the same information.
    SO, i wonder if there is a way to request to the report to execute the sql query every time i have to display it.
    thanks for any help.

    What happens when you try to view the report using a simple viewer.jsp?without changing the connection?
    2009-05-25 14:06:09,250 ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter -  detected an exception: Error de conexión: [SQLServer 2000 Driver for JDBC]Error establishing socket.
    But the database server is ok, so i think the rpt needs more information to be connect to the database.
    Also what happens if you dont use the data bean and give everything there only?
    The same, the rpt is not executing the stored procedure.
    Did anything change on the RDBMS side? Additional packages, changes to the schema, ownership, etc?
    No, the server is ok and the database is ok.
    If you configure Log4J logging to DEBUG, you should see the database invokes from the Crystal Java engine, specifically the queries sent and the number of rowsets returned. Do you notice any errors?
    I have a problem here with log4j. In my project i'm using spring and with the help of spring i configure log4j, basically with spring is easier to configure log4j.
    I'm telling you this because i have log4j working but when my application reaches the code to change the connection to the rerport, log4j dies and stop sending any message to the stdout or to a log file. I haven't since this behavior in any other app o library. So i want to guess i have something wrong with my log4j or maybe with log4j+spring.
    So, i remove all the code of spring referring to log4j, but the problem with log4j wasn't solved.
    What i will try now is to remove spring from the project.
    This is my log4j.properties:
    log4j.rootLogger=DEBUG, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • ADF BC / Why bind variables are mandatory in the sql query

    I got this error during view object excecution in the component browser :
    (oracle.jbo.SQLStmtException) JBO-27122: Erreur SQL lors de la préparation d'une instruction. Instruction : SELECT * FROM (Select distinct(socialgroup.socialgroup_i) from socialgroup, socialgroupmember, lodgingallocation, lodge
    where socialgroup.socialgroup_i = socialgroupmember.socialgroup_i and socialgroupmember.t_socialgrouprole_i = t_rolegroup_ipar.fgetflextypologyclassitem_i(t_rolegroup_ipar.fisbeneficiary) and socialgroupmember.datefrom <= :DateTo and nvl(socialgroupmember.dateto, :DateFrom) >= :DateFrom and socialgroupmember.requester_i = lodgingallocation.requester_i and lodgingallocation.datefrom <= :DateTo and nvl(lodgingAllocation.DateTo, :DateFrom) >= :DateFrom and lodgingallocation.lodge_i = lodge.lodge_i) QRSLT ORDER BY "SOCIALGROUP_I"
    ----- LEVEL 1: DETAIL 0-----
    (java.sql.SQLException) Tentative de définition d'un nom de paramètre qui ne se trouve pas dans le SQL: T_SICategory_I
    The bind variables T_SICategory_I is not yet use in the sql query but will be used later so i defined it for the view object.
    Is it a reason that the run time check this ? It would be more convenient to set the bind variables early when defining the view object and add them later during the development iteration.

    Design-time defined named bind variables can be marked as required, or not.
    This is decided by the use in the where clause or in view criteria. In my case the bind variable was not used in where clause neither in view criteria and that causes the error.
    May be i would be nice to add a check box (a flag) that enable or disable the bind variables for this checking so we will be able to let it defined even we removed some part of the query corresponding to the corresponding restriction or we defined it earlier for a part of the query that is not yet defined.
    In my current case i fully defined the bind variables but would refine my query later ... in that cause i would have to remove this bind variable and loose all the definitions to run this view object.
    sorry for my english ...

  • XSU  and CURSOR expression in the sql query

    Platform: oracle 8.X on ibm aix and java client code from
    windows NT.
    JDBC DRIVER: JDBC Oracle thin driver version 1.2.
    when i execute a Sql satement with Cursor expression from the
    java client code with XSU it returns an XML DOM But if the
    CURSOR EXPRESSION IN THE SQL QUERY RETURNS EMPTY ROWS i get
    back an error node with "ORA-01001 Invalid Cursor" error
    message.i had aslo set the setNullAttributes(true) property
    on oraclexmlquery.
    Interestingly, if i exceute the same query in the SQL plus
    it returns the column names with no rows.
    is there any way where i can get xml document with table
    structure, when there are no rows instead of ORA error message.

    Ok.
    I assume that you have for one activity several asset PNR and for one asset several activity.
    The factPNR is on this way a real bridge table. It's a way to be able to design a many-to-many relationship.
    Have a look here for more detail on how to build a many-to-many relationship :
    http://gerardnico.com/wiki/dw/data_quality/relationships#many-to-many
    Therefore I assume that you want this design :
    DimActivity -< FactActivity >- < FactPNR >- DimPNR  and you will have :
    DimActivity -< FactActivity >- < BridgeTable >- DimPNR  How to build your bridge table ?
    In the physical layer, :
    * create a new table BridgeActivityPNR, open it and select "statement"
    * enter your sql statement
    SELECT DISTINCT A.ROW_WID ACTIVIDAD_WID, B.ROW_WID ASSET_WID
    FROM W_ACTIVITY_F A,
    W_ASSET_D B,
    W_SRVREQ_D C,
    X_S_CMPT_MTRC_F D,
    X_S_ASSET_FEA_D E
    WHERE A.X_SRA_SR_ID=C.INTEGRATION_ID AND
    C.X_VLG_FLIGHT_ID=D.X_ROW_ID AND
    D.X_ROW_ID=E.X_CM_ID AND
    E.X_ASSET_ID=B.X_ROW_ID* add two columns in the column tab : ACTIVIDAD_WID and ASSET_WID
    * create the physical join with the table FactActivity and DimPNR
    * drag and drop in the business model your table BridgeActivityPNR
    * in the BMM, create the complex join like this :
    DimActivity -< FactActivity >- < BridgeTable >- DimPNR  * open your logical bridge table and check the bridge table option.
    And you are done if I didn't forget anything.
    A complete example here :
    http://gerardnico.com/wiki/dat/obiee/obiee_bridge_table

  • Modifying the sql query in doDML of entity

    I am using Jdev 11.1.1.4.0 and SQLServer Database
    I want to modify the sql query in "doDML(int operation, TransactionEvent e)"
    I could check what kind of operation like (operation == DML_UPDATE) and do some additional stuff.. But I want to edit the query because of which we entered doDML..
    I want to edit the query because when i use SQLServer database with SQLBuilder as SQL92, the update statement will have table alias like "update table <table alias>" which the SQLServer is not recognizing.. So I want to remove that alias from sql query in doDML..

    It isn't possible.
    However as per the following MSDN page a table alias is fine in an UPDATE statement so are you sure this is your problem?: http://msdn.microsoft.com/en-us/library/aa260662(v=sql.80).aspx
    CM.

  • Pinning the sql query in cache

    Hi All,
    I want to pin the sql query is cache because the physical reads are very high. Can anyone tell me steps to pin the sql query in the cache. Current version 10.2.1.0 OS : Windows.
    Reads CPU Elapsed
    Physical Reads Executions per Exec %Total Time (s) Time (s) SQL Id
    19,836 38 522.0 2.1 25.40 50.00 1r0wh3v6bayyk
    With regards
    kccrga

    Oscar,
    I've read Carys paper and a good paper it is.
    The point I was trying to get across is that there should be no rules of thumb. (par this one of course ;) )
    It all depends. Should one concentrate on reducing cpu usage on a disk-bound system? Is doing, say, 100 single-block reads from disk faster than doing 100 current mode gets?

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

Maybe you are looking for

  • RFC TO SOAP SCENARIO

    Dear Experts, I am facing the Following error for RFC to SOAP Scenario, i Tried 1. Full Cache Refresh 2.Delete and create Sender Agreement Again 3.Specifying the Program id Again yet the Scenario is not Working, could you please help me in Resolving

  • Resizing TextField objects problem

    Hi there, I am writing an AS3.0 application, which arranges TextField objects in a grid format. These may be of variable width and height, so each row/column works out how large it needs to be, by polling its contents for the largest width/height. (I

  • How to see personal hotspot

    how to set up personal hot spot in i pad 3

  • Reader 10.0 has insuff priveledges to install, running as Admin.

    I am trying to install 10.0 but continually get  "Installer has insufficeient priveledges to access this directory:   "C:\Program Files\Adobe\Acrobat\10.0\Replicate"  Installer cannot continue, Log in as Admin.. yadda yadda.. I AM the Admin user, rig

  • The Java VM terminated with a non-zero exit code.

    Hi,expert, I have got this error when I am trying to restart the sap Instance use command STARTSAP, The error log as below: ERROR => The Java VM terminated with a non-zero exit code. Please see SAP Note 940893 , section 'J2EE Engine exit codes' for a