Internal_Function

I am getting internal_function within explain plan filter section at step 17 ,18 and 22, i know it is an overhead but why it is happening how can i come to know please help
Query
select
case
when oha.org_id = '122' then 'KDD'
when oha.org_id = '82' then 'HDD'
when oha.org_id = '222' then 'SDD'
when oha.org_id = '166' then 'MDD'
when oha.org_id = '142' then 'LDD'
when oha.org_id = '182' then 'FDD'
when oha.org_id = '162' then 'IDD'
when oha.org_id = '164' then 'PDD'
when oha.org_id = '203' then 'QDD'
when oha.org_id = '262' then 'SGD'
when oha.org_id = '123' then 'KDP'
when oha.org_id = '83' then 'HDP'
when oha.org_id = '223' then 'SDP'
when oha.org_id = '167' then 'MDP'
when oha.org_id = '144' then 'LDP'
when oha.org_id = '183' then 'FDP'
when oha.org_id = '163' then 'IDP'
when oha.org_id = '165' then 'PDP'
when oha.org_id = '202' then 'QDP'
when oha.org_id = '263' then 'SGP' 
end  DEPOT_ID,
hca.account_number,
hca.account_name,
to_char(oha.order_number) order_number,
cta.trx_number,
cta.trx_date,
msi.description,
ola.shipped_quantity qty,
'Inv' Document_Type,
case
   when ola.unit_selling_price <> ola.unit_list_price and
        ola.unit_selling_price <> 0 Then
    (abs(ola.unit_list_price - ola.unit_selling_price) *
    ola.shipped_quantity)
   when ola.unit_selling_price = 0 then
    ola.unit_selling_price * ola.shipped_quantity
   when ola.unit_selling_price <> 0 and
        ola.unit_selling_price = ola.unit_list_price then
    0
   else
    ola.unit_selling_price * ola.shipped_quantity
end DIS_BON,
ola.shipped_quantity * ola.unit_list_price Amount,
case
   when ola.unit_selling_price <> ola.unit_list_price and
        ola.unit_selling_price <> 0 Then
    round((100 - (ola.unit_selling_price * 100) / ola.unit_list_price), 2) ||
    '-DISC.'
   when ola.unit_selling_price = 0 then
    'BONUS'
   else
    'SALES'
end Status
  from oe_order_headers_all      oha,
       oe_order_lines_all        ola,
       mtl_system_items_b        msi,
       ar.hz_cust_accounts       hca,
       xxpz.xxcs_depot_sds       xds,
       ra_customer_trx_all       cta,
       ra_customer_trx_lines_all ctla,
       ra_cust_trx_types_all     ctt
where oha.header_id = ola.header_id
   and oha.org_id = ola.org_id
   and ola.actual_shipment_date between &V_DATE_FROM And &V_DATE_TO
   and ola.inventory_item_id = msi.inventory_item_id
   and msi.organization_id = xds.organization_id
   and oha.org_id = xds.org_id
   and ola.org_id = xds.org_id
   and ctla.org_id = xds.org_id
   and oha.sold_to_org_id = hca.cust_account_id
   and msi.inventory_item_id = ctla.inventory_item_id
   and ola.inventory_item_id = ctla.inventory_item_id
   and ola.org_id = ctla.org_id
   and ctla.customer_trx_id = cta.customer_trx_id
   and ctla.org_id = cta.org_id
   and oha.org_id = cta.org_id
   and cta.org_id = xds.org_id
   and oha.order_number = cta.ct_reference
   and cta.cust_trx_type_id = ctt.cust_trx_type_id
   and cta.org_id = ctt.org_id
   and ctla.interface_line_attribute6 = to_char(ola.line_id)
   and substr(msi.segment1, 1, 2) = nvl(&prin, substr(msi.segment1, 1, 2))
   and msi.segment1 = nvl(null, msi.segment1)
   and ola.flow_status_code = 'CLOSED'
   and ola.line_category_code = 'ORDER'
   and ctla.description not like 'Sales%Tax%'
   and msi.enabled_flag = 'Y'
   and ctla.unit_selling_price > 0
   and ctt.name in ('Sales Invoice')
   And oha.org_id In
       ('122', '82', '222', '166', '142', '182', '162', '164', '203', '262')Plan
Plan hash value: 2797684829                                                                                                                                                                            
| Id  | Operation                            | Name                      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |                                                                  
|*  1 |  TABLE ACCESS BY INDEX ROWID         | RA_CUST_TRX_TYPES_ALL     |      1 |      1 |    598 |00:00:21.17 |     295K|  73350 |                                                                  
|   2 |   NESTED LOOPS                       |                           |      1 |      1 |   1197 |00:03:57.48 |     295K|  73350 |                                                                  
|   3 |    NESTED LOOPS                      |                           |      1 |      1 |    598 |00:00:21.14 |     295K|  73350 |                                                                  
|   4 |     NESTED LOOPS                     |                           |      1 |      1 |    600 |00:00:12.13 |     292K|  73350 |                                                                  
|   5 |      NESTED LOOPS                    |                           |      1 |      1 |    600 |00:00:12.10 |     291K|  73350 |                                                                  
|   6 |       NESTED LOOPS                   |                           |      1 |      1 |    600 |00:00:12.03 |     288K|  73335 |                                                                  
|   7 |        NESTED LOOPS                  |                           |      1 |      3 |  65351 |00:07:32.06 |   62825 |  39789 |                                                                  
|   8 |         NESTED LOOPS                 |                           |      1 |      1 |     20 |00:00:00.01 |      12 |      0 |                                                                  
|   9 |          INLIST ITERATOR             |                           |      1 |        |      1 |00:00:00.01 |       2 |      0 |                                                                  
|  10 |           TABLE ACCESS BY INDEX ROWID| XXCS_DEPOT_SDS            |      1 |     10 |      1 |00:00:00.01 |       2 |      0 |                                                                  
|* 11 |            INDEX RANGE SCAN          | XX_DPT_SDS_ORGID          |      1 |     10 |      1 |00:00:00.01 |       1 |      0 |                                                                  
|* 12 |          TABLE ACCESS BY INDEX ROWID | MTL_SYSTEM_ITEMS_B        |      1 |      1 |     20 |00:00:00.01 |      10 |      0 |                                                                  
|* 13 |           INDEX RANGE SCAN           | MTL_SYSTEM_ITEMS_B_N1     |      1 |      1 |     20 |00:00:00.01 |       4 |      0 |                                                                  
|* 14 |         TABLE ACCESS BY INDEX ROWID  | RA_CUSTOMER_TRX_LINES_ALL |     20 |     28 |  65351 |00:07:36.06 |   62813 |  39789 |                                                                  
|* 15 |          INDEX RANGE SCAN            | IDX$$_89BD0002            |     20 |   3476 |  65443 |00:00:02.08 |     344 |    281 |                                                                  
|* 16 |        TABLE ACCESS BY INDEX ROWID   | OE_ORDER_LINES_ALL        |  65351 |      1 |    600 |00:10:23.24 |     314K|  54870 |                                                                  
|* 17 |         INDEX RANGE SCAN             | IDX$$_90400002            |  65351 |      1 |  62825 |00:00:03.05 |     126K|    102 |                                                                  
|* 18 |       TABLE ACCESS BY INDEX ROWID    | OE_ORDER_HEADERS_ALL      |    600 |      1 |    600 |00:00:00.30 |    2400 |     15 |                                                                  
|* 19 |        INDEX UNIQUE SCAN             | OE_ORDER_HEADERS_U1       |    600 |      1 |    600 |00:00:00.10 |    1800 |      5 |                                                                  
|  20 |      TABLE ACCESS BY INDEX ROWID     | HZ_CUST_ACCOUNTS          |    600 |      1 |    600 |00:00:00.03 |    1800 |      0 |                                                                  
|* 21 |       INDEX UNIQUE SCAN              | HZ_CUST_ACCOUNTS_U1       |    600 |      1 |    600 |00:00:00.01 |    1200 |      0 |                                                                  
|* 22 |     TABLE ACCESS BY INDEX ROWID      | RA_CUSTOMER_TRX_ALL       |    600 |      1 |    598 |00:00:00.03 |    2400 |      0 |                                                                  
|* 23 |      INDEX UNIQUE SCAN               | RA_CUSTOMER_TRX_U1        |    600 |      1 |    600 |00:00:00.01 |    1800 |      0 |                                                                  
|* 24 |    INDEX RANGE SCAN                  | IDX$$_78250003            |    598 |      1 |    598 |00:00:00.01 |      12 |      0 |                                                                  
Predicate Information (identified by operation id):                                                                                                                                                    
   1 - filter("CTA"."CUST_TRX_TYPE_ID"="CTT"."CUST_TRX_TYPE_ID")                                                                                                                                       
  11 - access(("XDS"."ORG_ID"=82 OR "XDS"."ORG_ID"=122 OR "XDS"."ORG_ID"=142 OR "XDS"."ORG_ID"=162 OR "XDS"."ORG_ID"=164 OR                                                                            
              "XDS"."ORG_ID"=166 OR "XDS"."ORG_ID"=182 OR "XDS"."ORG_ID"=203 OR "XDS"."ORG_ID"=222 OR "XDS"."ORG_ID"=262))                                                                             
  12 - filter("MSI"."ENABLED_FLAG"='Y')                                                                                                                                                                
  13 - access("MSI"."ORGANIZATION_ID"="XDS"."ORGANIZATION_ID")                                                                                                                                         
       filter(("MSI"."SEGMENT1"=NVL(NULL,"MSI"."SEGMENT1") AND                                                                                                                                         
              SUBSTR("MSI"."SEGMENT1",1,2)=NVL('10',SUBSTR("MSI"."SEGMENT1",1,2))))                                                                                                                    
  14 - filter(("CTLA"."DESCRIPTION" NOT LIKE 'Sales%Tax%' AND "CTLA"."UNIT_SELLING_PRICE">0))                                                                                                          
  15 - access("MSI"."INVENTORY_ITEM_ID"="CTLA"."INVENTORY_ITEM_ID" AND "CTLA"."ORG_ID"="XDS"."ORG_ID")                                                                                                 
       filter(("CTLA"."INVENTORY_ITEM_ID" IS NOT NULL AND INTERNAL_FUNCTION("CTLA"."ORG_ID")))                                                                                                         
  16 - filter(("OLA"."ACTUAL_SHIPMENT_DATE">=TO_DATE('2012-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND                                                                                               
              "OLA"."LINE_CATEGORY_CODE"='ORDER' AND "OLA"."FLOW_STATUS_CODE"='CLOSED' AND                                                                                                             
              "OLA"."ACTUAL_SHIPMENT_DATE"<=TO_DATE('2012-01-10 00:00:00', 'yyyy-mm-dd hh24:mi:ss')))                                                                                                  
  17 - access("OLA"."INVENTORY_ITEM_ID"="CTLA"."INVENTORY_ITEM_ID" AND "OLA"."ORG_ID"="CTLA"."ORG_ID" AND                                                                                              
              "CTLA"."INTERFACE_LINE_ATTRIBUTE6"="OLA"."SYS_NC00352$")                                                                                                                                 
       filter((INTERNAL_FUNCTION("OLA"."ORG_ID") AND "OLA"."INVENTORY_ITEM_ID"="MSI"."INVENTORY_ITEM_ID" AND                                                                                           
              "OLA"."ORG_ID"="XDS"."ORG_ID"))                                                                                                                                                          
  18 - filter((INTERNAL_FUNCTION("OHA"."ORG_ID") AND "OHA"."ORG_ID"="OLA"."ORG_ID" AND "OHA"."ORG_ID"="XDS"."ORG_ID"))                                                                                 
  19 - access("OHA"."HEADER_ID"="OLA"."HEADER_ID")                                                                                                                                                     
  21 - access("OHA"."SOLD_TO_ORG_ID"="HCA"."CUST_ACCOUNT_ID")                                                                                                                                          
  22 - filter((INTERNAL_FUNCTION("CTA"."ORG_ID") AND "CTLA"."ORG_ID"="CTA"."ORG_ID" AND "OHA"."ORG_ID"="CTA"."ORG_ID" AND                                                                              
              "CTA"."ORG_ID"="XDS"."ORG_ID" AND "OHA"."ORDER_NUMBER"=TO_NUMBER("CTA"."CT_REFERENCE")))                                                                                                 
  23 - access("CTLA"."CUSTOMER_TRX_ID"="CTA"."CUSTOMER_TRX_ID")                                                                                                                                        
  24 - access("CTA"."ORG_ID"="CTT"."ORG_ID" AND "CTT"."NAME"='Sales Invoice')                                                                                                                          
       filter(("CTT"."ORG_ID"=82 OR "CTT"."ORG_ID"=122 OR "CTT"."ORG_ID"=142 OR "CTT"."ORG_ID"=162 OR "CTT"."ORG_ID"=164 OR                                                                            
              "CTT"."ORG_ID"=166 OR "CTT"."ORG_ID"=182 OR "CTT"."ORG_ID"=203 OR "CTT"."ORG_ID"=222 OR "CTT"."ORG_ID"=262))                                                                             
73 rows selected.

>
I am getting internal_function within explain plan filter section at step 17 ,18 and 22, i know it is an overhead but why it is happening how can i come to know please help
>
That is just how Oracle is processing your IN clause
oha.org_id In
       ('122', '82', '222', '166', '142', '182', '162', '164', '203', '262')It caches' those hard-coded values in a hash table and uses an internal function to implement the 'IN' part of your query by using 'oha.orgid' as the search parameter to the hash table.
Nothing to worry about from a performance issue unless maybe you had hundreds or thousands of hard-coded values for the IN clause. Even then a hash table is far quicker that accessing a real table.

Similar Messages

  • INTERNAL_FUNCTION for IN List 11.2.0.2

    deleting this thread..
    Edited by: OraDBA02 on Oct 3, 2012 2:31 PM

    >
    Why would a histogram list show any of a large number of values that may not exist?
    >
    Why would I have any way of knowing what data exists and what doesn't? I'm pointing out the lack of a histogram for a value that is being used by the query so OP can comment on whether there are any values or not.
    Data posted by OP appears to show 100 million rows and 15 distinct values for SW_OPERATION but there are only 11 histogram buckets. That seems a little odd to me so would like OP to explain why the other 4 values have no histograms. The total for the 11 buckets posted is tiny compared to 100 million.
    One possible thing for OP to test is using ONLY filters that have histograms and a query that uses an index instead of a FTS.
    >
    And a nitpick, if any partitioning key is involved with changing a column, that will err.
    >
    Can you post the code that you tested with and the error you got?
    This code works just fine for me. Table is one from another forum question I had lying around - date data should not be stored this way
    CREATE TABLE SCOTT.FOO1
      EVENT_TIME  VARCHAR2(18 BYTE),
      EVENT_ID  NUMBER(38)
    PARTITION BY RANGE (EVENT_TIME)
      PARTITION EVT_2011 VALUES LESS THAN ('20120101000000'), 
      PARTITION EVT_201201 VALUES LESS THAN ('20120201000000'), 
      PARTITION EVT_201202 VALUES LESS THAN ('20120301000000')
    INSERT INTO FOO1 VALUES('20120100000000', 1)
    INSERT INTO FOO1 VALUES ('20120200000000', 2)
    INSERT INTO FOO1 VALUES ('20120300000000', 3)
    COMMIT
    alter table foo1 modify (event_time varchar2(18 char))
    alter table foo1 modify (event_time varchar2(18 byte))I don't get any errors. I did not test with either global or local indexes.

  • HELP TO TUNE THIS QUERY

    Hi,
    I'm using below query in procedure.It's taking more more time can some one help to tune this query or advice to rewrite the query.
    Databse :10.1
    SELECT   'Reading Comprehension' TEST_NAME,T.TEST_END_DATE TEST_SESSION_DATE,
            C.POOL_VERSION_ID, I.CREATED_ON POOL_CREATED_DT,
            C.ITEM_ID, C.ITEM_RESPONSE_ID, S.STUDENT_ID_PK, C.RESPONSE_KEY, C.IS_CORRECT RESPONSE_IS_CORRECT,
            T.SCORE SCALE_SCORE, C.RESPONSE_DURATION, P.ITEM_KEY,
            T.TEST_SESSION_DETAIL_ID, SYSDATE CREATED_ON
           -- BULK COLLECT INTO TV_PSYCHO_DET
            FROM
            CAT_ITEM_PARAMETER P, CAT_ITEM_USER_RESPONSE C, TEST_SESSION_DETAIL T,
            TEST_SESSION S, ITEM_POOL_VERSION I, TEST_DETAIL D
            ,INSTITUTION E
            WHERE  TRUNC(T.TEST_END_DATE) BETWEEN TO_DATE('01-11-09','dd-mm-yy') AND TO_DATE('30-11-09','dd-mm-yy')
            AND D.TEST_NAME =  'Reading Comprehension'
            AND T.TEST_SESSION_STATUS_ID = 3
            AND I.POOL_AVAILABILITY='Y'
            AND P.PRETEST=0 AND C.RESTART_FLAG=0
            AND T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
            AND S.TEST_SESSION_ID = T.TEST_SESSION_ID
            AND C.TEST_SESSION_DETAIL_ID = T.TEST_SESSION_DETAIL_ID
            AND S.INSTITUTION_ID=E.INSTITUTION_ID
            AND SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3) <> '000'
            AND I.ITEM_ID = C.ITEM_ID
            AND P.ITEM_ID = I.ITEM_ID;expln plan
    Plan hash value: 3712814491                                                                                                      
    | Id  | Operation                                 | Name                        | Rows  | Bytes | Cost (%CPU)| Time     | Pstart|
    Pstop |                                                                                                                          
    |   0 | SELECT STATEMENT                          |                             | 50857 |  7151K| 93382   (1)| 00:18:41 |       |
          |                                                                                                                          
    |*  1 |  FILTER                                   |                             |       |       |            |          |       |
          |                                                                                                                          
    |*  2 |   HASH JOIN                               |                             | 50857 |  7151K| 93382   (1)| 00:18:41 |       |
          |                                                                                                                          
    |   3 |    PARTITION HASH ALL                     |                             |  2312 | 23120 |    25   (0)| 00:00:01 |     1 |
        5 |                                                                                                                          
    |*  4 |     TABLE ACCESS FULL                     | CAT_ITEM_PARAMETER          |  2312 | 23120 |    25   (0)| 00:00:01 |     1 |
        5 |                                                                                                                          
    |*  5 |    HASH JOIN                              |                             | 94938 |    12M| 93356   (1)| 00:18:41 |       |
          |                                                                                                                          
    |*  6 |     TABLE ACCESS FULL                     | ITEM_POOL_VERSION           |  9036 |   132K|    30   (0)| 00:00:01 |       |
          |                                                                                                                          
    |*  7 |     TABLE ACCESS BY GLOBAL INDEX ROWID    | CAT_ITEM_USER_RESPONSE      |     9 |   279 |    18   (0)| 00:00:01 | ROWID |
    ROWID |                                                                                                                          
    |   8 |      NESTED LOOPS                         |                             | 45349 |  5270K| 93325   (1)| 00:18:40 |       |
          |                                                                                                                          
    |*  9 |       HASH JOIN                           |                             |  4923 |   423K| 11377   (1)| 00:02:17 |       |
          |                                                                                                                          
    |* 10 |        INDEX FAST FULL SCAN               | INSTI_ID_NAME_COUN_DISP_IDX |  8165 |   111K|    18   (0)| 00:00:01 |       |
          |                                                                                                                          
    |* 11 |        HASH JOIN                          |                             |  4923 |   355K| 11359   (1)| 00:02:17 |       |
          |                                                                                                                          
    |* 12 |         TABLE ACCESS BY GLOBAL INDEX ROWID| TEST_SESSION_DETAIL         |  4107 |   148K|  6804   (1)| 00:01:22 | ROWID |
    ROWID |                                                                                                                          
    |  13 |          NESTED LOOPS                     |                             |  4923 |   278K|  6806   (1)| 00:01:22 |       |
          |                                                                                                                          
    |* 14 |           INDEX RANGE SCAN                | TEST_DETAIL_AK_1            |     1 |    21 |     2   (0)| 00:00:01 |       |
          |                                                                                                                          
    |* 15 |           INDEX RANGE SCAN                | TEST_SESSION_DETAIL_FK2_I   | 39737 |       |   102   (0)| 00:00:02 |       |
          |                                                                                                                          
    |  16 |         PARTITION HASH ALL                |                             |  1672K|    25M|  4546   (1)| 00:00:55 |     1 |
        5 |                                                                                                                          
    |  17 |          TABLE ACCESS FULL                | TEST_SESSION                |  1672K|    25M|  4546   (1)| 00:00:55 |     1 |
        5 |                                                                                                                          
    |* 18 |       INDEX RANGE SCAN                    | CAT_ITEM_USER_RESP_IDX1     |    18 |       |     3   (0)| 00:00:01 |       |
          |                                                                                                                          
    Predicate Information (identified by operation id):                                                                              
       1 - filter(TO_DATE('01-11-09','dd-mm-yy')<=TO_DATE('30-11-09','dd-mm-yy'))                                                    
       2 - access("P"."ITEM_ID"="I"."ITEM_ID")                                                                                       
       4 - filter("P"."PRETEST"=0)                                                                                                   
       5 - access("I"."ITEM_ID"="C"."ITEM_ID")                                                                                       
       6 - filter("I"."POOL_AVAILABILITY"='Y')                                                                                       
       7 - filter(TO_NUMBER("C"."RESTART_FLAG")=0)                                                                                   
       9 - access("S"."INSTITUTION_ID"="E"."INSTITUTION_ID")                                                                         
      10 - filter(SUBSTR("E"."INSTITUTION_ID_DISPLAY",8,3)<>'000')                                                                   
      11 - access("S"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")                                                                       
      12 - filter(TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))>=TO_DATE('01-11-09','dd-mm-yy') AND "T"."TEST_SESSION_STATUS_ID"=3   
                  AND TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))<=TO_DATE('30-11-09','dd-mm-yy'))                                 
      14 - access("D"."TEST_NAME"='Reading Comprehension')                                                                           
      15 - access("T"."TEST_DETAIL_ID"="D"."TEST_DETAIL_ID")                                                                         
      18 - access("C"."TEST_SESSION_DETAIL_ID"="T"."TEST_SESSION_DETAIL_ID")                                                         
    43 rows selected.Edited by: user575115 on Dec 18, 2009 12:31 AM

    When you see something like ...
       7 - filter(TO_NUMBER("C"."RESTART_FLAG")=0)                                                                                    It means that Oracle had to do a conversion for you since you aren't using the proper data type in your query.
    That would mean IF there is an index on that column, it won't be useable...

  • Can I write this query in another way (prefferably in optimized manner)

    My database version._
    [oracle@localhost ~]$ uname -a
    Linux localhost.localdomain 2.6.18-194.17.1.0.1.el5 #1 SMP Wed Sep 29 15:40:03 EDT 2010 i686 i686 i386 GNU/Linux
    [oracle@localhost ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on Fri Aug 12 04:44:21 2011
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL>
    Introduction to data and logic._
    I have on table called inv_leg_dummy. The main columns to consider is arrival_airport and departure_airport. Say a flight starts from kolkata (KOL) -> Goes to Dellhi (DEL) -> Goes to Hongkong (HKG) -> Goes to Tiwan (TPE). So in total KOL -> DEL -> HKG -> TPE
    Data will be like:
    Arrival Airport         Departure Airport
    HKG                       TPE
    KOL                       DEL
    DEL                       HKGPlease note that the order is not as expected, that means the flight starts from kolkata can not be determined straight way from the arrangment or any kind of flag.
    The main logic is, I first take Arrival Airport HKG and see if any Departure Airport exists as HKG, then I take the next KOL and see if any Departure Airport exists as KOL. You can notice KOL is only present as arrival airport, So, This is the first leg of the flight journey. By the same logic, I can determine next leg, that is DEL (because flight goes from KOL to DEL)...
    I need output like :
    ARRIVAL_AIRPORT     DEPARTURE_AIRPORT     SEQ
    HKG                  TPE              1
    DEL                  HKG              2
    KOL                  DEL              3
                      KOL              4So, The starting point KOL has heighest sequence (arrival is null), then KOL to DEL, DEL to HKG and finally HKG to TPE (sequence 1). The sequence may look like reverse order.
    Create Table and Insert Scripts._
    CREATE TABLE inv_leg_dummy
      carrier              VARCHAR2(3) not null,
      flt_num              VARCHAR2(4) not null,
      flt_num_suffix       VARCHAR2(1) default ' ' not null,
      flt_date             DATE not null,
      arrival_airport              VARCHAR2(5),
      departure_airport              VARCHAR2(5) not null
    alter table inv_leg_dummy
      add constraint XPKINV_LEG primary key (carrier,flt_num,flt_num_suffix,flt_date,departure_airport);
    TRUNCATE table inv_leg_dummy; 
    INSERT INTO inv_leg_dummy VALUES ('KA',1,' ',to_date('05/23/2011','mm/dd/rrrr'),'HKG','TPE');
    INSERT INTO inv_leg_dummy VALUES ('KA',1,' ',to_date('05/23/2011','mm/dd/rrrr'),'KOL','DEL');
    INSERT INTO inv_leg_dummy VALUES ('KA',1,' ',to_date('05/23/2011','mm/dd/rrrr'),'DEL','HKG');
    INSERT INTO inv_leg_dummy VALUES ('CX',1,' ',to_date('05/22/2011','mm/dd/rrrr'),'HKG','BNE');
    INSERT INTO inv_leg_dummy VALUES ('CX',1,' ',to_date('05/22/2011','mm/dd/rrrr'),'BNE','CNS');
    Now, it time to show you, What I have done!_
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT Carrier,
      2         Flt_Num,
      3         Flt_Date,
      4         Flt_num_Suffix,
      5         arrival_airport,
      6         departure_airport,
      7         RANK() OVER(partition by Carrier, Flt_Num, Flt_Date, Flt_num_Suffix ORDER BY Carrier, Flt_Num, Flt_Date, Flt_num_Suffix, SEQ ASC NULLS LAST) SEQ,
      8         /* Fetching Maximum leg Seq No excluding Dummy Leg*/
      9         max(seq) over(partition by carrier, flt_num, flt_date, flt_num_suffix order by carrier, flt_num, flt_date, flt_num_suffix) max_seq
    10    FROM (SELECT k.Carrier,
    11                 k.Flt_Num,
    12                 k.Flt_Date,
    13                 k.Flt_num_Suffix,
    14                 k.departure_airport,
    15                 k.arrival_airport,
    16                 level seq
    17            FROM (SELECT
    18                   l.Carrier,
    19                   l.Flt_Num,
    20                   l.Flt_Date,
    21                   l.Flt_num_Suffix,
    22                   l.departure_airport,
    23                   l.arrival_airport
    24                    FROM inv_leg_dummy l) k
    25           START WITH k.departure_airport = case when
    26           (select count(*)
    27                         FROM inv_leg_dummy ifl
    28                        WHERE ifl.arrival_airport = k.departure_airport
    29                          AND ifl.flt_num = k.flt_num
    30                          AND ifl.carrier = k.carrier
    31                          AND ifl.flt_num_suffix = k.Flt_num_Suffix) = 0 then k.departure_airport end
    32          CONNECT BY prior k.arrival_airport = k.departure_airport
    33                 AND prior k.carrier = k.carrier
    34                 AND prior k.flt_num = k.flt_num
    35                 AND prior TRUNC(k.flt_date) =
    36                                                TRUNC(k.flt_date)
    37          UNION ALL
    38          /* Fetching Dummy Last Leg Information for Leg_Seq No*/
    39          SELECT ofl.Carrier,
    40                 ofl.Flt_Num,
    41                 ofl.Flt_Date,
    42                 ofl.Flt_num_Suffix,
    43                 ofl.arrival_airport as departure_airport,
    44                 NULL arrival_airport,
    45                 NULL seq
    46            FROM inv_leg_dummy ofl
    47           where NOT EXISTS (SELECT 1
    48                    FROM inv_leg_dummy ifl
    49                   WHERE ofl.arrival_airport = ifl.departure_airport
    50                     AND ifl.flt_num = ofl.flt_num
    51                     AND ifl.carrier = ofl.carrier
    52                     AND ifl.flt_num_suffix =ofl.Flt_num_Suffix))
    53*  ORDER BY 1, 2, 3, 4,7
    SQL> /
    CAR FLT_ FLT_DATE  F ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1    22-MAY-11   BNE   CNS            1          2
    CX  1    22-MAY-11   HKG   BNE            2          2
    CX  1    22-MAY-11         HKG            3          2
    KA  1    23-MAY-11   HKG   TPE            1          3
    KA  1    23-MAY-11   DEL   HKG            2          3
    KA  1    23-MAY-11   KOL   DEL            3          3
    KA  1    23-MAY-11         KOL            4          3
    7 rows selected.
    SQL> The code is giving the right output, But I feel, I have done it in a hard way. Is there any easier/optimized approach to solve the problem ?

    Hello
    I thought I'd run run all 3 methods twice with autotrace to get an overview of the execution plans and basic performance metrics. The results are interesting.
    OPs method
    SQL> set autot on
    SQL> SELECT Carrier,
      2           Flt_Num,
      3           Flt_Date,
      4           Flt_num_Suffix,
      5           arrival_airport,
      6           departure_airport,
      7           RANK() OVER(partition by Carrier, Flt_Num, Flt_Date, Flt_num_Suffix ORDER BY Carrier, Flt_Num,
    53   ORDER BY 1, 2, 3, 4,7
    54  /
    CAR FLT_ FLT_DATE  F ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1    22-MAY-11   BNE   CNS            1          2
    CX  1    22-MAY-11   HKG   BNE            2          2
    CX  1    22-MAY-11         HKG            3          2
    KA  1    23-MAY-11   HKG   TPE            1          3
    KA  1    23-MAY-11   DEL   HKG            2          3
    KA  1    23-MAY-11   KOL   DEL            3          3
    KA  1    23-MAY-11         KOL            4          3
    7 rows selected.
    Execution Plan
    Plan hash value: 3680289985
    | Id  | Operation                         | Name          |
    |   0 | SELECT STATEMENT                  |               |
    |   1 |  WINDOW SORT                      |               |
    |   2 |   VIEW                            |               |
    |   3 |    UNION-ALL                      |               |
    |*  4 |     CONNECT BY WITH FILTERING     |               |
    |*  5 |      FILTER                       |               |
    |*  6 |       TABLE ACCESS FULL           | INV_LEG_DUMMY |
    |   7 |       SORT AGGREGATE              |               |
    |*  8 |        TABLE ACCESS BY INDEX ROWID| INV_LEG_DUMMY |
    |*  9 |         INDEX RANGE SCAN          | XPKINV_LEG    |
    |  10 |      NESTED LOOPS                 |               |
    |  11 |       CONNECT BY PUMP             |               |
    |  12 |       TABLE ACCESS BY INDEX ROWID | INV_LEG_DUMMY |
    |* 13 |        INDEX RANGE SCAN           | XPKINV_LEG    |
    |* 14 |     FILTER                        |               |
    |  15 |      TABLE ACCESS FULL            | INV_LEG_DUMMY |
    |* 16 |      INDEX RANGE SCAN             | XPKINV_LEG    |
    Predicate Information (identified by operation id):
       4 - access("L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPORT" AND
                  "L"."CARRIER"=PRIOR "L"."CARRIER" AND "L"."FLT_NUM"=PRIOR "L"."FLT
    _NUM"
                  AND INTERNAL_FUNCTION(PRIOR TRUNC(INTERNAL_FUNCTION("L"."FLT_DATE"
    )))=TR
                  UNC(INTERNAL_FUNCTION("L"."FLT_DATE")))
       5 - filter("L"."DEPARTURE_AIRPORT"=CASE  WHEN ( (SELECT COUNT(*)
                  FROM "INV_LEG_DUMMY" "IFL" WHERE "IFL"."FLT_NUM_SUFFIX"=:B1 AND
                  "IFL"."FLT_NUM"=:B2 AND "IFL"."CARRIER"=:B3 AND
                  "IFL"."ARRIVAL_AIRPORT"=:B4)=0) THEN "L"."DEPARTURE_AIRPORT" END )
       6 - access("L"."CARRIER"=PRIOR "L"."CARRIER")
       8 - filter("IFL"."ARRIVAL_AIRPORT"=:B1)
       9 - access("IFL"."CARRIER"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."FLT_NUM_SUFFIX"=:B3)
      13 - access("L"."CARRIER"=PRIOR "L"."CARRIER" AND "L"."FLT_NUM"=PRIOR
                  "L"."FLT_NUM" AND "L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPO
    RT")
           filter("L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPORT" AND
                  INTERNAL_FUNCTION(PRIOR TRUNC(INTERNAL_FUNCTION("L"."FLT_DATE")))=
    TRUNC(
                  INTERNAL_FUNCTION("L"."FLT_DATE")))
      14 - filter( NOT EXISTS (SELECT 0 FROM "INV_LEG_DUMMY" "IFL" WHERE
                  "IFL"."FLT_NUM_SUFFIX"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."CARRIER"=:B3 AND "IFL"."DEPARTURE_AIRPORT"=:B4))
      16 - access("IFL"."CARRIER"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."FLT_NUM_SUFFIX"=:B3 AND "IFL"."DEPARTURE_AIRPORT"=:B4)
           filter("IFL"."DEPARTURE_AIRPORT"=:B1)
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
              1  recursive calls
              0  db block gets
             33  consistent gets
              0  physical reads
              0  redo size
            877  bytes sent via SQL*Net to client
            886  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
              7  rows processed
    SQL> /
    CAR FLT_ FLT_DATE  F ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1    22-MAY-11   BNE   CNS            1          2
    CX  1    22-MAY-11   HKG   BNE            2          2
    CX  1    22-MAY-11         HKG            3          2
    KA  1    23-MAY-11   HKG   TPE            1          3
    KA  1    23-MAY-11   DEL   HKG            2          3
    KA  1    23-MAY-11   KOL   DEL            3          3
    KA  1    23-MAY-11         KOL            4          3
    7 rows selected.
    Execution Plan
    Plan hash value: 3680289985
    | Id  | Operation                         | Name          |
    |   0 | SELECT STATEMENT                  |               |
    |   1 |  WINDOW SORT                      |               |
    |   2 |   VIEW                            |               |
    |   3 |    UNION-ALL                      |               |
    |*  4 |     CONNECT BY WITH FILTERING     |               |
    |*  5 |      FILTER                       |               |
    |*  6 |       TABLE ACCESS FULL           | INV_LEG_DUMMY |
    |   7 |       SORT AGGREGATE              |               |
    |*  8 |        TABLE ACCESS BY INDEX ROWID| INV_LEG_DUMMY |
    |*  9 |         INDEX RANGE SCAN          | XPKINV_LEG    |
    |  10 |      NESTED LOOPS                 |               |
    |  11 |       CONNECT BY PUMP             |               |
    |  12 |       TABLE ACCESS BY INDEX ROWID | INV_LEG_DUMMY |
    |* 13 |        INDEX RANGE SCAN           | XPKINV_LEG    |
    |* 14 |     FILTER                        |               |
    |  15 |      TABLE ACCESS FULL            | INV_LEG_DUMMY |
    |* 16 |      INDEX RANGE SCAN             | XPKINV_LEG    |
    Predicate Information (identified by operation id):
       4 - access("L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPORT" AND
                  "L"."CARRIER"=PRIOR "L"."CARRIER" AND "L"."FLT_NUM"=PRIOR "L"."FLT
    _NUM"
                  AND INTERNAL_FUNCTION(PRIOR TRUNC(INTERNAL_FUNCTION("L"."FLT_DATE"
    )))=TR
                  UNC(INTERNAL_FUNCTION("L"."FLT_DATE")))
       5 - filter("L"."DEPARTURE_AIRPORT"=CASE  WHEN ( (SELECT COUNT(*)
                  FROM "INV_LEG_DUMMY" "IFL" WHERE "IFL"."FLT_NUM_SUFFIX"=:B1 AND
                  "IFL"."FLT_NUM"=:B2 AND "IFL"."CARRIER"=:B3 AND
                  "IFL"."ARRIVAL_AIRPORT"=:B4)=0) THEN "L"."DEPARTURE_AIRPORT" END )
       6 - access("L"."CARRIER"=PRIOR "L"."CARRIER")
       8 - filter("IFL"."ARRIVAL_AIRPORT"=:B1)
       9 - access("IFL"."CARRIER"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."FLT_NUM_SUFFIX"=:B3)
      13 - access("L"."CARRIER"=PRIOR "L"."CARRIER" AND "L"."FLT_NUM"=PRIOR
                  "L"."FLT_NUM" AND "L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPO
    RT")
           filter("L"."DEPARTURE_AIRPORT"=PRIOR "L"."ARRIVAL_AIRPORT" AND
                  INTERNAL_FUNCTION(PRIOR TRUNC(INTERNAL_FUNCTION("L"."FLT_DATE")))=
    TRUNC(
                  INTERNAL_FUNCTION("L"."FLT_DATE")))
      14 - filter( NOT EXISTS (SELECT 0 FROM "INV_LEG_DUMMY" "IFL" WHERE
                  "IFL"."FLT_NUM_SUFFIX"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."CARRIER"=:B3 AND "IFL"."DEPARTURE_AIRPORT"=:B4))
      16 - access("IFL"."CARRIER"=:B1 AND "IFL"."FLT_NUM"=:B2 AND
                  "IFL"."FLT_NUM_SUFFIX"=:B3 AND "IFL"."DEPARTURE_AIRPORT"=:B4)
           filter("IFL"."DEPARTURE_AIRPORT"=:B1)
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
              0  recursive calls
              0  db block gets
             33  consistent gets
              0  physical reads
              0  redo size
            877  bytes sent via SQL*Net to client
            886  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
              7  rows processedMy method
    SQL> SELECT
      2      carrier,
      3      flt_num,
      4      flt_num_suffix,
      5      flt_date,
      6      arrival_airport,
      7      departure_airport,
      8      COUNT(*) OVER(PARTITION BY carrier,
      9                                  flt_num
    10                    ) - LEVEL + 1  seq,
    11      COUNT(*) OVER(PARTITION BY carrier,
    12                                  flt_num
    13                    )  - 1        max_seq
    57  /
    CAR FLT_ F FLT_DATE  ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1      22-MAY-11 BNE   CNS            1          2
    CX  1      22-MAY-11 HKG   BNE            2          2
    CX  1      22-MAY-11       HKG            3          2
    KA  1      23-MAY-11 HKG   TPE            1          3
    KA  1      23-MAY-11 DEL   HKG            2          3
    KA  1      23-MAY-11 KOL   DEL            3          3
    KA  1      23-MAY-11       KOL            4          3
    7 rows selected.
    Execution Plan
    Plan hash value: 921778235
    | Id  | Operation                                 | Name          |
    |   0 | SELECT STATEMENT                          |               |
    |   1 |  SORT ORDER BY                            |               |
    |   2 |   WINDOW SORT                             |               |
    |*  3 |    CONNECT BY NO FILTERING WITH START-WITH|               |
    |   4 |     COUNT                                 |               |
    |   5 |      VIEW                                 |               |
    |   6 |       UNION-ALL                           |               |
    |   7 |        TABLE ACCESS FULL                  | INV_LEG_DUMMY |
    |*  8 |        FILTER                             |               |
    |   9 |         TABLE ACCESS FULL                 | INV_LEG_DUMMY |
    |* 10 |         INDEX RANGE SCAN                  | XPKINV_LEG    |
    Predicate Information (identified by operation id):
       3 - access("ARRIVAL_AIRPORT"=PRIOR "DEPARTURE_AIRPORT" AND
                  "CARRIER"=PRIOR "CARRIER" AND "FLT_NUM"=PRIOR "FLT_NUM" AND
                  TRUNC(INTERNAL_FUNCTION("FLT_DATE"))=INTERNAL_FUNCTION(PRIOR
                  TRUNC(INTERNAL_FUNCTION("FLT_DATE"))))
           filter("ARRIVAL_AIRPORT" IS NULL)
       8 - filter( NOT EXISTS (SELECT 0 FROM "INV_LEG_DUMMY" "DL" WHERE
                  "DL"."FLT_NUM"=:B1 AND "DL"."CARRIER"=:B2 AND
                  "DL"."DEPARTURE_AIRPORT"=:B3 AND "DL"."FLT_DATE"=:B4))
      10 - access("DL"."CARRIER"=:B1 AND "DL"."FLT_NUM"=:B2 AND
                  "DL"."FLT_DATE"=:B3 AND "DL"."DEPARTURE_AIRPORT"=:B4)
           filter("DL"."DEPARTURE_AIRPORT"=:B1 AND "DL"."FLT_DATE"=:B2)
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
              1  recursive calls
              0  db block gets
             19  consistent gets
              0  physical reads
              0  redo size
            877  bytes sent via SQL*Net to client
            338  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              7  rows processed
    SQL> /
    CAR FLT_ F FLT_DATE  ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1      22-MAY-11 BNE   CNS            1          2
    CX  1      22-MAY-11 HKG   BNE            2          2
    CX  1      22-MAY-11       HKG            3          2
    KA  1      23-MAY-11 HKG   TPE            1          3
    KA  1      23-MAY-11 DEL   HKG            2          3
    KA  1      23-MAY-11 KOL   DEL            3          3
    KA  1      23-MAY-11       KOL            4          3
    7 rows selected.
    Execution Plan
    Plan hash value: 921778235
    | Id  | Operation                                 | Name          |
    |   0 | SELECT STATEMENT                          |               |
    |   1 |  SORT ORDER BY                            |               |
    |   2 |   WINDOW SORT                             |               |
    |*  3 |    CONNECT BY NO FILTERING WITH START-WITH|               |
    |   4 |     COUNT                                 |               |
    |   5 |      VIEW                                 |               |
    |   6 |       UNION-ALL                           |               |
    |   7 |        TABLE ACCESS FULL                  | INV_LEG_DUMMY |
    |*  8 |        FILTER                             |               |
    |   9 |         TABLE ACCESS FULL                 | INV_LEG_DUMMY |
    |* 10 |         INDEX RANGE SCAN                  | XPKINV_LEG    |
    Predicate Information (identified by operation id):
       3 - access("ARRIVAL_AIRPORT"=PRIOR "DEPARTURE_AIRPORT" AND
                  "CARRIER"=PRIOR "CARRIER" AND "FLT_NUM"=PRIOR "FLT_NUM" AND
                  TRUNC(INTERNAL_FUNCTION("FLT_DATE"))=INTERNAL_FUNCTION(PRIOR
                  TRUNC(INTERNAL_FUNCTION("FLT_DATE"))))
           filter("ARRIVAL_AIRPORT" IS NULL)
       8 - filter( NOT EXISTS (SELECT 0 FROM "INV_LEG_DUMMY" "DL" WHERE
                  "DL"."FLT_NUM"=:B1 AND "DL"."CARRIER"=:B2 AND
                  "DL"."DEPARTURE_AIRPORT"=:B3 AND "DL"."FLT_DATE"=:B4))
      10 - access("DL"."CARRIER"=:B1 AND "DL"."FLT_NUM"=:B2 AND
                  "DL"."FLT_DATE"=:B3 AND "DL"."DEPARTURE_AIRPORT"=:B4)
           filter("DL"."DEPARTURE_AIRPORT"=:B1 AND "DL"."FLT_DATE"=:B2)
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
              0  recursive calls
              0  db block gets
             19  consistent gets
              0  physical reads
              0  redo size
            877  bytes sent via SQL*Net to client
            338  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              7  rows processedSalim Chelabi's method
    SQL> WITH t AS
      2       (SELECT     k.*, LEVEL lvl
      3              FROM inv_leg_dummy k
      4        CONNECT BY PRIOR k.arrival_airport = k.departure_airport
      5               AND PRIOR k.flt_date = k.flt_date
      6               AND PRIOR k.carrier = k.carrier
      7               AND PRIOR k.flt_num = k.flt_num)
      8  SELECT   carrier, flt_num, flt_num_suffix, flt_date, arrival_airport,
      9           departure_airport, MAX (lvl) seq,
    10           MAX (MAX (lvl)) OVER (PARTITION BY carrier, flt_num, flt_num_suffix)
    11                                                                        max_seq
    12      FROM t
    13  GROUP BY carrier,
    14           flt_num,
    15           flt_num_suffix,
    16           flt_date,
    17           arrival_airport,
    18           departure_airport
    19  UNION ALL
    20  SELECT   carrier, flt_num, flt_num_suffix, flt_date, NULL,
    21           MAX (arrival_airport), MAX (lvl) + 1 seq, MAX (lvl) max_seq
    22      FROM t
    23  GROUP BY carrier, flt_num, flt_num_suffix, flt_date
    24  ORDER BY 1, 2, 3, seq, arrival_airport NULLS LAST;
    CAR FLT_ F FLT_DATE            ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1      22/05/2011 00:00:00 BNE   CNS            1          2
    CX  1      22/05/2011 00:00:00 HKG   BNE            2          2
    CX  1      22/05/2011 00:00:00       HKG            3          2
    KA  1      23/05/2011 00:00:00 HKG   TPE            1          3
    KA  1      23/05/2011 00:00:00 DEL   HKG            2          3
    KA  1      23/05/2011 00:00:00 KOL   DEL            3          3
    KA  1      23/05/2011 00:00:00       KOL            4          3
    7 rows selected.
    Elapsed: 00:00:00.01
    Execution Plan
    Plan hash value: 2360206974
    | Id  | Operation                      | Name                        |
    |   0 | SELECT STATEMENT               |                             |
    |   1 |  TEMP TABLE TRANSFORMATION     |                             |
    |   2 |   LOAD AS SELECT               |                             |
    |*  3 |    CONNECT BY WITHOUT FILTERING|                             |
    |   4 |     TABLE ACCESS FULL          | INV_LEG_DUMMY               |
    |   5 |   SORT ORDER BY                |                             |
    |   6 |    UNION-ALL                   |                             |
    |   7 |     WINDOW BUFFER              |                             |
    |   8 |      SORT GROUP BY             |                             |
    |   9 |       VIEW                     |                             |
    |  10 |        TABLE ACCESS FULL       | SYS_TEMP_0FD9FE280_59EF9B75 |
    |  11 |     SORT GROUP BY              |                             |
    |  12 |      VIEW                      |                             |
    |  13 |       TABLE ACCESS FULL        | SYS_TEMP_0FD9FE280_59EF9B75 |
    Predicate Information (identified by operation id):
       3 - access("K"."DEPARTURE_AIRPORT"=PRIOR "K"."ARRIVAL_AIRPORT" AND
                  "K"."FLT_DATE"=PRIOR "K"."FLT_DATE" AND "K"."CARRIER"=PRIOR
                  "K"."CARRIER" AND "K"."FLT_NUM"=PRIOR "K"."FLT_NUM")
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
             57  recursive calls
             10  db block gets
             25  consistent gets
              1  physical reads
           1556  redo size
            877  bytes sent via SQL*Net to client
            338  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              5  sorts (memory)
              0  sorts (disk)
              7  rows processed
    SQL> /
    CAR FLT_ F FLT_DATE            ARRIV DEPAR        SEQ    MAX_SEQ
    CX  1      22/05/2011 00:00:00 BNE   CNS            1          2
    CX  1      22/05/2011 00:00:00 HKG   BNE            2          2
    CX  1      22/05/2011 00:00:00       HKG            3          2
    KA  1      23/05/2011 00:00:00 HKG   TPE            1          3
    KA  1      23/05/2011 00:00:00 DEL   HKG            2          3
    KA  1      23/05/2011 00:00:00 KOL   DEL            3          3
    KA  1      23/05/2011 00:00:00       KOL            4          3
    7 rows selected.
    Elapsed: 00:00:00.01
    Execution Plan
    Plan hash value: 4065363664
    | Id  | Operation                      | Name                        |
    |   0 | SELECT STATEMENT               |                             |
    |   1 |  TEMP TABLE TRANSFORMATION     |                             |
    |   2 |   LOAD AS SELECT               |                             |
    |*  3 |    CONNECT BY WITHOUT FILTERING|                             |
    |   4 |     TABLE ACCESS FULL          | INV_LEG_DUMMY               |
    |   5 |   SORT ORDER BY                |                             |
    |   6 |    UNION-ALL                   |                             |
    |   7 |     WINDOW BUFFER              |                             |
    |   8 |      SORT GROUP BY             |                             |
    |   9 |       VIEW                     |                             |
    |  10 |        TABLE ACCESS FULL       | SYS_TEMP_0FD9FE281_59EF9B75 |
    |  11 |     SORT GROUP BY              |                             |
    |  12 |      VIEW                      |                             |
    |  13 |       TABLE ACCESS FULL        | SYS_TEMP_0FD9FE281_59EF9B75 |
    Predicate Information (identified by operation id):
       3 - access("K"."DEPARTURE_AIRPORT"=PRIOR "K"."ARRIVAL_AIRPORT" AND
                  "K"."FLT_DATE"=PRIOR "K"."FLT_DATE" AND "K"."CARRIER"=PRIOR
                  "K"."CARRIER" AND "K"."FLT_NUM"=PRIOR "K"."FLT_NUM")
    Note
       - rule based optimizer used (consider using cbo)
    Statistics
              2  recursive calls
              8  db block gets
             15  consistent gets
              1  physical reads
            604  redo size
            877  bytes sent via SQL*Net to client
            338  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              5  sorts (memory)
              0  sorts (disk)
              7  rows processed
    SQL> Personally I think Salim's method seems very suiccinct and I had expected there would be more of a difference in terms of performance metrics between it and my attempt but it appears there's not much between the two - although Salim's method is generating redo as a result of the temp table through the subquery factoring. I'd be interested to see the results of a full trace between them.
    Either way though, there are two alternatives which seem a fair bit more optimal than the original SQL so it's quids in I guess! :-)
    David
    Edited by: Bravid on Aug 12, 2011 3:24 PM
    Edited by: Bravid on Aug 12, 2011 3:27 PM
    Updated the comparison with Salims additional column

  • What can I do to make this query run faster

    Hi All,
    The below query is taking a long time. Is there any thing that I can do to shorten its time.
    SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E     where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) = TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
    SQL>
    SQL> show parameter user_dump_dest
    NAME                                 TYPE        VALUE
    user_dump_dest                       string      /u01/app/oracle/diag/rdbms/ebi
    zfile/EBIZFILE1/trace
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      11.2.0.2
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    optimizer_use_invisible_indexes      boolean     FALSE
    optimizer_use_pending_statistics     boolean     FALSE
    optimizer_use_sql_plan_baselines     boolean     TRUE
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     128
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>
    SQL> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL>
    SQL> select
      2  sname, pname, pval1, pval2
      3  from
      4  sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          09-11-2010 14:25
    SYSSTATS_INFO        DSTOP                           09-11-2010 14:25
    SYSSTATS_INFO        FLAGS                         1
    SYSSTATS_MAIN        CPUSPEEDNW           739.734748
    SYSSTATS_MAIN        IOSEEKTIM                    10
    SYSSTATS_MAIN        IOTFRSPEED                 4096
    SYSSTATS_MAIN        SREADTIM
    SYSSTATS_MAIN        MREADTIM
    SYSSTATS_MAIN        CPUSPEED
    SYSSTATS_MAIN        MBRC
    SYSSTATS_MAIN        MAXTHR
    SYSSTATS_MAIN        SLAVETHR
    13 rows selected.
    Elapsed: 00:00:00.06
    SQL>
    SQL> explain plan for
      2  SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when  decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when  decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E     where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) =  TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
    Explained.
    Elapsed: 00:00:00.09
    SQL>
    SQL> set pagesize 1000;
    SQL> set linesize 170;
    SQL> @/u01/app/oracle/product/11.2.0/rdbms/admin/utlxpls.sql
    SQL> Rem
    SQL> Rem $Header: utlxpls.sql 26-feb-2002.19:49:37 bdagevil Exp $
    SQL> Rem
    SQL> Rem utlxpls.sql
    SQL> Rem
    SQL> Rem Copyright (c) 1998, 2002, Oracle Corporation.     All rights reserved.
    SQL> Rem
    SQL> Rem    NAME
    SQL> Rem      utlxpls.sql - UTiLity eXPLain Serial plans
    SQL> Rem
    SQL> Rem    DESCRIPTION
    SQL> Rem      script utility to display the explain plan of the last explain plan
    SQL> Rem      command. Do not display information related to Parallel Query
    SQL> Rem
    SQL> Rem    NOTES
    SQL> Rem      Assume that the PLAN_TABLE table has been created. The script
    SQL> Rem      utlxplan.sql should be used to create that table
    SQL> Rem
    SQL> Rem      With SQL*plus, it is recomended to set linesize and pagesize before
    SQL> Rem      running this script. For example:
    SQL> Rem      set linesize 100
    SQL> Rem      set pagesize 0
    SQL> Rem
    SQL> Rem    MODIFIED   (MM/DD/YY)
    SQL> Rem    bdagevil     02/26/02 - cast arguments
    SQL> Rem    bdagevil     01/23/02 - rewrite with new dbms_xplan package
    SQL> Rem    bdagevil     04/05/01 - include CPU cost
    SQL> Rem    bdagevil     02/27/01 - increase Name column
    SQL> Rem    jihuang     06/14/00 - change order by to order siblings by.
    SQL> Rem    jihuang     05/10/00 - include plan info for recursive SQL in LE row source
    SQL> Rem    bdagevil     01/05/00 - add order-by to make it deterministic
    SQL> Rem    kquinn     06/28/99 - 901272: Add missing semicolon
    SQL> Rem    bdagevil     05/07/98 - Explain plan script for serial plans
    SQL> Rem    bdagevil     05/07/98 - Created
    SQL> Rem
    SQL>
    SQL> set markup html preformat on
    SQL>
    SQL> Rem
    SQL> Rem Use the display table function from the dbms_xplan package to display the last
    SQL> Rem explain plan. Force serial option for backward compatibility
    SQL> Rem
    SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'));
    PLAN_TABLE_OUTPUT
    Plan hash value: 2520189693
    | Id  | Operation                         | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                  |                         |   592 | 85248 | 16573   (1)| 00:03:19 |
    |   1 |  TABLE ACCESS BY INDEX ROWID      | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN               | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID      | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  4 |   INDEX UNIQUE SCAN               | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID     | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  6 |    INDEX UNIQUE SCAN              | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   7 |  SORT ORDER BY                    |                         |   592 | 85248 | 16573   (1)| 00:03:19 |
    |   8 |   NESTED LOOPS                    |                         |       |       |            |          |
    |   9 |    NESTED LOOPS                   |                         |   592 | 85248 | 16572   (1)| 00:03:19 |
    |  10 |     NESTED LOOPS OUTER            |                         |   477 | 54855 | 15329   (1)| 00:03:04 |
    |  11 |      NESTED LOOPS OUTER           |                         |   477 | 41499 | 14374   (1)| 00:02:53 |
    |  12 |       INLIST ITERATOR             |                         |       |       |            |          |
    |* 13 |        TABLE ACCESS BY INDEX ROWID| CO_TRANS_MASTER         |   477 | 22896 | 14367   (1)| 00:02:53 |
    |* 14 |         INDEX RANGE SCAN          | IDX_CO_TRANS_ID         | 67751 |       |   150   (1)| 00:00:02 |
    |  15 |       TABLE ACCESS BY INDEX ROWID | SC_AGENT_EMP            |     1 |    39 |     1   (0)| 00:00:01 |
    |* 16 |        INDEX UNIQUE SCAN          | PK_SC_AGENT_EMP         |     1 |       |     0   (0)| 00:00:01 |
    |  17 |      TABLE ACCESS BY INDEX ROWID  | PEOPLE_PROFILE          |     1 |    28 |     2   (0)| 00:00:01 |
    |* 18 |       INDEX UNIQUE SCAN           | SYS_C0063100            |     1 |       |     1   (0)| 00:00:01 |
    |* 19 |     INDEX RANGE SCAN              | IDX_PAY_DETAIL_TRANS_NO |     1 |       |     2   (0)| 00:00:01 |
    |  20 |    TABLE ACCESS BY INDEX ROWID    | PAYMENT_DETAIL          |     1 |    29 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("F"."CO_TRANS_NO"=:B1)
       4 - access("F"."CO_TRANS_NO"=:B1)
       6 - access("F"."CO_TRANS_NO"=:B1)
      13 - filter(TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL
                  OR "SYS_ALIAS_3"."VOID_IND"='N'))
      14 - access("SYS_ALIAS_3"."CO_TRANS_ID"='A020' OR "SYS_ALIAS_3"."CO_TRANS_ID"='AR03' OR
                  "SYS_ALIAS_3"."CO_TRANS_ID"='AR20')
      16 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO"(+) AND
                  "SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID"(+))
      18 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID"(+))
      19 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
    42 rows selected.
    Elapsed: 00:00:00.53
    SQL>
    SQL>
    SQL>
    SQL> rollback;
    Rollback complete.
    Elapsed: 00:00:00.01
    SQL>
    SQL> rem Set the ARRAYSIZE according to your application
    SQL> set autotrace traceonly arraysize 100
    SQL>
    SQL> alter session set tracefile_identifier = 'mytrace1';
    Session altered.
    Elapsed: 00:00:00.00
    SQL>
    SQL> rem if you're using bind variables
    SQL> rem define them here
    SQL>
    SQL> rem variable b_var1 number
    SQL> rem variable b_var2 varchar2(20)
    SQL>
    SQL> rem and initialize them
    SQL>
    SQL> rem exec :b_var1 := 1
    SQL> rem exec :b_var2 := 'DIAG'
    SQL> set pagesize 1000;
    SQL> set linesize 170;
    SQL> alter session set events '10046 trace name context forever, level 8';
    Session altered.
    Elapsed: 00:00:00.01
    SQL> SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when  decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when  decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E     where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) =  TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
    10 rows selected.
    Elapsed: 00:03:42.27
    Execution Plan
    Plan hash value: 2520189693
    | Id  | Operation                         | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                  |                         |   592 | 85248 | 16573   (1)| 00:03:19 |
    |   1 |  TABLE ACCESS BY INDEX ROWID      | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN               | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID      | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  4 |   INDEX UNIQUE SCAN               | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID     | CO_FORM5A_TRANS         |     1 |    20 |     2   (0)| 00:00:01 |
    |*  6 |    INDEX UNIQUE SCAN              | SYS_C0059692            |     1 |       |     1   (0)| 00:00:01 |
    |   7 |  SORT ORDER BY                    |                         |   592 | 85248 | 16573   (1)| 00:03:19 |
    |   8 |   NESTED LOOPS                    |                         |       |       |            |          |
    |   9 |    NESTED LOOPS                   |                         |   592 | 85248 | 16572   (1)| 00:03:19 |
    |  10 |     NESTED LOOPS OUTER            |                         |   477 | 54855 | 15329   (1)| 00:03:04 |
    |  11 |      NESTED LOOPS OUTER           |                         |   477 | 41499 | 14374   (1)| 00:02:53 |
    |  12 |       INLIST ITERATOR             |                         |       |       |            |          |
    |* 13 |        TABLE ACCESS BY INDEX ROWID| CO_TRANS_MASTER         |   477 | 22896 | 14367   (1)| 00:02:53 |
    |* 14 |         INDEX RANGE SCAN          | IDX_CO_TRANS_ID         | 67751 |       |   150   (1)| 00:00:02 |
    |  15 |       TABLE ACCESS BY INDEX ROWID | SC_AGENT_EMP            |     1 |    39 |     1   (0)| 00:00:01 |
    |* 16 |        INDEX UNIQUE SCAN          | PK_SC_AGENT_EMP         |     1 |       |     0   (0)| 00:00:01 |
    |  17 |      TABLE ACCESS BY INDEX ROWID  | PEOPLE_PROFILE          |     1 |    28 |     2   (0)| 00:00:01 |
    |* 18 |       INDEX UNIQUE SCAN           | SYS_C0063100            |     1 |       |     1   (0)| 00:00:01 |
    |* 19 |     INDEX RANGE SCAN              | IDX_PAY_DETAIL_TRANS_NO |     1 |       |     2   (0)| 00:00:01 |
    |  20 |    TABLE ACCESS BY INDEX ROWID    | PAYMENT_DETAIL          |     1 |    29 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("F"."CO_TRANS_NO"=:B1)
       4 - access("F"."CO_TRANS_NO"=:B1)
       6 - access("F"."CO_TRANS_NO"=:B1)
      13 - filter(TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL
                  OR "SYS_ALIAS_3"."VOID_IND"='N'))
      14 - access("SYS_ALIAS_3"."CO_TRANS_ID"='A020' OR "SYS_ALIAS_3"."CO_TRANS_ID"='AR03' OR
                  "SYS_ALIAS_3"."CO_TRANS_ID"='AR20')
      16 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO"(+) AND
                  "SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID"(+))
      18 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID"(+))
      19 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
    Statistics
             51  recursive calls
              0  db block gets
         651812  consistent gets
          92202  physical reads
              0  redo size
           1594  bytes sent via SQL*Net to client
            524  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             10  rows processed
    SQL>
    SQL> disconnect
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> Thanks in advance!

    Hi Raj,
    I have given the output below as you requested....
    QL>  select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  0taz7ckjm41yv, child number 1
    SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE,
    'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME)
    LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID),
    Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID))
    DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select
    nvl(base_trans_id,co_trans_id) from co_form5a_trans f where
    f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when
    decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from
    co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR2
    0' then 1 when  decode(c.co_trans_id,'A020',(select
    nvl(base_trans_id,co_trans_id) from co_form5a_trans f where
    f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end)
    TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP,
    SC_AGENT_EMP D, M_CAA_TRANS E where '1' <> TRIM(UPPER('S0750070Z')) and
    (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in
    TRIM(UPPER('AR03'))OR c.co
    Plan hash value: 4175354585
    | Id  | Operation                        | Name                    | E-Rows |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                 |                         |        |       |       |          |
    |   1 |  TABLE ACCESS BY INDEX ROWID     | CO_FORM5A_TRANS         |      1 |       |       |          |
    |*  2 |   INDEX UNIQUE SCAN              | SYS_C0059692            |      1 |       |       |          |
    |   3 |  TABLE ACCESS BY INDEX ROWID     | CO_FORM5A_TRANS         |      1 |       |       |          |
    |*  4 |   INDEX UNIQUE SCAN              | SYS_C0059692            |      1 |       |       |          |
    |   5 |   TABLE ACCESS BY INDEX ROWID    | CO_FORM5A_TRANS         |      1 |       |       |          |
    |*  6 |    INDEX UNIQUE SCAN             | SYS_C0059692            |      1 |       |       |          |
    |   7 |  SORT ORDER BY                   |                         |     12 |  2048 |  2048 | 2048  (0)|
    |   8 |   NESTED LOOPS                   |                         |        |       |       |          |
    |   9 |    NESTED LOOPS                  |                         |     12 |       |       |          |
    |  10 |     NESTED LOOPS OUTER           |                         |     10 |       |       |          |
    |  11 |      NESTED LOOPS OUTER          |                         |     10 |       |       |          |
    |* 12 |       TABLE ACCESS FULL          | CO_TRANS_MASTER         |     10 |       |       |          |
    |  13 |       TABLE ACCESS BY INDEX ROWID| SC_AGENT_EMP            |      1 |       |       |          |
    |* 14 |        INDEX UNIQUE SCAN         | PK_SC_AGENT_EMP         |      1 |       |       |          |
    |  15 |      TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE          |      1 |       |       |          |
    |* 16 |       INDEX UNIQUE SCAN          | SYS_C0063100            |      1 |       |       |          |
    |* 17 |     INDEX RANGE SCAN             | IDX_PAY_DETAIL_TRANS_NO |      1 |       |       |          |
    |  18 |    TABLE ACCESS BY INDEX ROWID   | PAYMENT_DETAIL          |      1 |       |       |          |
    Predicate Information (identified by operation id):
       2 - access("F"."CO_TRANS_NO"=:B1)
       4 - access("F"."CO_TRANS_NO"=:B1)
       6 - access("F"."CO_TRANS_NO"=:B1)
      12 - filter((INTERNAL_FUNCTION("SYS_ALIAS_3"."CO_TRANS_ID") AND
                  TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL OR
                  "SYS_ALIAS_3"."VOID_IND"='N')))
      14 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO" AND "SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID")
      16 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID")
      17 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
    Note
       - cardinality feedback used for this statement
       - Warning: basic plan statistics not available. These are only collected when:
           * hint 'gather_plan_statistics' is used for the statement or
           * parameter 'statistics_level' is set to 'ALL', at session or system level
    65 rows selected.

  • Elapsed time went up from 1min to 22min after migrating from 10g to 11g

    I just migrated one of my database from 10.2.0.2(Red hat Linux, 2 node RAC, sga= 1Gb) to 11.2.0.1 (red Hat Linux 2 Node RAC, SGA=7GB)
    The timing for one of the specific query shoot up from 1min to 22 min.
    Following is the query:
    SELECT /*+ gather_plan_statistics */   docr.DRCONTENT
        FROM      WRPADMIN.T_DOCREPORT docr, WRPADMIN.t_document doc
               WHERE doc.docid = docr.docid
       AND 294325 = doc.rdocid
               AND ( ( ( (EXISTS
                             (SELECT   'X'
                                FROM   WRPADMIN.t_mastermap mstm1,
                                       WRPADMIN.t_docdimmap docdim1
                               WHERE       doc.docid = mstm1.docid
                                       AND mstm1.dimlvlid = 2
                                       AND mstm1.mstmapid = docdim1.mstmapid
                                       AND docdim1.dimid IN (86541))))
                      OR (EXISTS
                             (SELECT   'X'
                                FROM   WRPADMIN.t_mastermap mstm2,
                                       WRPADMIN.t_docdimmap docdim2
                               WHERE       doc.rdocid = mstm2.rdocid
                                       AND mstm2.dimlvlid = 1
                                       AND mstm2.mstmapid = docdim2.mstmapid
                                       AND docdim2.dimid IN (28388)))))
    ORDER BY   doc.DOCIDThe select field (docr.DRCONTENT) is a CLOB column.
    Following is the plan and statistics in 10g
    Statistics
              1  recursive calls
              0  db block gets
         675018  consistent gets
          52225  physical reads
              0  redo size
       59486837  bytes sent via SQL*Net to client
       27199426  bytes received via SQL*Net from client
         103648  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
          51823  rows processed
    SQL>
    Plan hash value: 129748299
    | Id  | Operation                               | Name           | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |   1 |  SORT ORDER BY                          |                |      1 |     50 |  51823 |00:00:14.72 |     627K|   5379 |    26M|  1873K|   23M (0)|
    |*  2 |   FILTER                                |                |      1 |        |  51823 |00:00:08.90 |     627K|   5379 |       |       |          |
    |   3 |    TABLE ACCESS BY GLOBAL INDEX ROWID   | T_DOCREPORT    |      1 |      1 |  51823 |00:00:05.42 |     159K|   3773 |       |       |          |
    |   4 |     NESTED LOOPS                        |                |      1 |     50 |    103K|00:00:12.65 |     156K|    628 |       |       |          |
    |   5 |      TABLE ACCESS BY GLOBAL INDEX ROWID | T_DOCUMENT     |      1 |     50 |  51823 |00:00:00.15 |     481 |    481 |       |       |          |
    |*  6 |       INDEX RANGE SCAN                  | RDOC2_INDEX    |      1 |    514 |  51823 |00:00:00.09 |     245 |    245 |       |       |          |
    |*  7 |      INDEX RANGE SCAN                   | DOCID9_INDEX   |  51823 |      1 |  51823 |00:00:00.46 |     155K|    147 |       |       |          |
    |*  8 |    TABLE ACCESS BY GLOBAL INDEX ROWID   | T_DOCDIMMAP    |  51823 |      1 |      0 |00:00:04.52 |     467K|   1140 |       |       |          |
    |   9 |     NESTED LOOPS                        |                |  51823 |      1 |    207K|00:00:03.48 |     415K|    479 |       |       |          |
    |* 10 |      TABLE ACCESS BY GLOBAL INDEX ROWID | T_MASTERMAP    |  51823 |      1 |  51823 |00:00:01.20 |     207K|    190 |       |       |          |
    |* 11 |       INDEX RANGE SCAN                  | DOCID4_INDEX   |  51823 |      1 |  51824 |00:00:00.41 |     155K|    146 |       |       |          |
    |* 12 |      INDEX RANGE SCAN                   | MSTMAPID_INDEX |  51823 |      1 |    103K|00:00:00.43 |     207K|    289 |       |       |          |
    |* 13 |     TABLE ACCESS BY GLOBAL INDEX ROWID  | T_DOCDIMMAP    |      1 |      1 |      1 |00:00:01.05 |     469 |    466 |       |       |          |
    |  14 |      NESTED LOOPS                       |                |      1 |      1 |     15 |00:00:14.62 |     468 |    465 |       |       |          |
    |* 15 |       TABLE ACCESS BY GLOBAL INDEX ROWID| T_MASTERMAP    |      1 |      1 |      1 |00:00:01.02 |     464 |    463 |       |       |          |
    |* 16 |        INDEX RANGE SCAN                 | RDOCID3_INDEX  |      1 |    629 |  44585 |00:00:00.29 |     198 |    198 |       |       |          |
    |* 17 |       INDEX RANGE SCAN                  | MSTMAPID_INDEX |      1 |      1 |     14 |00:00:00.02 |       4 |      2 |       |       |          |
    Predicate Information (identified by operation id):
       2 - filter(( IS NOT NULL OR  IS NOT NULL))
       6 - access("DOC"."RDOCID"=294325)
       7 - access("DOC"."DOCID"="DOCR"."DOCID")
       8 - filter("DOCDIM1"."DIMID"=86541)
      10 - filter("MSTM1"."DIMLVLID"=2)
      11 - access("MSTM1"."DOCID"=:B1)
      12 - access("MSTM1"."MSTMAPID"="DOCDIM1"."MSTMAPID")
      13 - filter("DOCDIM2"."DIMID"=28388)
      15 - filter("MSTM2"."DIMLVLID"=1)
      16 - access("MSTM2"."RDOCID"=:B1)
      17 - access("MSTM2"."MSTMAPID"="DOCDIM2"."MSTMAPID")following is the plan in 11g:
    Statistics
             32  recursive calls
              0  db block gets
       20959179  consistent gets
         105948  physical reads
            348  redo size
       37320945  bytes sent via SQL*Net to client
       15110877  bytes received via SQL*Net from client
         103648  SQL*Net roundtrips to/from client
              3  sorts (memory)
              0  sorts (disk)
          51823  rows processed
    SQL>
    Plan hash value: 1013746825
    | Id  | Operation                               | Name           | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                        |                |      1 |        |  51823 |00:01:10.08 |      20M|   2306 |       |       |          |
    |   1 |  SORT ORDER BY                          |                |      1 |      1 |  51823 |00:01:10.08 |      20M|   2306 |  9266K|  1184K| 8236K (0)|
    |*  2 |   FILTER                                |                |      1 |        |  51823 |00:21:41.79 |      20M|   2306 |       |       |          |
    |   3 |    NESTED LOOPS                         |                |      1 |        |  51823 |00:00:01.95 |    8054 |   1156 |       |       |          |
    |   4 |     NESTED LOOPS                        |                |      1 |    335 |  51823 |00:00:00.99 |    4970 |    563 |       |       |          |
    |   5 |      TABLE ACCESS BY GLOBAL INDEX ROWID | T_DOCUMENT     |      1 |    335 |  51823 |00:00:00.38 |     402 |    401 |       |       |          |
    |*  6 |       INDEX RANGE SCAN                  | RDOC2_INDEX    |      1 |    335 |  51823 |00:00:00.17 |     148 |    147 |       |       |          |
    |*  7 |      INDEX RANGE SCAN                   | DOCID9_INDEX   |  51823 |      1 |  51823 |00:00:00.55 |    4568 |    162 |       |       |          |
    |   8 |     TABLE ACCESS BY GLOBAL INDEX ROWID  | T_DOCREPORT    |  51823 |      1 |  51823 |00:00:00.94 |    3084 |    593 |       |       |          |
    |   9 |    CONCATENATION                        |                |  51823 |        |  51823 |00:22:16.08 |      20M|   1150 |       |       |          |
    |  10 |     NESTED LOOPS                        |                |  51823 |        |      0 |00:00:02.71 |     221K|   1150 |       |       |          |
    |  11 |      NESTED LOOPS                       |                |  51823 |      1 |    103K|00:00:01.19 |     169K|    480 |       |       |          |
    |* 12 |       TABLE ACCESS BY GLOBAL INDEX ROWID| T_MASTERMAP    |  51823 |      1 |  51823 |00:00:00.72 |     108K|    163 |       |       |          |
    |* 13 |        INDEX RANGE SCAN                 | DOCID4_INDEX   |  51823 |      1 |  51824 |00:00:00.52 |   56402 |    163 |       |       |          |
    |* 14 |       INDEX RANGE SCAN                  | MSTMAPID_INDEX |  51823 |      2 |    103K|00:00:00.60 |   61061 |    317 |       |       |          |
    |* 15 |      TABLE ACCESS BY GLOBAL INDEX ROWID | T_DOCDIMMAP    |    103K|      1 |      0 |00:00:01.14 |   52584 |    670 |       |       |          |
    |  16 |     NESTED LOOPS                        |                |  51823 |        |  51823 |00:22:13.19 |      20M|      0 |       |       |          |
    |  17 |      NESTED LOOPS                       |                |  51823 |      1 |    725K|00:22:12.31 |      20M|      0 |       |       |          |
    |* 18 |       TABLE ACCESS BY GLOBAL INDEX ROWID| T_MASTERMAP    |  51823 |      1 |  51823 |00:22:11.09 |      20M|      0 |       |       |          |
    |* 19 |        INDEX RANGE SCAN                 | RDOCID3_INDEX  |  51823 |    336 |   2310M|00:12:08.04 |    6477K|      0 |       |       |          |
    |* 20 |       INDEX RANGE SCAN                  | MSTMAPID_INDEX |  51823 |      2 |    725K|00:00:00.83 |   51838 |      0 |       |       |          |
    |* 21 |      TABLE ACCESS BY GLOBAL INDEX ROWID | T_DOCDIMMAP    |    725K|      1 |  51823 |00:00:00.92 |   51823 |      0 |       |       |          |
    Predicate Information (identified by operation id):
       2 - filter( IS NOT NULL)
       6 - access("DOC"."RDOCID"=294325)
       7 - access("DOC"."DOCID"="DOCR"."DOCID")
      12 - filter("MSTM1"."DIMLVLID"=2)
      13 - access("MSTM1"."DOCID"=:B1)
      14 - access("MSTM1"."MSTMAPID"="DOCDIM1"."MSTMAPID")
      15 - filter((INTERNAL_FUNCTION("DOCDIM1"."DIMID") AND (("DOCDIM1"."DIMID"=86541 AND "MSTM1"."DIMLVLID"=2 AND "MSTM1"."DOCID"=:B1) OR
                  ("DOCDIM1"."DIMID"=28388 AND "MSTM1"."DIMLVLID"=1 AND "MSTM1"."RDOCID"=:B2))))
      18 - filter(("MSTM1"."DIMLVLID"=1 AND (LNNVL("MSTM1"."DOCID"=:B1) OR LNNVL("MSTM1"."DIMLVLID"=2))))
      19 - access("MSTM1"."RDOCID"=:B1)
      20 - access("MSTM1"."MSTMAPID"="DOCDIM1"."MSTMAPID")
      21 - filter((INTERNAL_FUNCTION("DOCDIM1"."DIMID") AND (("DOCDIM1"."DIMID"=86541 AND "MSTM1"."DIMLVLID"=2 AND "MSTM1"."DOCID"=:B1) OR
                  ("DOCDIM1"."DIMID"=28388 AND "MSTM1"."DIMLVLID"=1 AND "MSTM1"."RDOCID"=:B2))))Calling all performance experts. Any ideas ??
    Edited by: dm_ptldba on Oct 8, 2012 7:50 AM

    If you check lines 2, 3, 8, and 13 in the 10g plan you will see that Oracle has operated your two EXISTS subqueries separately (there is a bug with multiple filter subqueries in that version that indents each subquery after the first one extra place, so the shape of the plan is a little deceptive). The statistics show that the second subquery only ran once because existence was almost always satistfied by the first.
    In the 11g plan, lines 2, 3, and 9 show that the optimizer has transformed your TWO subqueries into a single subquery, then turned transformed the single subquery into a concatenation and this has, in effect, made it execute both subqueries for every row from the driving table - all the extra work appears from the redundant execution of the thing that was the second EXISTS subquery.
    If you extract the OUTLINE from the execution plans (add 'outline' to the call to dbms_xplan as one of the format options) you may see some hint that shows the optimizer combining the two subqueries - if so then put in the "NO_xxx" hint to block it. Alternatively you could simply try adding the hint stop ALL cost-based query transformations /*+ no_query_transformation */
    Regards
    Jonathan Lewis

  • Filter(NULL IS NOT NULL) in Explain Plan ??

    Hi All,
    Can someone please explain what this explain plan statement means? I see a filter(NULL IS NOT NULL) as the first statement - could not figure out why it came up so from googling.
    My Query Used:
    EXPLAIN PLAN FOR
    MERGE INTO summary_bysrccd
    USING
    (SELECT LAST_DAY(TRUNC(to_timestamp(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))) AS SUMMARY_DATE,
    os.acctnum,
    ol.sourcecode AS sourcecode,
    ol.sourcename AS sourcename,
    count(1) cnt_articleview
    FROM article_views os , master_sourcecode ol
    where os.sourcecode = ol.sourcecode
    AND os.acctnum IS NOT NULL
    AND ol.sourcecode IS NOT NULL
    AND os.requestdatetime IS NOT NULL
    AND UPPER(os.success_ind) = 'S'
         AND (
              ('INCR'  = 'FULL'
              AND  (get_date_timestamp(os.requestdatetime) BETWEEN TO_DATE('23-AUG-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND TO_DATE('27-AUG-2011 23:59:59','DD-MON-YYYY HH24:MI:SS')
              AND   os.entry_CreatedDate BETWEEN TO_DATE('22-AUG-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND TO_DATE('28-AUG-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
              OR ('INCR' = 'FULL'
              AND os.entry_createddate BETWEEN TO_DATE('23-AUG-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND TO_DATE('27-AUG-2011 23:59:59','DD-MON-YYYY HH24:MI:SS') )
    group by LAST_DAY(TRUNC(to_timestamp(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))),
    os.acctnum,ol.sourcecode,ol.sourcename) mrg_query
    ON (ods_av_summary_bysrccd.acctnum = mrg_query.acctnum AND
    ods_av_summary_bysrccd.summary_date=mrg_query.summary_date AND
    ods_av_summary_bysrccd.sourcecode=mrg_query.sourcecode)
    WHEN NOT MATCHED THEN
    INSERT (SUMMARY_date,ACCTNUM,SOURCECODE,SOURCENAME,CNT_ARTICLEVIEW,ENTRY_LASTUPDATEDDATE)
    VALUES(mrg_query.summary_date,mrg_query.acctnum,mrg_query.sourcecode,mrg_query.sourcename,
    mrg_query.cnt_articleview,sysdate)
    WHEN MATCHED THEN
    UPDATE SET ods_av_summary_bysrccd.cnt_articleview=
    CASE WHEN NVL('INCR','INCR') = 'FULL' THEN mrg_query.cnt_articleview
    ELSE ods_av_summary_bysrccd.cnt_articleview+mrg_query.cnt_articleview
    END,
    ods_av_summary_bysrccd.entry_lastupdateddate=sysdate;My Explain Plan:
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 268591246
    | Id  | Operation                                 | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | MERGE STATEMENT                           |                           |     1 |   456 |       |     3   (0)| 00:00:01 |       |       |
    |   1 |  MERGE                                    | ODS_AV_SUMMARY_BYSRCCD    |       |       |       |            |          |       |       |
    |   2 |   VIEW                                    |                           |       |       |       |            |          |       |       |
    |   3 |    NESTED LOOPS OUTER                     |                           |     1 |   417 |       |     3   (0)| 00:00:01 |       |       |
    |   4 |     VIEW                                  |                           |     1 |   360 |       |     5 (100)| 00:00:01 |       |       |
    |   5 |      SORT GROUP BY                        |                           |     1 |    73 |   595M|            |          |       |       |
    PLAN_TABLE_OUTPUT
    |*  6 |       FILTER                              |                           |       |       |       |            |          |       |       |
    |*  7 |        HASH JOIN                          |                           |  6975K|   485M|  3944K| 17594   (1)| 00:03:32 |       |       |
    |   8 |         TABLE ACCESS FULL                 | ODS_MASTER_SOURCECODE     | 84021 |  2953K|       |   273   (1)| 00:00:04 |       |       |
    |*  9 |         TABLE ACCESS BY GLOBAL INDEX ROWID| ODS_ARTICLE_VIEWS         |  7007K|   247M|       |   826   (0)| 00:00:10 |    33 |    33 |
    |* 10 |          INDEX FULL SCAN                  | IDX_AV_ACCTNUM            |    25M|       |       |    26   (0)| 00:00:01 |       |       |
    |  11 |     TABLE ACCESS BY GLOBAL INDEX ROWID    | ODS_AV_SUMMARY_BYSRCCD    |     1 |    57 |       |     3   (0)| 00:00:01 | ROWID | ROWID |
    |* 12 |      INDEX UNIQUE SCAN                    | ODS_AV_SUMMARY_BYSRCCD_PK |     1 |       |       |     2   (0)| 00:00:01 |       |       |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       6 - filter(NULL IS NOT NULL)
       7 - access("OS"."SOURCECODE"="OL"."SOURCECODE")
       9 - filter("OS"."REQUESTDATETIME" IS NOT NULL AND "OS"."ENTRY_CREATEDDATE">=TO_DATE(' 2011-08-23 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "OS"."ENTRY_CREATEDDATE"<=TO_DATE(' 2011-08-27 23:59:59', 'syyyy-mm-dd hh24:mi:ss') AND UPPER("OS"."SUCCESS_IND")='S')
      10 - filter("OS"."ACCTNUM" IS NOT NULL)
      12 - access("ODS_AV_SUMMARY_BYSRCCD"."SUMMARY_DATE"(+)=INTERNAL_FUNCTION("MRG_QUERY"."SUMMARY_DATE") AND
                  "ODS_AV_SUMMARY_BYSRCCD"."ACCTNUM"(+)="MRG_QUERY"."ACCTNUM" AND "ODS_AV_SUMMARY_BYSRCCD"."SOURCECODE"(+)="MRG_QUERY"."SOURCECODE")
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement

    Hi Toon,
    Thanks for the quick resolution. I went back and verified the table's colunm details and it has a NOT NULL constraint.
    Regards,
    Chaitanya
    P.S: Is it ok if I ask you for some help regarding a production issue I have been encountering since 15 days but haev no clear resolution yet about what/why is the reason (the said issue is neither uniform nor regular - its affecting some modules and happening on some days - i shall give the full details if you are willing to have a look) - i shall start a new post or email you directly - yur convenience.

  • Performance with dates in the where clause

    Performance with dates in the where clause
    CREATE TABLE TEST_DATA
    FNUMBER NUMBER,
    FSTRING VARCHAR2(4000 BYTE),
    FDATE DATE
    create index t_indx on test_data(fdata);
    query 1: select count(*) from TEST_DATA where trunc(fdate) = trunc(sysdate);
    query 2: select count(*) from TEST_DATA where fdate between trunc(sysdate) and trunc(SYSDATE) + .99999;
    query 3: select count(*) from TEST_DATA where fdate between to_date('21-APR-10', 'dd-MON-yy') and to_date('21-APR-10 23:59:59', 'DD-MON-YY hh24:mi:ss');
    My questions:
    1) Why isn't the index t_indx used in Execution plan 1?
    2) From the execution plan, I see that query 2 & 3 is better than query 1. I do not see any difference between execution plan 2 & 3. Which one is better?
    3) I read somewhere - "Always check the Access Predicates and Filter Predicates of Explain Plan carefully to determine which columns are contributing to a Range Scan and which columns are merely filtering the returned rows. Be sceptical if the same clause is shown in both."
    Is that true for Execution plan 2 & 3?
    3) Could some one explain what the filter & access predicate mean here?
    Thanks in advance.
    Execution Plan 1:
    SQL> select count(*) from TEST_DATA where trunc(fdate) = trunc(sysdate);
    COUNT(*)
    283
    Execution Plan
    Plan hash value: 1486387033
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 9 | 517 (20)| 00:00:07 |
    | 1 | SORT AGGREGATE | | 1 | 9 | | |
    |* 2 | TABLE ACCESS FULL| TEST_DATA | 341 | 3069 | 517 (20)| 00:00:07 |
    Predicate Information (identified by operation id):
    2 - filter(TRUNC(INTERNAL_FUNCTION("FDATE"))=TRUNC(SYSDATE@!))
    Note
    - dynamic sampling used for this statement
    Statistics
    4 recursive calls
    0 db block gets
    1610 consistent gets
    0 physical reads
    0 redo size
    412 bytes sent via SQL*Net to client
    380 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    Execution Plan 2:
    SQL> select count(*) from TEST_DATA where fdate between trunc(sysdate) and trunc(SYSDATE) + .99999;
    COUNT(*)
    283
    Execution Plan
    Plan hash value: 1687886199
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 9 | 3 (0)| 00:00:01 |
    | 1 | SORT AGGREGATE | | 1 | 9 | | |
    |* 2 | FILTER | | | | | |
    |* 3 | INDEX RANGE SCAN| T_INDX | 283 | 2547 | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter(TRUNC(SYSDATE@!)<=TRUNC(SYSDATE@!)+.9999884259259259259259
    259259259259259259)
    3 - access("FDATE">=TRUNC(SYSDATE@!) AND
    "FDATE"<=TRUNC(SYSDATE@!)+.999988425925925925925925925925925925925
    9)
    Note
    - dynamic sampling used for this statement
    Statistics
    7 recursive calls
    0 db block gets
    76 consistent gets
    0 physical reads
    0 redo size
    412 bytes sent via SQL*Net to client
    380 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows
    Execution Plan 3:
    SQL> select count(*) from TEST_DATA where fdate between to_date('21-APR-10', 'dd-MON-yy') and to_dat
    e('21-APR-10 23:59:59', 'DD-MON-YY hh24:mi:ss');
    COUNT(*)
    283
    Execution Plan
    Plan hash value: 1687886199
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 9 | 3 (0)| 00:00:01 |
    | 1 | SORT AGGREGATE | | 1 | 9 | | |
    |* 2 | FILTER | | | | | |
    |* 3 | INDEX RANGE SCAN| T_INDX | 283 | 2547 | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter(TO_DATE('21-APR-10','dd-MON-yy')<=TO_DATE('21-APR-10
    23:59:59','DD-MON-YY hh24:mi:ss'))
    3 - access("FDATE">=TO_DATE('21-APR-10','dd-MON-yy') AND
    "FDATE"<=TO_DATE('21-APR-10 23:59:59','DD-MON-YY hh24:mi:ss'))
    Note
    - dynamic sampling used for this statement
    Statistics
    7 recursive calls
    0 db block gets
    76 consistent gets
    0 physical reads
    0 redo size
    412 bytes sent via SQL*Net to client
    380 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

    Hi,
    user10541890 wrote:
    Performance with dates in the where clause
    CREATE TABLE TEST_DATA
    FNUMBER NUMBER,
    FSTRING VARCHAR2(4000 BYTE),
    FDATE DATE
    create index t_indx on test_data(fdata);Did you mean fdat<b>e</b> (ending in e)?
    Be careful; post the code you're actually running.
    query 1: select count(*) from TEST_DATA where trunc(fdate) = trunc(sysdate);
    query 2: select count(*) from TEST_DATA where fdate between trunc(sysdate) and trunc(SYSDATE) + .99999;
    query 3: select count(*) from TEST_DATA where fdate between to_date('21-APR-10', 'dd-MON-yy') and to_date('21-APR-10 23:59:59', 'DD-MON-YY hh24:mi:ss');
    My questions:
    1) Why isn't the index t_indx used in Execution plan 1?To use an index, the indexed column must stand alone as one of the operands. If you had a function-based index on TRUNC (fdate), then it might be used in Query 1, because the left operand of = is TRUNC (fdate).
    2) From the execution plan, I see that query 2 & 3 is better than query 1. I do not see any difference between execution plan 2 & 3. Which one is better?That depends on what you mean by "better".
    If "better" means faster, you've already shown that one is about as good as the other.
    Queries 2 and 3 are doing different things. Assuming the table stays the same, Query 2 may give different results every day, but the results of Query 3 will never change.
    For clarity, I prefer:
    WHERE     fdate >= TRUNC (SYSDATE)
    AND     fdate <  TRUNC (SYSDATE) + 1(or replace SYSDATE with a TO_DATE expression, depending on the requirements).
    3) I read somewhere - "Always check the Access Predicates and Filter Predicates of Explain Plan carefully to determine which columns are contributing to a Range Scan and which columns are merely filtering the returned rows. Be sceptical if the same clause is shown in both."
    Is that true for Execution plan 2 & 3?
    3) Could some one explain what the filter & access predicate mean here?Sorry, I can't.

  • Performance problem - Tablespace Free Space

    Hi,
    Version 10204
    I am running the following statment in order to monitor tablespace free space.
    There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
    only when less than 4 GB left in the tablespace.
    I build the following statment.
    Using the hint : /*+ NO_CPU_COSTING */ gave me the best performance but there are alot of time
    that its took to this statment few minute to run befor it finished.
    Could one help to improve its performance ?
    Please note that it performe even less good when i used the RULE hint or not using hint at all.
    SELECT  /*+ gather_plan_statistics */  'tablespace_free_space;'||to_char(pct_used,'999.99')||','||TBSNAME
    FROM( SELECT *
          FROM( SELECT NVL(b.tablespace_name, NVL(a.tablespace_name,'UNKOWN')) TBSNAME,
                       MBytes_alloc,
                           maxbytes,
                           MBytes_max,
                       ROUND(MBytes_alloc-NVL(MBytes_free,0),2) used,
                       ROUND(NVL(MBytes_free,0),2) free,
                       MBytes_free,
                       ROUND(DECODE( MBytes_max, 0,((MBytes_alloc-NVL(MBytes_free,0))/MBytes_alloc)*100,100*(MBytes_alloc) / maxbytes),2)PCT_USED
                FROM ( SELECT /*+ NO_CPU_COSTING */  SUM(bytes)/1024/1024 MBytes_free,
                              MAX(bytes)/1024/1024 largest,
                              tablespace_name
                       FROM   sys.DBA_FREE_SPACE
                       WHERE  TABLESPACE_NAME NOT IN
                              ('Q405_CALLS_TS','Q405_ICALLS_TS',
                               'Q305_CALLS_TS','Q305_ICALLS_TS',
                               'Q205_ICALLS_TS','Q306_CALLS_TS',
                               'Q406_CALLS_TS','Q206_CALLS_TS',
                               'Q205_CALLS_TS','Q105_CALLS_TS',
                               'Q105_ICALLS_TS','Q206_CALLS_TS','Q106_CALLS_TS',
                               'Q306_ICALLS_TS','Q107_ICALLS_TS','Q406_ICALLS_TS',
                               'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
                               'UNLMT_INTERNET_CALLS_2007_TS',
                               'UNLMT_INTERNET_CALLS_2008_TS',
                               'Q107_ICALLS_TBS','Q107_CALLS_TBS',
                               'Q207_ICALLS_TBS','Q207_CALLS_TBS',
                               'Q307_ICALLS_TBS','Q307_CALLS_TBS',
                               'Q407_ICALLS_TBS','Q407_CALLS_TBS',
                               'Q408_ICALLS_TS','Q408_CALLS_TS',
                               'Q308_ICALLS_TS','Q308_CALLS_TS',
                               'Q208_ICALLS_TS','Q208_CALLS_TS',
                               'Q108_ICALLS_TS','Q108_CALLS_TS',
                               'Q109_ICALLS_TS','Q109_CALLS_TS',
                               'UNLMT_INT_CALLS_Q308_TS',
                               'UNLMT_INT_ICALLS_Q308_TS',
                               'UNLMT_INT_CALLS_Q408_TS',
                               'UNLMT_INT_ICALLS_Q408_TS'
                       GROUP BY tablespace_name ) a,
                     ( SELECT  SUM(bytes)/1024/1024 MBytes_alloc,
                              SUM(maxbytes)/1024/1024 MBytes_max,
                              SUM(DECODE (autoextensible,'YES',maxbytes/1024/1024,'NO', BYTES/1024/1024 )) maxbytes,
                              tablespace_name
                       FROM   DBA_DATA_FILES
                       WHERE  TABLESPACE_NAME NOT IN
                              ('Q405_CALLS_TS','Q405_ICALLS_TS',
                               'Q305_CALLS_TS','Q305_ICALLS_TS',
                               'Q205_ICALLS_TS','Q306_CALLS_TS',
                               'Q406_CALLS_TS','Q206_CALLS_TS',
                               'Q205_CALLS_TS','Q105_CALLS_TS',
                               'Q105_ICALLS_TS','Q206_CALLS_TS',
                               'Q106_CALLS_TS','Q306_ICALLS_TS',
                               'Q107_ICALLS_TS','Q406_ICALLS_TS',
                               'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
                               'UNLMT_INTERNET_CALLS_2007_TS',
                               'UNLMT_INTERNET_CALLS_2008_TS',
                               'Q107_ICALLS_TBS','Q107_CALLS_TBS',
                               'Q207_ICALLS_TBS','Q207_CALLS_TBS',
                               'Q307_ICALLS_TBS','Q307_CALLS_TBS',
                               'Q407_ICALLS_TBS','Q407_CALLS_TBS',
                               'Q408_ICALLS_TS','Q408_CALLS_TS',
                               'Q308_ICALLS_TS','Q308_CALLS_TS',
                               'Q208_ICALLS_TS','Q208_CALLS_TS',
                               'Q108_ICALLS_TS','Q108_CALLS_TS',
                               'Q109_ICALLS_TS','Q109_CALLS_TS',
                               'UNLMT_INT_CALLS_Q308_TS',
                               'UNLMT_INT_ICALLS_Q308_TS',
                               'UNLMT_INT_CALLS_Q408_TS',
                               'UNLMT_INT_ICALLS_Q408_TS'
                       GROUP BY tablespace_name) b
                WHERE a.tablespace_name (+) = b.tablespace_name
                AND (a.MBytes_free<4000 or a.MBytes_free is null)
             ORDER BY PCT_USED DESC
    WHERE TBSNAME not in (select tablespace_name from dba_tablespaces where contents in ('UNDO'))
    and ROWNUM =1;
    select * from table(dbms_xplan.display_cursor('42hppgtx2h1gb',0,'ALLSTATS LAST'));
    Plan hash value: 2979461796
    PLAN_TABLE_OUTPUT
    | Id  | Operation                               | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |*  1 |  COUNT STOPKEY                          |                  |      1 |        |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |*  2 |   FILTER                                |                  |      1 |        |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |   3 |    VIEW                                 |                  |      1 |      3 |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |   4 |     SORT ORDER BY                       |                  |      1 |      3 |      1 |00:00:15.52 |     146K|   8927 |  2048 |  2048 | 2048  (0)|
    |*  5 |      FILTER                             |                  |      1 |        |     16 |00:00:15.52 |     146K|   8927 |       |       |      |
    |*  6 |       HASH JOIN OUTER                   |                  |      1 |      3 |     25 |00:00:15.52 |     146K|   8927 |   561K|   561K|  982K (0)|
    |   7 |        VIEW                             |                  |      1 |      2 |     25 |00:00:02.95 |     105K|      0 |       |       |      |
    |   8 |         HASH GROUP BY                   |                  |      1 |      2 |     25 |00:00:02.95 |     105K|      0 |   447K|   447K|  977K (0)|
    |   9 |          VIEW                           | DBA_DATA_FILES   |      1 |      2 |    217 |00:00:03.25 |     105K|      0 |       |       |      |
    |  10 |           UNION-ALL                     |                  |      1 |        |    217 |00:00:03.25 |     105K|      0 |       |       |      |
    |  11 |            NESTED LOOPS                 |                  |      1 |      1 |      0 |00:00:00.67 |     219 |      0 |       |       |      |
    |  12 |             NESTED LOOPS                |                  |      1 |      1 |      0 |00:00:00.67 |     219 |      0 |       |       |      |
    |  13 |              MERGE JOIN CARTESIAN       |                  |      1 |      1 |  52297 |00:00:00.22 |       0 |      0 |       |       |      |
    |* 14 |               FIXED TABLE FULL          | X$KCCFN          |      1 |      1 |    217 |00:00:00.01 |       0 |      0 |       |       |      |
    |  15 |               BUFFER SORT               |                  |    217 |    100 |  52297 |00:00:00.06 |       0 |      0 | 11264 | 11264 |10240  (0)|
    |  16 |                FIXED TABLE FULL         | X$KCCFE          |      1 |    100 |    241 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 17 |              TABLE ACCESS BY INDEX ROWID| FILE$            |  52297 |      1 |      0 |00:00:00.52 |     219 |      0 |       |       |      |
    |* 18 |               INDEX UNIQUE SCAN         | I_FILE1          |  52297 |      1 |    217 |00:00:00.24 |       2 |      0 |       |       |      |
    |* 19 |             TABLE ACCESS CLUSTER        | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 20 |              INDEX UNIQUE SCAN          | I_TS#            |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |  21 |            NESTED LOOPS                 |                  |      1 |      1 |    217 |00:00:02.58 |     105K|      0 |       |       |      |
    |  22 |             NESTED LOOPS                |                  |      1 |      1 |  52297 |00:00:01.89 |     104K|      0 |       |       |      |
    |  23 |              MERGE JOIN CARTESIAN       |                  |      1 |      1 |  52297 |00:00:00.22 |     217 |      0 |       |       |      |
    |  24 |               NESTED LOOPS              |                  |      1 |      1 |    217 |00:00:00.02 |     217 |      0 |       |       |      |
    |* 25 |                FIXED TABLE FULL         | X$KCCFN          |      1 |      1 |    217 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 26 |                FIXED TABLE FIXED INDEX  | X$KTFBHC (ind:1) |    217 |      1 |    217 |00:00:00.01 |     217 |      0 |       |       |      |
    |  27 |               BUFFER SORT               |                  |    217 |    100 |  52297 |00:00:00.11 |       0 |      0 | 11264 | 11264 |10240  (0)|
    |  28 |                FIXED TABLE FULL         | X$KCCFE          |      1 |    100 |    241 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 29 |              TABLE ACCESS CLUSTER       | TS$              |  52297 |      1 |  52297 |00:00:01.41 |     104K|      0 |       |       |      |
    |* 30 |               INDEX UNIQUE SCAN         | I_TS#            |  52297 |      1 |  52297 |00:00:00.37 |       2 |      0 |       |       |      |
    |* 31 |             TABLE ACCESS BY INDEX ROWID | FILE$            |  52297 |      1 |    217 |00:00:00.57 |     219 |      0 |       |       |      |
    |* 32 |              INDEX UNIQUE SCAN          | I_FILE1          |  52297 |      1 |    217 |00:00:00.28 |       2 |      0 |       |       |      |
    |  33 |        VIEW                             |                  |      1 |   1401 |     25 |00:00:12.56 |   40846 |   8927 |       |       |      |
    |  34 |         HASH GROUP BY                   |                  |      1 |   1401 |     25 |00:00:12.56 |   40846 |   8927 |   465K|   465K|  982K (0)|
    |  35 |          VIEW                           | DBA_FREE_SPACE   |      1 |   1401 |  73133 |00:00:14.19 |   40846 |   8927 |       |       |      |
    |  36 |           UNION-ALL                     |                  |      1 |        |  73133 |00:00:14.04 |   40846 |   8927 |       |       |      |
    |  37 |            NESTED LOOPS                 |                  |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |  38 |             NESTED LOOPS                |                  |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |  39 |              TABLE ACCESS FULL          | FET$             |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 40 |              INDEX UNIQUE SCAN          | I_FILE2          |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 41 |             TABLE ACCESS CLUSTER        | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |  42 |            NESTED LOOPS                 |                  |      1 |      5 |   7271 |00:00:00.20 |    1156 |      0 |       |       |      |
    |  43 |             NESTED LOOPS                |                  |      1 |      6 |   7271 |00:00:00.14 |    1154 |      0 |       |       |      |
    |* 44 |              TABLE ACCESS FULL          | TS$              |      1 |      2 |     25 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 45 |              FIXED TABLE FIXED INDEX    | X$KTFBFE (ind:1) |     25 |      3 |   7271 |00:00:00.11 |    1109 |      0 |       |       |      |
    |* 46 |             INDEX UNIQUE SCAN           | I_FILE2          |   7271 |      1 |   7271 |00:00:00.04 |       2 |      0 |       |       |      |
    |  47 |            NESTED LOOPS                 |                  |      1 |   1394 |  65862 |00:00:17.73 |   39476 |   8927 |       |       |      |
    |  48 |             NESTED LOOPS                |                  |      1 |  30528 |  65862 |00:00:16.94 |   39474 |   8927 |       |       |      |
    |* 49 |              HASH JOIN                  |                  |      1 |   2540 |   8927 |00:00:00.03 |      90 |      0 |   811K|   811K| 1397K (0)|
    |  50 |               TABLE ACCESS FULL         | RECYCLEBIN$      |      1 |   8319 |   8935 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 51 |               TABLE ACCESS FULL         | TS$              |      1 |      2 |     25 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 52 |              FIXED TABLE FIXED INDEX    | X$KTFBUE (ind:1) |   8927 |     12 |  65862 |00:00:11.66 |   39384 |   8927 |       |       |      |
    |* 53 |             INDEX UNIQUE SCAN           | I_FILE2          |  65862 |      1 |  65862 |00:00:00.45 |       2 |      0 |       |       |      |
    |* 54 |            TABLE ACCESS BY INDEX ROWID  | RECYCLEBIN$      |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  55 |             NESTED LOOPS                |                  |      1 |      1 |      1 |00:00:00.01 |     169 |      0 |       |       |      |
    |  56 |              NESTED LOOPS               |                  |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  57 |               NESTED LOOPS              |                  |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  58 |                TABLE ACCESS FULL        | UET$             |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |* 59 |                INDEX UNIQUE SCAN        | I_FILE2          |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 60 |               TABLE ACCESS CLUSTER      | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 61 |                INDEX UNIQUE SCAN        | I_TS#            |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 62 |              INDEX RANGE SCAN           | RECYCLEBIN$_TS   |      0 |   1188 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 63 |    TABLE ACCESS FULL                    | TS$              |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM=1)
       2 - filter( IS NULL)
       5 - filter(("A"."MBYTES_FREE"<4000 OR "A"."MBYTES_FREE" IS NULL))
       6 - access("A"."TABLESPACE_NAME"="B"."TABLESPACE_NAME")
      14 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
    PLAN_TABLE_OUTPUT
      17 - filter(("F"."SPARE1" IS NULL AND "F"."TS#" IS NOT NULL))
      18 - access("FE"."FENUM"="F"."FILE#")
           filter("FNFNO"="F"."FILE#")
      19 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      20 - access("F"."TS#"="TS"."TS#")
      25 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
      26 - filter("FNFNO"="HC"."KTFBHCAFNO")
      29 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      30 - access("HC"."KTFBHCTSN"="TS"."TS#")
      31 - filter("F"."SPARE1" IS NOT NULL)
      32 - access("FE"."FENUM"="F"."FILE#")
           filter("FNFNO"="F"."FILE#")
      40 - access("F"."TS#"="FI"."TS#" AND "F"."FILE#"="FI"."RELFILE#")
    PLAN_TABLE_OUTPUT
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      41 - filter(("TS"."TS#"="F"."TS#" AND "TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND
                  "TS"."NAME"<>'Q305_CALLS_TS' AND "TS"."NAME"<>'Q305_ICALLS_TS' AND ... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      44 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND .... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      45 - filter("TS"."TS#"="F"."KTFBFETSN")
      46 - access("F"."KTFBFETSN"="FI"."TS#" AND "F"."KTFBFEFNO"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      49 - access("TS"."TS#"="RB"."TS#")
      51 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND...."TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      52 - filter(("U"."KTFBUESEGTSN"="RB"."TS#" AND "U"."KTFBUESEGFNO"="RB"."FILE#" AND "U"."KTFBUESEGBNO"="RB"."BLOCK#"))
      53 - access("RB"."TS#"="FI"."TS#" AND "U"."KTFBUEFNO"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
    PLAN_TABLE_OUTPUT
      54 - filter(("U"."SEGFILE#"="RB"."FILE#" AND "U"."SEGBLOCK#"="RB"."BLOCK#"))
      59 - access("U"."TS#"="FI"."TS#" AND "U"."SEGFILE#"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      60 - filter(("TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND .... AND "TS"."NAME"<>'UNLMT_INT_CALLS_Q408_TS' AND
                  "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      61 - access("TS"."TS#"="U"."TS#")
      62 - access("U"."TS#"="RB"."TS#")
      63 - filter((DECODE("TS"."CONTENTS$",0,DECODE(BITAND("TS"."FLAGS",16),16,'UNDO','PERMANENT'),1,'TEMPORARY')='UNDO' AND "TS"."ONLINE$"<>3 AND
                  BITAND("FLAGS",2048)<>2048 AND LNNVL("TS"."NAME"<>:B1)))
    Note
    PLAN_TABLE_OUTPUT
       - cpu costing is off (consider enabling it)

    Version 10204
    I am running the following statment in order to monitor tablespace free space.
    There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
    only when less than 4 GB left in the tablespace.
    And just adding to Dan's reply, if you are on 10g as you mentioned, why not to use the built in Alert mechanism to monitor and get alerts about the tablespace usage using the GC or Database Console than creating a home grown solution like the one you have posted?
    Aman....

  • How to tune this SQL Query?

    Hi all expert out there,
    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options.
    I have this ERP 11i query took 3-4hours to execute. can anyone help to have a look at the Query so make it more faster? I am already out of my idea of solving this. Kindly helpzzz...
    SELECT
    /*+ first_rows(1)*/
    hou.name "OU" ,-- e.g. Seagate Technology USOP1 ,
    mc.description,
    oel.ordered_item "Product Part Number",
    oeh.order_number "Order Num",
    hp.party_name "Bill To Cust Name",
    hcsu.location "Ship To Cust Num",
    oel.line_number || '.' || oel.shipment_number "Order Line Num",
    ft.nls_territory "Ship To Country",
    mc.segment7 "designapplication",
    ccm.formattedcapacity||'GB' "Capacity",
    oel.attribute1 "Order Category",
    oel.Subinventory "Subinventory",
    to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
    NVL(oel.shipped_quantity,0) "Net Units"
    FROM
    oe_order_headers_all oeh
    ,oe_order_lines_all oel
    ,apps.hz_parties hp
    ,apps.hz_cust_accounts hca
    ,apps.hz_cust_site_uses_all hcsu
    ,apps.hz_cust_acct_sites_all hcas
    , apps.seaeng_ccfamilymodelinfo ccm
    ,apps.hz_party_sites hps
    ,apps.fnd_territories ft
    ,apps.hz_locations hl
    ,apps.hr_organization_units hou
    ,apps.mtl_parameters mp
    ,apps.mtl_item_categories mic
    ,apps.mtl_categories_b mc
    ,apps.fnd_lookup_values flv
    WHERE
    oeh.header_id = oel.header_id
    AND oel.flow_status_code = 'CLOSED'
    AND oeh.invoice_to_org_id = hcsu.site_use_id
    AND hl.country = ft.territory_code
    AND hps.location_id = hl.location_id
    AND hcas.party_site_id = hps.party_site_id
    AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
    AND hcas.cust_account_id = hca.cust_account_id
    AND hca.party_id = hp.party_id
    AND oeh.org_id = hou.organization_id
    AND oel.ship_from_org_id = mp.organization_id
    AND oel.inventory_item_id = mic.inventory_item_id
    AND mic.category_id = mc.category_id
    AND mic.category_set_id = 4
    AND mc.description = ccm.stmodelnumber
    AND flv.lookup_code = hca.sales_channel_code
    AND flv.lookup_type = 'SALES_CHANNEL'
    AND mc.segment7 IN ('PSG','ESG','NSG')
    AND flv.lookup_code NOT IN ('RTL','AD-RTL','EU')
    AND oel.attribute1 IN ('NB','NBEOL','NBSEA')
    AND oel.subinventory IN ('KFGI','AFGI','SFGIF','FGIF')
    AND hou.organization_id = 189
    AND trunc(oel.actual_shipment_date) between TO_DATE('01-Jan-2009','DD-MON-YYYY') and TO_DATE('31-JAN-2009','DD-MON-YYYY')
    regards,
    Lygine
    Edited by: user8989062 on Jun 7, 2010 6:39 PM

    5) The TKPROF output for this statement looks like the following:
    SELECT
    /*+ first_rows(1)*/
    hou.name "OU" ,-- e.g. Seagate Technology USOP1 ,
    mc.description,
    oel.ordered_item "Product Part Number",
    oeh.order_number "Order Num",
      hp.party_name  "Bill To Cust Name",
    hcsu.location "Ship To Cust Num",
    oel.line_number || '.' || oel.shipment_number "Order Line Num",
    ft.nls_territory  "Ship To Country",
    mc.segment7 "designapplication",
    ccm.formattedcapacity||'GB' "Capacity",
    oel.attribute1 "Order Category",
    oel.Subinventory "Subinventory",
    to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
    NVL(oel.shipped_quantity,0) "Net Units"
    FROM
          oe_order_headers_all oeh
         ,oe_order_lines_all   oel
         ,apps.hz_parties  hp
         ,apps.hz_cust_accounts  hca
         ,apps.hz_cust_site_uses_all   hcsu
         ,apps.hz_cust_acct_sites_all  hcas
        , apps.seaeng_ccfamilymodelinfo ccm
         ,apps.hz_party_sites hps
         ,apps.fnd_territories ft
         ,apps.hz_locations hl
         ,apps.hr_organization_units  hou
         ,apps.mtl_parameters  mp
         ,apps.mtl_item_categories mic
         ,apps.mtl_categories_b mc
         ,apps.fnd_lookup_values flv
    WHERE
               oeh.header_id = oel.header_id
    AND   oel.flow_status_code = 'CLOSED'
    AND   oeh.invoice_to_org_id = hcsu.site_use_id
    AND   hl.country = ft.territory_code
    AND   hps.location_id = hl.location_id
    AND   hcas.party_site_id = hps.party_site_id
    AND   hcsu.cust_acct_site_id = hcas.cust_acct_site_id
    AND   hcas.cust_account_id = hca.cust_account_id
    AND   hca.party_id   = hp.party_id
    AND   oeh.org_id = hou.organization_id
    AND   oel.ship_from_org_id = mp.organization_id
    AND   oel.inventory_item_id = mic.inventory_item_id
    AND   mic.category_id = mc.category_id
    AND   mic.category_set_id = 4
    AND   mc.description = ccm.stmodelnumber
    AND   flv.lookup_code = hca.sales_channel_code
    AND   flv.lookup_type = 'SALES_CHANNEL'
    AND mc.segment7 IN ('PSG','ESG','NSG')
    AND flv.lookup_code NOT IN ('RTL','AD-RTL','EU')
    AND oel.attribute1 IN ('NB','NBEOL','NBSEA')
    AND oel.subinventory IN ('KFGI','AFGI','SFGIF','FGIF')
    AND hou.organization_id = 189
    AND trunc(oel.actual_shipment_date) between TO_DATE('01-Jan-2009','DD-MON-YYYY') and TO_DATE('31-JAN-2009','DD-MON-YYYY')
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.79       0.79          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        7     22.23     240.85      19781     536082          0         592
    total        9     23.02     241.64      19781     536082          0         592
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 173 
    Rows     Row Source Operation
        592  NESTED LOOPS  (cr=536082 pr=19781 pw=0 time=240822989 us)
        592   NESTED LOOPS  (cr=534885 pr=19776 pw=0 time=239960969 us)
        592    NESTED LOOPS  (cr=533688 pr=19776 pw=0 time=239902332 us)
        594     NESTED LOOPS  (cr=532493 pr=19776 pw=0 time=239811721 us)
        594      NESTED LOOPS  (cr=531892 pr=19776 pw=0 time=239794703 us)
        594       NESTED LOOPS  (cr=530693 pr=19772 pw=0 time=239325284 us)
        594        NESTED LOOPS  (cr=529498 pr=19770 pw=0 time=239152940 us)
        594         NESTED LOOPS  (cr=527709 pr=19766 pw=0 time=236850676 us)
        594          NESTED LOOPS  (cr=525920 pr=19764 pw=0 time=235640068 us)
       2990           NESTED LOOPS  (cr=516943 pr=19688 pw=0 time=195144282 us)
       2990            NESTED LOOPS  (cr=516936 pr=19688 pw=0 time=195120297 us)
       2990             NESTED LOOPS  (cr=510806 pr=19682 pw=0 time=194678671 us)
       3000              HASH JOIN  (cr=504799 pr=19669 pw=0 time=193829763 us)
       3000               NESTED LOOPS  (cr=472280 pr=360 pw=0 time=49218087 us)
          1                NESTED LOOPS  (cr=1029 pr=34 pw=0 time=1745829 us)
          1                 TABLE ACCESS BY INDEX ROWID HR_ALL_ORGANIZATION_UNITS_TL (cr=424 pr=25 pw=0 time=1361442 us)
          1                  INDEX UNIQUE SCAN HR_ALL_ORGANIZATION_UNTS_TL_PK (cr=423 pr=25 pw=0 time=1361397 us)(object id 44637)
          1                 TABLE ACCESS BY INDEX ROWID HR_ALL_ORGANIZATION_UNITS (cr=605 pr=9 pw=0 time=384370 us)
          1                  INDEX UNIQUE SCAN HR_ORGANIZATION_UNITS_PK (cr=1 pr=0 pw=0 time=27 us)(object id 43498)
       3000                TABLE ACCESS BY INDEX ROWID OE_ORDER_LINES_ALL (cr=471251 pr=326 pw=0 time=47466249 us)
    156922                 INDEX RANGE SCAN OE_ORDER_LINES_N20 (cr=420 pr=7 pw=0 time=787919 us)(object id 37005064)
    263469               TABLE ACCESS FULL MTL_ITEM_CATEGORIES (cr=32519 pr=19309 pw=0 time=144242743 us)
       2990              TABLE ACCESS BY INDEX ROWID MTL_CATEGORIES_B (cr=6007 pr=13 pw=0 time=843569 us)
       3000               INDEX UNIQUE SCAN MTL_CATEGORIES_B_U1 (cr=3007 pr=2 pw=0 time=162636 us)(object id 37199)
       2990             TABLE ACCESS BY INDEX ROWID SEAENG_CCFAMILYMODELINFO (cr=6130 pr=6 pw=0 time=437784 us)
       2990              INDEX UNIQUE SCAN SEAENG_CCFAMILYMODELINFO_U1 (cr=2997 pr=0 pw=0 time=52872 us)(object id 35838918)
       2990            INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=7 pr=0 pw=0 time=16332 us)(object id 37657)
        594           TABLE ACCESS BY INDEX ROWID OE_ORDER_HEADERS_ALL (cr=8977 pr=76 pw=0 time=40491633 us)
       2990            INDEX UNIQUE SCAN OE_ORDER_HEADERS_U1 (cr=5987 pr=45 pw=0 time=2504442 us)(object id 41952)
        594          TABLE ACCESS BY INDEX ROWID HZ_CUST_SITE_USES_ALL (cr=1789 pr=2 pw=0 time=1208576 us)
        594           INDEX UNIQUE SCAN HZ_CUST_SITE_USES_U1 (cr=1195 pr=1 pw=0 time=105934 us)(object id 25124976)
        594         TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCT_SITES_ALL (cr=1789 pr=4 pw=0 time=2300224 us)
        594          INDEX UNIQUE SCAN HZ_CUST_ACCT_SITES_U1 (cr=1195 pr=2 pw=0 time=152238 us)(object id 25124996)
        594        TABLE ACCESS BY INDEX ROWID HZ_PARTY_SITES (cr=1195 pr=2 pw=0 time=170875 us)
        594         INDEX UNIQUE SCAN HZ_PARTY_SITES_U1 (cr=601 pr=1 pw=0 time=104550 us)(object id 25124993)
        594       TABLE ACCESS BY INDEX ROWID HZ_LOCATIONS (cr=1199 pr=4 pw=0 time=467329 us)
        594        INDEX UNIQUE SCAN HZ_LOCATIONS_U1 (cr=601 pr=0 pw=0 time=57749 us)(object id 25124992)
        594      TABLE ACCESS BY INDEX ROWID FND_TERRITORIES (cr=601 pr=0 pw=0 time=15562 us)
        594       INDEX UNIQUE SCAN FND_TERRITORIES_U1 (cr=7 pr=0 pw=0 time=6492 us)(object id 33083)
        592     TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCOUNTS (cr=1195 pr=0 pw=0 time=88925 us)
        594      INDEX UNIQUE SCAN HZ_CUST_ACCOUNTS_U1 (cr=601 pr=0 pw=0 time=27607 us)(object id 81600)
        592    INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=1197 pr=0 pw=0 time=56714 us)(object id 32878)
        592   TABLE ACCESS BY INDEX ROWID HZ_PARTIES (cr=1197 pr=5 pw=0 time=860140 us)
        592    INDEX UNIQUE SCAN HZ_PARTIES_U1 (cr=599 pr=0 pw=0 time=51136 us)(object id 25126074)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       7        0.00          0.00
      row cache lock                                  1        0.00          0.00
      gc current block 2-way                      24112        0.00         19.28
      gc cr grant 2-way                             406        0.00          0.19
      db file sequential read                       441        0.09         14.11
      gc cr block 2-way                             284        0.00          0.23
      gc cr block busy                              147        0.19          9.59
      gc current block congested                      2        0.00          0.00
      gc cr multi block request                   13079        0.00          3.98
      SQL*Net message from client                     7        0.27          1.87
      gc cr failure                                  39        0.00          0.02
      cr request retry                               39        0.98         38.27
      SQL*Net more data to client                    12        0.00          0.00
      db file scattered read                       2446        0.13        132.58
      gc cr disk read                                 5        0.00          0.00
    ********************************************************************************6) The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  b8pfhfxscqn1m, child number 0
    SELECT  /*+ gather_plan_statistics */  hou.name "OU" ,-- e.g. Seagate Technology USOP1 ,  mc.descript
    oeh.order_number "Order Num",   hp.party_name  "Bill To Cust Name",  hcsu.location "Ship To Cust Num",
    Num",  ft.nls_territory  "Ship To Country",  mc.segment7 "designapplication",  ccm.formattedcapacity
    oel.Subinventory "Subinventory",  to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
    oe_order_headers_all oeh      ,oe_order_lines_all   oel      ,apps.hz_parties  hp      ,apps.hz_cust
    ,apps.hz_cust_acct_sites_all  hcas     , apps.seaeng_ccfamilymodelinfo ccm      ,apps.hz_party_sites hps
        ,apps.hr_organization_units  hou      ,apps.mtl_paramete
    Plan hash value: 414863479
    | Id  | Operation                                  | Name                           | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  O
    |   1 |  NESTED LOOPS                              |                                |      1 |      1 |    592 |00:02:25.13 |     535K|  57267 |       |
    |   2 |   NESTED LOOPS                             |                                |      1 |      1 |    592 |00:02:24.22 |     533K|  57185 |      
    |   3 |    NESTED LOOPS                            |                                |      1 |      1 |    592 |00:02:24.15 |     532K|  57183 |     
    |   4 |     NESTED LOOPS                           |                                |      1 |      1 |    594 |00:02:24.00 |     531K|  57171 |     
    |   5 |      NESTED LOOPS                          |                                |      1 |      1 |    594 |00:02:23.98 |     530K|  57170 |    
    |   6 |       NESTED LOOPS                         |                                |      1 |      1 |    594 |00:02:23.49 |     529K|  57129 |   
    |   7 |        NESTED LOOPS                        |                                |      1 |      1 |    594 |00:02:23.08 |     528K|  57096 |  
    |   8 |         NESTED LOOPS                       |                                |      1 |      1 |    594 |00:02:22.51 |     526K|  57031 |       |
    |   9 |          NESTED LOOPS                      |                                |      1 |      1 |    594 |00:02:21.79 |     524K|  56968 |       |
    |  10 |           NESTED LOOPS                     |                                |      1 |      1 |   2990 |00:02:09.65 |     515K|  55703 |      
    |  11 |            NESTED LOOPS                    |                                |      1 |      1 |   2990 |00:02:09.62 |     515K|  55703 |     
    |  12 |             NESTED LOOPS                   |                                |      1 |      1 |   2990 |00:02:08.47 |     509K|  55599 |     
    |* 13 |              HASH JOIN                     |                                |      1 |      2 |   3000 |00:02:07.88 |     503K|  55516 |   974K
    |  14 |               NESTED LOOPS                 |                                |      1 |      2 |   3000 |00:01:39.07 |     471K|  23025 |   
    |  15 |                NESTED LOOPS                |                                |      1 |      1 |      1 |00:00:00.01 |       4 |      0 |  
    |  16 |                 TABLE ACCESS BY INDEX ROWID| HR_ALL_ORGANIZATION_UNITS_TL   |      1 |      1 |      1 |00:00
    |* 17 |                  INDEX UNIQUE SCAN         | HR_ALL_ORGANIZATION_UNTS_TL_PK |      1 |      1 |      1 |00:00:00.0
    |* 18 |                 TABLE ACCESS BY INDEX ROWID| HR_ALL_ORGANIZATION_UNITS      |      1 |      1 |      1 |00:00:
    |* 19 |                  INDEX UNIQUE SCAN         | HR_ORGANIZATION_UNITS_PK       |      1 |      1 |      1 |00:00:00.01
    |* 20 |                TABLE ACCESS BY INDEX ROWID | OE_ORDER_LINES_ALL             |      1 |      2 |   3000 |00:01
    |* 21 |                 INDEX RANGE SCAN           | OE_ORDER_LINES_N20             |      1 |  47575 |    156K|00:00:01.76 |     420
    |* 22 |               TABLE ACCESS FULL            | MTL_ITEM_CATEGORIES            |      1 |  96977 |    263K|00:00:28.49
    |* 23 |              TABLE ACCESS BY INDEX ROWID   | MTL_CATEGORIES_B               |   3000 |      1 |   2990 |00:00:0
    |* 24 |               INDEX UNIQUE SCAN            | MTL_CATEGORIES_B_U1            |   3000 |      1 |   3000 |00:00:00.21
    |  25 |             TABLE ACCESS BY INDEX ROWID    | SEAENG_CCFAMILYMODELINFO       |   2990 |      1 |   2990 |
    |* 26 |              INDEX UNIQUE SCAN             | SEAENG_CCFAMILYMODELINFO_U1    |   2990 |      1 |   2990 |00:00:
    |* 27 |            INDEX UNIQUE SCAN               | MTL_PARAMETERS_U1              |   2990 |      1 |   2990 |00:00:00.02 |    
    |* 28 |           TABLE ACCESS BY INDEX ROWID      | OE_ORDER_HEADERS_ALL           |   2990 |      1 |    594 |00:00:
    |* 29 |            INDEX UNIQUE SCAN               | OE_ORDER_HEADERS_U1            |   2990 |      1 |   2990 |00:00:04.29 |   
    |  30 |          TABLE ACCESS BY INDEX ROWID       | HZ_CUST_SITE_USES_ALL          |    594 |      1 |    594 |00:00:
    |* 31 |           INDEX UNIQUE SCAN                | HZ_CUST_SITE_USES_U1           |    594 |      1 |    594 |00:00:00.31 |   
    |  32 |         TABLE ACCESS BY INDEX ROWID        | HZ_CUST_ACCT_SITES_ALL         |    594 |      1 |    594 |00:00:
    |* 33 |          INDEX UNIQUE SCAN                 | HZ_CUST_ACCT_SITES_U1          |    594 |      1 |    594 |00:00:00.23 |   
    |  34 |        TABLE ACCESS BY INDEX ROWID         | HZ_PARTY_SITES                 |    594 |      1 |    594 |00:00:0
    |* 35 |         INDEX UNIQUE SCAN                  | HZ_PARTY_SITES_U1              |    594 |      1 |    594 |00:00:00.17 |     601
    |  36 |       TABLE ACCESS BY INDEX ROWID          | HZ_LOCATIONS                   |    594 |      1 |    594 |00:00:00.4
    |* 37 |        INDEX UNIQUE SCAN                   | HZ_LOCATIONS_U1                |    594 |      1 |    594 |00:00:00.17 |   
    |  38 |      TABLE ACCESS BY INDEX ROWID           | FND_TERRITORIES                |    594 |      1 |    594 |00:00:00
    |* 39 |       INDEX UNIQUE SCAN                    | FND_TERRITORIES_U1             |    594 |      1 |    594 |00:00:00.02
    |* 40 |     TABLE ACCESS BY INDEX ROWID            | HZ_CUST_ACCOUNTS               |    594 |      1 |    592 |00:00:0
    |* 41 |      INDEX UNIQUE SCAN                     | HZ_CUST_ACCOUNTS_U1            |    594 |      1 |    594 |00:00:00.04 |
    |* 42 |    INDEX RANGE SCAN                        | FND_LOOKUP_VALUES_U1           |    592 |      1 |    592 |00:00:00.06 |   
    |  43 |   TABLE ACCESS BY INDEX ROWID              | HZ_PARTIES                     |    592 |      1 |    592 |00:00:00.91 |  
    |* 44 |    INDEX UNIQUE SCAN                       | HZ_PARTIES_U1                  |    592 |      1 |    592 |00:00:00.40 |     599
    Predicate Information (identified by operation id):
      13 - access("OEL"."INVENTORY_ITEM_ID"="MIC"."INVENTORY_ITEM_ID")
      17 - access("HAOTL"."ORGANIZATION_ID"=189 AND "HAOTL"."LANGUAGE"=USERENV('LANG'))
           filter(DECODE("HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"HR_SECURITY"."SHOW_RECORD"('HR_ALL_ORGAN
      18 - filter("HAO"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"HAO"."BUSINESS_
      19 - access("HAO"."ORGANIZATION_ID"=189)
      20 - filter(("OEL"."FLOW_STATUS_CODE"='CLOSED' AND INTERNAL_FUNCTION("OEL"."ATTRIBUTE1") AND INTER
      21 - access("OEL"."SYS_NC00342$">=TO_DATE(' 2009-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "O
                  'syyyy-mm-dd hh24:mi:ss'))
      22 - filter("MIC"."CATEGORY_SET_ID"=4)
      23 - filter(("MC"."DESCRIPTION" IS NOT NULL AND INTERNAL_FUNCTION("MC"."SEGMENT7")))
      24 - access("MIC"."CATEGORY_ID"="MC"."CATEGORY_ID")
      26 - access("MC"."DESCRIPTION"="CCM"."STMODELNUMBER")
      27 - access("OEL"."SHIP_FROM_ORG_ID"="MP"."ORGANIZATION_ID")
      28 - filter("OEH"."ORG_ID"=189)
      29 - access("OEH"."HEADER_ID"="OEL"."HEADER_ID")
      31 - access("OEH"."INVOICE_TO_ORG_ID"="HCSU"."SITE_USE_ID")
      33 - access("HCSU"."CUST_ACCT_SITE_ID"="HCAS"."CUST_ACCT_SITE_ID")
      35 - access("HCAS"."PARTY_SITE_ID"="HPS"."PARTY_SITE_ID")
      37 - access("HPS"."LOCATION_ID"="HL"."LOCATION_ID")
      39 - access("HL"."COUNTRY"="FT"."TERRITORY_CODE")
      40 - filter(("HCA"."SALES_CHANNEL_CODE"<>'RTL' AND "HCA"."SALES_CHANNEL_CODE"<>'AD-RTL' AND "HCA".
      41 - access("HCAS"."CUST_ACCOUNT_ID"="HCA"."CUST_ACCOUNT_ID")
      42 - access("FLV"."LOOKUP_TYPE"='SALES_CHANNEL' AND "FLV"."LOOKUP_CODE"="HCA"."SALES_CHANNEL_CODE"
           filter(("FLV"."LOOKUP_CODE"<>'RTL' AND "FLV"."LOOKUP_CODE"<>'AD-RTL' AND "FLV"."LOOKUP_CODE"<
      44 - access("HCA"."PARTY_ID"="HP"."PARTY_ID")
    90 rows selected.
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &nbs

  • Moving files in Content and Structure View hangs on Long Running Operation Status window

    Hello,
    I have the following issue in a site collection: when I go to site content and structure and browse to a document library, and I select multiple documents, click actions --> move and give the target destination, the screen keeps hanging in LongRunningOperationProgress.aspx
    with the message "starting" and the running circle. The files do get moved, but the screen does not come back.
    In other site collections this works as normal, and when the LongRunningOperationProgress.aspx page is open, it also states (n of N files moved) or something similar. This status is missing in the faulty site collection.
    When I open https:\\<site collection url>\Long%20Running%20Operation%20Status\AllItems.aspx I see that an entry is created here with title "(no title)" and Status "NotStarted".
    I have included the ULS log, filtered on the thread ID. I am sure there are some clues there (like Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack>),
    but I can't figure out where to start solving this problem. The Windows event logs don't give any errors. This issue exists on both web front ends (tested locally). The farm is using 14.0.6106.5002.
    11-29-2011 16:11:29.74 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztu High LongRunningOperationJob.ThreadEntryPoint() about to call AppDomainUnloadListener.AcquireReaderLock(). 
    11-29-2011 16:11:29.74 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 6wyw Medium LRO - Background thread has been started, job=Site Content and Structure: Move. 
    11-29-2011 16:11:29.74 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:29.74 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:29.87 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:29.92 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:29.92 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:29.93 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:29.93 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:30.04 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.10 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.10 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:30.20 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=29.7716 
    11-29-2011 16:11:30.21 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8e2s Medium Unknown SPRequest error occurred. More information: 0x80070002 
    11-29-2011 16:11:30.21 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 72k4 Medium <nativehr>0x80070002</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.21 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High <nativehr>0x80070002</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.23 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8e2s Medium Unknown SPRequest error occurred. More information: 0x80070002 
    11-29-2011 16:11:30.23 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 72k4 Medium <nativehr>0x80070002</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.23 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High <nativehr>0x80070002</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.23 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:30.23 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:30.34 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.40 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:30.40 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:30.40 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8y3q Medium DeploymentWrapper.MoveItems() Export-Import begins. 
    11-29-2011 16:11:30.51 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Content Migration nasm High Starting Export. 
    11-29-2011 16:11:33.02 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.02 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=0.5154 
    11-29-2011 16:11:33.06 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.06 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=0.8865 
    11-29-2011 16:11:33.07 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.09 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=14.6208 
    11-29-2011 16:11:33.29 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.31 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=16.3934 
    11-29-2011 16:11:33.31 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.34 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=29.003 
    11-29-2011 16:11:33.62 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.63 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=1.2911 
    11-29-2011 16:11:33.63 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Export) 
    11-29-2011 16:11:33.63 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Export). Execution Time=0.5963 
    11-29-2011 16:11:35.29 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Content Migration nasm High Export completed. 
    11-29-2011 16:11:35.37 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Content Migration nasm High Initializing Import. 
    11-29-2011 16:11:35.46 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Content Migration nasm High Starting content import. 
    11-29-2011 16:11:35.46 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8gyh Medium DeploymentWrapper.ReparentForCopyImport() List { newTargetParentUrl = /org/dnp/English/sites/na/internal_functions/rd/microbia/technical/Technical
    Documentation. } 
    11-29-2011 16:11:35.46 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8gyh Medium DeploymentWrapper.ReparentForCopyImport() List { newTargetParentUrl = /org/dnp/English/sites/na/internal_functions/rd/microbia/technical/Technical
    Documentation. } 
    11-29-2011 16:11:35.49 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.49 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=0.4226 
    11-29-2011 16:11:35.49 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.56 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=68.3485 
    11-29-2011 16:11:35.57 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=117.3795 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=0.5005 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=0.4298 
    11-29-2011 16:11:35.70 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:35.90 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver)). Execution Time=21.7586 
    11-29-2011 16:11:35.98 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=19.2312 
    11-29-2011 16:11:35.98 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver)). Execution Time=39.5371 
    11-29-2011 16:11:35.99 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=13.1132 
    11-29-2011 16:11:36.02 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#1). Execution Time=30.0577 
    11-29-2011 16:11:36.04 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=351.0371 
    11-29-2011 16:11:36.04 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:36.04 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:36.15 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.20 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.21 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:36.21 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (import) 
    11-29-2011 16:11:36.37 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver)). Execution Time=22.1568 
    11-29-2011 16:11:36.45 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=19.8863 
    11-29-2011 16:11:36.46 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver)). Execution Time=41.1921 
    11-29-2011 16:11:36.49 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData#1). Execution Time=24.739 
    11-29-2011 16:11:36.49 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (import). Execution Time=293.9586 
    11-29-2011 16:11:36.51 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Content Migration nasm High Import completed. 
    11-29-2011 16:11:36.52 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8y3t Medium DeploymentWrapper.MoveItems Export-Import ends. 
    11-29-2011 16:11:36.52 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:36.52 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:36.63 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.68 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.68 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:36.68 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:36.68 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:36.79 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.84 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:36.84 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:36.84 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:36.84 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:36.96 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.01 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.01 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:37.06 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=18.5948 
    11-29-2011 16:11:37.09 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.SharePoint.Publishing.Internal.PublishingWebEventReceiver)). Execution Time=51.4523 
    11-29-2011 16:11:37.09 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8gxm Medium ObjectSerializer.DeleteListItem - deleted or recycled '/org/dnp/English/sites/na/internal_functions/rd/microbia/technical/Technical
    Documentation/Technical Documentation/test/000000_test2.txt' 
    11-29-2011 16:11:37.10 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Running, this=50303060 
    11-29-2011 16:11:37.10 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Running 
    11-29-2011 16:11:37.21 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.26 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.26 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:37.29 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (EnsureListItemsData). Execution Time=18.5953 
    11-29-2011 16:11:37.32 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (Event Receiver (Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,
    Microsoft.SharePoint.Publishing.Internal.PublishingWebEventReceiver)). Execution Time=50.4063 
    11-29-2011 16:11:37.38 w3wp.exe (0x0C04) 0x27F0 Web Content Management Site Management 8gxm Medium ObjectSerializer.DeleteListItem - deleted or recycled '/org/dnp/English/sites/na/internal_functions/rd/microbia/technical/Technical
    Documentation/Technical Documentation/test/000000_test1.txt' 
    11-29-2011 16:11:37.38 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztw Medium LongRunningOperationJob.UpdateStatus(): Successful, this=50303060 
    11-29-2011 16:11:37.38 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztx Medium LRO - Starting status update: Successful 
    11-29-2011 16:11:37.51 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.56 w3wp.exe (0x0C04) 0x27F0 SharePoint Foundation General 8kh7 High Invalid text value.  A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack> 
    11-29-2011 16:11:37.56 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 1ygq Unexpected LRO - failed to update status after 2 attempts - giving up 
    11-29-2011 16:11:37.56 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 6wyz Medium LRO - Total elapsed time of background thread was 00:00:07.8122551 , from  11/29/2011 3:11:29 PM  to  11/29/2011
    3:11:37 PM, job=Site Content and Structure: Move 
    11-29-2011 16:11:37.56 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 8ztv High LongRunningOperationJob.ThreadEntryPoint() about to call AppDomainUnloadListener.ReleaseReaderLock(). 
    11-29-2011 16:11:37.57 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 79ja Medium LongRunningOperationJob - Deleting items from LRO list 
    11-29-2011 16:11:37.57 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing 79jb Medium LongRunningOperationJob - Deleting top 100 items from LRO list 
    11-29-2011 16:11:37.59 w3wp.exe (0x0C04) 0x27F0 Web Content Management Publishing a3z7 Medium LongRunningOperationJob - Skipping Delete.  oldestCreatedDate - 11/23/2011 11:13:27 AM, maxAge - 7, now - 11/29/2011 4:11:37
    PM, itemCount - 14 

    Hi,
    From your error message, this occurs when the value you supplied for a text field is larger than 255 characters. To address the problem, store less text in the field
    or change the field type from text to note.
    http://blogs.msdn.com/b/sanjaynarang/archive/2009/03/21/custom-field-control-not-allowing-more-than-255-characters.aspx
    Thanks,
    Rock Wang
    Regards, Rock Wang Microsoft Online Community Support

  • [SOLVED] Problem building php 5.3 with openssl

    Hi,
    I stuck with this issue and don't really know what's wrong and what to do:
    $ pacman -Qs openssl
    local/lib32-openssl 1.0.1.i-1
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (32-bit)
    local/openssl 1.0.1.i-1
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security
    $ ./configure --with-openssl && make
    loading cache ./config.cache
    checking for Cygwin environment... (cached) no
    checking for mingw32 environment... (cached) no
    checking for egrep... (cached) grep -E
    checking for a sed that does not truncate output... (cached) /usr/bin/sed
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for gcc... (cached) gcc
    checking whether the C compiler (gcc ) works... yes
    checking whether the C compiler (gcc ) is a cross-compiler... no
    checking whether we are using GNU C... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking how to run the C preprocessor... (cached) gcc -E
    checking for icc... no
    checking for suncc... no
    checking whether gcc and cc understand -c and -o together... (cached) yes
    checking how to run the C preprocessor... gcc -E
    checking for AIX... no
    checking whether ln -s works... (cached) yes
    checking for system library directory... lib
    checking whether to enable runpaths... yes
    checking if compiler supports -R... (cached) no
    checking if compiler supports -Wl,-rpath,... (cached) yes
    checking for gawk... (cached) gawk
    checking for bison... (cached) bison -y
    checking for bison version... (cached) 2.6.4 (ok)
    checking for re2c... (cached) re2c
    checking for re2c version... (cached) 0.13.7.5 (ok)
    checking whether to enable computed goto gcc extension with re2c... no
    checking whether to force non-PIC code in shared modules... no
    checking whether /dev/urandom exists... yes
    checking for pthreads_cflags... (cached) -pthread
    checking for pthreads_lib... (cached)
    [1mConfiguring SAPI modules[m
    checking for AOLserver support... no
    checking for Apache 1.x module support via DSO through APXS... no
    checking for Apache 1.x module support... no
    checking whether to enable Apache charset compatibility option... no
    checking for Apache 2.0 filter-module support via DSO through APXS... no
    checking for Apache 2.0 handler-module support via DSO through APXS... no
    checking for Apache 1.x (hooks) module support via DSO through APXS... no
    checking for Apache 1.x (hooks) module support... no
    checking whether to enable Apache charset compatibility option... no
    checking for Caudium support... no
    checking for CLI build... yes
    checking for Continuity support... no
    checking for embedded SAPI library support... no
    checking for FPM build... no
    checking for Zeus ISAPI support... no
    checking for LiteSpeed support... no
    checking for Milter support... no
    checking for NSAPI support... no
    checking for PHTTPD support... no
    checking for Pi3Web support... no
    checking whether Roxen module is build using ZTS... no
    checking for Roxen/Pike support...
    checking for thttpd... no
    checking for TUX... no
    checking for webjames... no
    checking whether to build CGI binary... yes
    checking for socklen_t in sys/socket.h... yes
    checking for sun_len in sys/un.h... no
    checking whether cross-process locking is required by accept()... no
    checking for chosen SAPI module... cgi
    [1mRunning system checks[m
    checking for sendmail... no
    checking whether system uses EBCDIC... (cached) no
    checking whether byte ordering is bigendian... (cached) no
    checking whether writing to stdout works... (cached) yes
    checking for socket... yes
    checking for socketpair... yes
    checking for htonl... yes
    checking for gethostname... yes
    checking for gethostbyaddr... yes
    checking for yp_get_default_domain... no
    checking for __yp_get_default_domain... no
    checking for yp_get_default_domain in -lnsl... yes
    checking for dlopen... no
    checking for __dlopen... no
    checking for dlopen in -ldl... yes
    checking for sin in -lm... (cached) yes
    checking for inet_aton... yes
    checking for ANSI C header files... (cached) yes
    checking for dirent.h that defines DIR... (cached) yes
    checking for opendir in -ldir... (cached) no
    checking for inttypes.h... (cached) yes
    checking for stdint.h... (cached) yes
    checking for dirent.h... (cached) yes
    checking for ApplicationServices/ApplicationServices.h... (cached) no
    checking for sys/param.h... (cached) yes
    checking for sys/types.h... (cached) yes
    checking for sys/time.h... (cached) yes
    checking for netinet/in.h... (cached) yes
    checking for alloca.h... (cached) yes
    checking for arpa/inet.h... (cached) yes
    checking for arpa/nameser.h... (cached) yes
    checking for assert.h... (cached) yes
    checking for crypt.h... (cached) yes
    checking for dns.h... (cached) no
    checking for fcntl.h... (cached) yes
    checking for grp.h... (cached) yes
    checking for ieeefp.h... (cached) no
    checking for langinfo.h... (cached) yes
    checking for limits.h... (cached) yes
    checking for locale.h... (cached) yes
    checking for monetary.h... (cached) yes
    checking for netdb.h... (cached) yes
    checking for pwd.h... (cached) yes
    checking for resolv.h... (cached) yes
    checking for signal.h... (cached) yes
    checking for stdarg.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for syslog.h... (cached) yes
    checking for sysexits.h... (cached) yes
    checking for sys/ioctl.h... (cached) yes
    checking for sys/file.h... (cached) yes
    checking for sys/mman.h... (cached) yes
    checking for sys/mount.h... (cached) yes
    checking for sys/poll.h... (cached) yes
    checking for sys/resource.h... (cached) yes
    checking for sys/select.h... (cached) yes
    checking for sys/socket.h... (cached) yes
    checking for sys/stat.h... (cached) yes
    checking for sys/statfs.h... (cached) yes
    checking for sys/statvfs.h... (cached) yes
    checking for sys/vfs.h... (cached) yes
    checking for sys/sysexits.h... (cached) no
    checking for sys/varargs.h... (cached) no
    checking for sys/wait.h... (cached) yes
    checking for sys/loadavg.h... (cached) no
    checking for termios.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for unix.h... (cached) no
    checking for utime.h... (cached) yes
    checking for sys/utsname.h... (cached) yes
    checking for sys/ipc.h... (cached) yes
    checking for dlfcn.h... (cached) yes
    checking for assert.h... (cached) yes
    checking for fopencookie... (cached) yes
    checking for broken getcwd... no
    checking for broken libc stdio... (cached) yes
    checking whether struct tm is in sys/time.h or time.h... (cached) time.h
    checking for tm_zone in struct tm... (cached) yes
    checking for missing declarations of reentrant functions... done
    checking for fclose declaration... ok
    checking for tm_gmtoff in struct tm... (cached) yes
    checking for struct flock... (cached) yes
    checking for socklen_t... (cached) yes
    checking size of size_t... (cached) 8
    checking size of long long... (cached) 8
    checking size of long long int... (cached) 8
    checking size of long... (cached) 8
    checking size of int... (cached) 4
    checking size of intmax_t... (cached) 8
    checking size of ssize_t... (cached) 8
    checking size of ptrdiff_t... (cached) 8
    checking for st_blksize in struct stat... (cached) yes
    checking for st_blocks in struct stat... (cached) yes
    checking for st_rdev in struct stat... (cached) yes
    checking for size_t... (cached) yes
    checking for uid_t in sys/types.h... (cached) yes
    checking for struct sockaddr_storage... (cached) yes
    checking for field sa_len in struct sockaddr... (cached) no
    checking for IPv6 support... (cached) yes
    checking for vprintf... (cached) yes
    checking for alphasort... (cached) yes
    checking for asctime_r... (cached) yes
    checking for chroot... (cached) yes
    checking for ctime_r... (cached) yes
    checking for cuserid... (cached) yes
    checking for crypt... (cached) no
    checking for flock... (cached) yes
    checking for ftok... (cached) yes
    checking for funopen... (cached) no
    checking for gai_strerror... (cached) yes
    checking for gcvt... (cached) yes
    checking for getloadavg... (cached) yes
    checking for getlogin... (cached) yes
    checking for getprotobyname... (cached) yes
    checking for getprotobynumber... (cached) yes
    checking for getservbyname... (cached) yes
    checking for getservbyport... (cached) yes
    checking for gethostname... (cached) yes
    checking for getrusage... (cached) yes
    checking for gettimeofday... (cached) yes
    checking for gmtime_r... (cached) yes
    checking for getpwnam_r... (cached) yes
    checking for getgrnam_r... (cached) yes
    checking for getpwuid_r... (cached) yes
    checking for grantpt... (cached) yes
    checking for inet_ntoa... (cached) yes
    checking for inet_ntop... (cached) yes
    checking for inet_pton... (cached) yes
    checking for isascii... (cached) yes
    checking for link... (cached) yes
    checking for localtime_r... (cached) yes
    checking for lockf... (cached) yes
    checking for lchown... (cached) yes
    checking for lrand48... (cached) yes
    checking for memcpy... (cached) yes
    checking for memmove... (cached) yes
    checking for mkstemp... (cached) yes
    checking for mmap... (cached) yes
    checking for nl_langinfo... (cached) yes
    checking for perror... (cached) yes
    checking for poll... (cached) yes
    checking for ptsname... (cached) yes
    checking for putenv... (cached) yes
    checking for realpath... (cached) yes
    checking for random... (cached) yes
    checking for rand_r... (cached) yes
    checking for scandir... (cached) yes
    checking for setitimer... (cached) yes
    checking for setlocale... (cached) yes
    checking for localeconv... (cached) yes
    checking for setenv... (cached) yes
    checking for setpgid... (cached) yes
    checking for setsockopt... (cached) yes
    checking for setvbuf... (cached) yes
    checking for shutdown... (cached) yes
    checking for sin... (cached) yes
    checking for snprintf... (cached) yes
    checking for srand48... (cached) yes
    checking for srandom... (cached) yes
    checking for statfs... (cached) yes
    checking for statvfs... (cached) yes
    checking for std_syslog... (cached) no
    checking for strcasecmp... (cached) yes
    checking for strcoll... (cached) yes
    checking for strdup... (cached) yes
    checking for strerror... (cached) yes
    checking for strftime... (cached) yes
    checking for strnlen... (cached) yes
    checking for strptime... (cached) yes
    checking for strstr... (cached) yes
    checking for strtok_r... (cached) yes
    checking for symlink... (cached) yes
    checking for tempnam... (cached) yes
    checking for tzset... (cached) yes
    checking for unlockpt... (cached) yes
    checking for unsetenv... (cached) yes
    checking for usleep... (cached) yes
    checking for utime... (cached) yes
    checking for vsnprintf... (cached) yes
    checking for vasprintf... (cached) yes
    checking for asprintf... (cached) yes
    checking for nanosleep... (cached) yes
    checking for nanosleep in -lrt... yes
    checking for getaddrinfo... (cached) yes
    checking for __sync_fetch_and_add... (cached) yes
    checking for strlcat... (cached) no
    checking for strlcpy... (cached) no
    checking for getopt... (cached) yes
    checking whether utime accepts a null argument... (cached) yes
    checking for working alloca.h... (cached) yes
    checking for alloca... (cached) yes
    checking for declared timezone... (cached) yes
    checking for type of reentrant time-related functions... (cached) POSIX
    checking for readdir_r... (cached) yes
    checking for type of readdir_r... (cached) POSIX
    checking for in_addr_t... (cached) yes
    checking for crypt_r... (cached) no
    [1mGeneral settings[m
    checking whether to include gcov symbols... no
    checking whether to include debugging symbols... no
    checking layout of installed files... PHP
    checking path to configuration file... DEFAULT
    checking where to scan for configuration files...
    checking whether to enable safe mode by default... no
    checking for safe mode exec dir... /usr/local/php/bin
    checking whether to enable PHP's own SIGCHLD handler... no
    checking whether to enable magic quotes by default... no
    checking whether to explicitly link against libgcc... no
    checking whether to enable short tags by default... yes
    checking whether to enable dmalloc... no
    checking whether to enable IPv6 support... yes
    checking how big to make fd sets... using system default
    [1mConfiguring extensions[m
    checking size of long... (cached) 8
    checking size of int... (cached) 4
    checking for int32_t... (cached) yes
    checking for uint32_t... (cached) yes
    checking for sys/types.h... (cached) yes
    checking for inttypes.h... (cached) yes
    checking for stdint.h... (cached) yes
    checking for string.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for strtoll... (cached) yes
    checking for atoll... (cached) yes
    checking for strftime... (cached) yes
    checking which regex library to use... php
    checking whether to enable LIBXML support... yes
    checking libxml2 install dir... no
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking for OpenSSL support... yes
    checking for Kerberos support... no
    checking for DSA_get_default_method in -lssl... (cached) no
    checking for X509_free in -lcrypto... (cached) yes
    checking for pkg-config... (cached) /usr/bin/pkg-config
    checking for PCRE library to use... bundled
    checking whether to enable the SQLite3 extension... yes
    checking bundled sqlite3 library... yes
    checking for ZLIB support... no
    checking if the location of ZLIB install directory is defined... no
    checking whether to enable bc style precision math functions... no
    checking for BZip2 support... no
    checking whether to enable calendar conversion support... no
    checking whether to enable ctype functions... yes
    checking for cURL support... no
    checking if we should use cURL for url streams... no
    checking for QDBM support... no
    checking for GDBM support... no
    checking for NDBM support... no
    checking for Berkeley DB4 support... no
    checking for Berkeley DB3 support... no
    checking for Berkeley DB2 support... no
    checking for DB1 support... no
    checking for DBM support... no
    checking for CDB support... no
    checking for INI File support... no
    checking for FlatFile support... no
    checking whether to enable DBA interface... no
    checking whether to enable DOM support... yes
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking for ENCHANT support... no
    checking whether to enable EXIF (metadata from images) support... no
    checking for fileinfo support... yes
    checking for utimes... (cached) yes
    checking for strndup... (cached) yes
    checking whether to enable input filter support... yes
    checking pcre install prefix... no
    checking whether to enable FTP support... no
    checking OpenSSL dir for FTP... no
    checking for GD support... no
    checking for the location of libjpeg... no
    checking for the location of libpng... no
    checking for the location of libXpm... no
    checking for FreeType 2... no
    checking for T1lib support... no
    checking whether to enable truetype string function in GD... no
    checking whether to enable JIS-mapped Japanese font support in GD... no
    checking for GNU gettext support... no
    checking for GNU MP support... no
    checking for mhash support... no
    checking whether to enable hash support... yes
    checking whether byte ordering is bigendian... (cached) no
    checking size of short... (cached) 2
    checking size of int... (cached) 4
    checking size of long... (cached) 8
    checking size of long long... (cached) 8
    checking for iconv support... yes
    checking for iconv... (cached) yes
    checking if iconv is glibc's... yes
    checking if iconv supports errno... yes
    checking if your cpp allows macro usage in include lines... yes
    checking for IMAP support... no
    checking for IMAP Kerberos support... no
    checking for IMAP SSL support... no
    checking for InterBase support... no
    checking whether to enable internationalization support... no
    checking whether to enable JavaScript Object Serialization support... yes
    checking for ANSI C header files... (cached) yes
    checking for LDAP support... no
    checking for LDAP Cyrus SASL support... no
    checking whether to enable multibyte string support... no
    checking whether to enable multibyte regex support... yes
    checking whether to check multibyte regex backtrack... yes
    checking for external libmbfl... no
    checking for external oniguruma... no
    checking for mcrypt support... no
    checking for MSSQL support via FreeTDS... no
    checking for MySQL support... no
    checking for specified location of the MySQL UNIX socket... no
    checking for MySQLi support... no
    checking whether to enable embedded MySQLi support... no
    checking for Oracle Database OCI8 support... no
    checking whether to enable pcntl support... no
    checking whether to enable PDO support... yes
    checking for PDO_DBLIB support via FreeTDS... no
    checking for Firebird support for PDO... no
    checking for MySQL support for PDO... no
    checking Oracle OCI support for PDO... no
    checking for ODBC v3 support for PDO... no
    checking for PostgreSQL support for PDO... no
    checking for sqlite 3 support for PDO... yes
    checking for PDO includes... checking for PDO includes... /home/yuri/_/php-5.3.29/ext
    checking for usleep... (cached) yes
    checking for nanosleep... (cached) yes
    checking for time.h... (cached) yes
    checking for fdatasync in -lrt... (cached) yes
    checking for PostgreSQL support... no
    checking for phar archive support... yes
    checking for phar openssl support... yes
    checking whether to enable POSIX-like functions... yes
    checking for sys/mkdev.h... (cached) no
    checking for seteuid... (cached) yes
    checking for setegid... (cached) yes
    checking for setsid... (cached) yes
    checking for getsid... (cached) yes
    checking for setpgid... (cached) yes
    checking for getpgid... (cached) yes
    checking for ctermid... (cached) yes
    checking for mkfifo... (cached) yes
    checking for mknod... (cached) yes
    checking for getrlimit... (cached) yes
    checking for getlogin... (cached) yes
    checking for getgroups... (cached) yes
    checking for makedev... (cached) no
    checking for initgroups... (cached) yes
    checking for getpwuid_r... (cached) yes
    checking for getgrgid_r... (cached) yes
    checking for working ttyname_r() implementation... yes
    checking for utsname.domainname... (cached) yes
    checking for PSPELL support... no
    checking for libedit readline replacement... no
    checking for readline support... no
    checking for recode support... no
    checking whether to enable PHP sessions... yes
    checking for mm support... no
    checking whether pwrite works... (cached) yes
    checking whether pread works... (cached) yes
    checking whether to enable shmop support... no
    checking whether to enable SimpleXML support... yes
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking for SNMP support... no
    checking OpenSSL dir for SNMP... no
    checking whether to enable UCD SNMP hack... no
    checking whether to enable SOAP support... no
    checking whether to enable sockets support... no
    checking whether zend_object_value is packed... no
    checking for sqlite support... yes
    checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)... no
    checking for PDO includes... (cached) /home/yuri/_/php-5.3.29/ext
    checking for lemon... (cached) lemon
    checking for lemon version... (cached) 1.0 (ok)
    checking size of char *... (cached) 8
    checking for usleep... (cached) yes
    checking for nanosleep... (cached) yes
    checking for time.h... (cached) yes
    checking whether flush should be called explicitly after a buffered io... (cached) no
    checking for crypt in -lcrypt... (cached) yes
    checking for standard DES crypt... (cached) yes
    checking for extended DES crypt... (cached) no
    checking for MD5 crypt... (cached) yes
    checking for Blowfish crypt... (cached) no
    checking for SHA512 crypt... (cached) no
    checking for SHA256 crypt... (cached) no
    checking whether the compiler supports __alignof__... (cached) yes
    checking whether the compiler supports aligned attribute... (cached) yes
    checking for getcwd... (cached) yes
    checking for getwd... (cached) yes
    checking for asinh... (cached) yes
    checking for acosh... (cached) yes
    checking for atanh... (cached) yes
    checking for log1p... (cached) yes
    checking for hypot... (cached) yes
    checking for glob... (cached) yes
    checking for strfmon... (cached) yes
    checking for nice... (cached) yes
    checking for fpclass... (cached) no
    checking for isinf... (cached) yes
    checking for isnan... (cached) yes
    checking for mempcpy... (cached) yes
    checking for strpncpy... (cached) no
    checking for working fnmatch... (cached) yes
    checking for fork... (cached) yes
    checking if your OS can spawn processes with inherited handles... yes
    checking for res_nsearch... no
    checking for __res_nsearch... no
    checking for res_nsearch in -lresolv... no
    checking for __res_nsearch in -lresolv... yes
    checking for dns_search... no
    checking for __dns_search... no
    checking for dns_search in -lresolv... no
    checking for __dns_search in -lresolv... no
    checking for dns_search in -lbind... no
    checking for __dns_search in -lbind... no
    checking for dns_search in -lsocket... no
    checking for __dns_search in -lsocket... no
    checking for dn_expand... no
    checking for __dn_expand... yes
    checking for dn_skipname... no
    checking for __dn_skipname... yes
    checking for res_search... no
    checking for __res_search... yes
    checking whether atof() accepts NAN... (cached) yes
    checking whether atof() accepts INF... (cached) yes
    checking whether HUGE_VAL == INF... (cached) yes
    checking whether HUGE_VAL + -HUGEVAL == NAN... (cached) yes
    checking whether strptime() declaration fails... (cached) no
    checking for wchar.h... (cached) yes
    checking for mblen... (cached) yes
    checking for mbrlen... (cached) yes
    checking for mbsinit... (cached) yes
    checking for mbstate_t... (cached) yes
    checking for atomic.h... (cached) no
    checking for Sybase-CT support... no
    checking whether to enable System V IPC support... no
    checking whether to enable System V semaphore support... no
    checking whether to enable System V shared memory support... no
    checking for TIDY support... no
    checking whether to enable tokenizer support... yes
    checking whether to enable WDDX support... no
    checking libexpat dir for WDDX... no
    checking whether to enable XML support... yes
    checking libexpat install dir... no
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking whether to enable XMLReader support... yes
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking for XMLRPC-EPI support... no
    checking libexpat dir for XMLRPC-EPI... no
    checking iconv dir for XMLRPC-EPI... no
    checking whether to enable XMLWriter support... yes
    checking for xml2-config path... (cached) /usr/bin/xml2-config
    checking whether libxml build works... (cached) yes
    checking for XSL support... no
    checking for zip archive read/writesupport... no
    checking pcre install prefix... no
    checking whether to enable mysqlnd... no
    checking whether to disable compressed protocol support in mysqlnd... yes
    [1mConfiguring PEAR[m
    checking whether to install PEAR... yes
    [1mConfiguring Zend[m
    checking for bison version... (cached) 2.6.4 (ok)
    checking for inttypes.h... (cached) yes
    checking for stdint.h... (cached) yes
    checking for limits.h... (cached) yes
    checking for malloc.h... (cached) yes
    checking for string.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for stdarg.h... (cached) yes
    checking for sys/types.h... (cached) yes
    checking for sys/time.h... (cached) yes
    checking for signal.h... (cached) yes
    checking for unix.h... (cached) no
    checking for stdlib.h... (cached) yes
    checking for dlfcn.h... (cached) yes
    checking for size_t... (cached) yes
    checking return type of signal handlers... (cached) void
    checking for uint... (cached) yes
    checking for ulong... (cached) yes
    checking for int32_t... yes
    checking for uint32_t... yes
    checking for vprintf... (cached) yes
    checking for 8-bit clean memcmp... (cached) yes
    checking for working alloca.h... (cached) yes
    checking for alloca... (cached) yes
    checking for memcpy... (cached) yes
    checking for strdup... (cached) yes
    checking for getpid... (cached) yes
    checking for kill... (cached) yes
    checking for strtod... (cached) yes
    checking for strtol... (cached) yes
    checking for finite... (cached) yes
    checking for fpclass... (cached) no
    checking for sigsetjmp... (cached) no
    checking whether sprintf is broken... (cached) no
    checking for finite... (cached) yes
    checking for isfinite... (cached) no
    checking for isinf... (cached) yes
    checking for isnan... (cached) yes
    checking whether fp_except is defined... (cached) no
    checking for usable _FPU_SETCW... yes
    checking for usable fpsetprec... no
    checking for usable _controlfp... no
    checking for usable _controlfp_s... no
    checking whether FPU control word can be manipulated by inline assembler... yes
    checking whether double cast to long preserves least significant bits... no
    checking for dlfcn.h... (cached) yes
    checking whether dlsym() requires a leading underscore in symbol names... no
    checking virtual machine dispatch method... CALL
    checking whether to enable thread-safety... no
    checking whether to enable inline optimization for GCC... yes
    checking whether to enable Zend debugging... no
    checking whether to enable Zend multibyte... no
    checking for inline... (cached) inline
    checking target system is Darwin... no
    checking for MM alignment and log values... done
    checking for memory allocation using mmap(MAP_ANON)... yes
    checking for memory allocation using mmap(/dev/zero)... yes
    checking for mremap... (cached) yes
    [1mConfiguring TSRM[m
    checking for stdarg.h... (cached) yes
    [1mConfiguring libtool[m
    checking build system type... x86_64-unknown-linux-gnu
    checking for ld used by gcc... (cached) /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
    checking for /usr/bin/ld option to reload object files... (cached) -r
    checking for BSD-compatible nm... (cached) /usr/bin/nm -B
    checking how to recognize dependent libraries... (cached) pass_all
    checking for object suffix... (cached) o
    checking for executable suffix... (cached) no
    checking the maximum length of command line arguments... (cached) 1572864
    checking command to parse /usr/bin/nm -B output from gcc object... (cached) ok
    checking for objdir... (cached) .libs
    checking for ar... (cached) ar
    checking for ranlib... (cached) ranlib
    checking for strip... (cached) strip
    checking if gcc supports -fno-rtti -fno-exceptions... (cached) no
    checking for gcc option to produce PIC... -fPIC
    checking if gcc PIC flag -fPIC works... (cached) yes
    checking if gcc static flag -static works... (cached) yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking dynamic linker characteristics... GNU/Linux ld.so
    (cached) (cached) checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes
    creating libtool
    appending configuration tag "CXX" to libtool
    [1mGenerating files[m
    creating ./config.status
    creating php5.spec
    creating main/build-defs.h
    creating scripts/phpize
    creating scripts/man1/phpize.1
    creating scripts/php-config
    creating scripts/man1/php-config.1
    creating sapi/cli/php.1
    creating main/php_config.h
    main/php_config.h is unchanged
    creating main/internal_functions.c
    creating main/internal_functions_cli.c
    +--------------------------------------------------------------------+
    | License: |
    | This software is subject to the PHP License, available in this |
    | distribution in the file LICENSE. By continuing this installation |
    | process, you are bound by the terms of this license agreement. |
    | If you do not agree with the terms of this license, you must abort |
    | the installation process at this point. |
    +--------------------------------------------------------------------+
    Thank you for using PHP.
    /bin/sh /home/yuri/_/php-5.3.29/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/standard/ -I/home/yuri/_/php-5.3.29/ext/standard/ -DPHP_ATOM_INC -I/home/yuri/_/php-5.3.29/include -I/home/yuri/_/php-5.3.29/main -I/home/yuri/_/php-5.3.29 -I/home/yuri/_/php-5.3.29/ext/date/lib -I/home/yuri/_/php-5.3.29/ext/ereg/regex -I/usr/include/libxml2 -I/home/yuri/_/php-5.3.29/ext/sqlite3/libsqlite -I/home/yuri/_/php-5.3.29/TSRM -I/home/yuri/_/php-5.3.29/Zend -I/usr/include -g -O2 -fvisibility=hidden -c /home/yuri/_/php-5.3.29/ext/standard/info.c -o ext/standard/info.lo
    /bin/sh /home/yuri/_/php-5.3.29/libtool --silent --preserve-dup-deps --mode=compile gcc -Imain/ -I/home/yuri/_/php-5.3.29/main/ -DPHP_ATOM_INC -I/home/yuri/_/php-5.3.29/include -I/home/yuri/_/php-5.3.29/main -I/home/yuri/_/php-5.3.29 -I/home/yuri/_/php-5.3.29/ext/date/lib -I/home/yuri/_/php-5.3.29/ext/ereg/regex -I/usr/include/libxml2 -I/home/yuri/_/php-5.3.29/ext/sqlite3/libsqlite -I/home/yuri/_/php-5.3.29/TSRM -I/home/yuri/_/php-5.3.29/Zend -I/usr/include -g -O2 -fvisibility=hidden -c main/internal_functions.c -o main/internal_functions.lo
    /bin/sh /home/yuri/_/php-5.3.29/libtool --silent --preserve-dup-deps --mode=link gcc -export-dynamic -I/usr/include -g -O2 -fvisibility=hidden ext/date/php_date.lo ext/date/lib/astro.lo ext/date/lib/dow.lo ext/date/lib/parse_date.lo ext/date/lib/parse_tz.lo ext/date/lib/timelib.lo ext/date/lib/tm2unixtime.lo ext/date/lib/unixtime2tm.lo ext/date/lib/parse_iso_intervals.lo ext/date/lib/interval.lo ext/ereg/ereg.lo ext/ereg/regex/regcomp.lo ext/ereg/regex/regexec.lo ext/ereg/regex/regerror.lo ext/ereg/regex/regfree.lo ext/libxml/libxml.lo ext/openssl/openssl.lo ext/openssl/xp_ssl.lo ext/pcre/pcrelib/pcre_chartables.lo ext/pcre/pcrelib/pcre_ucd.lo ext/pcre/pcrelib/pcre_compile.lo ext/pcre/pcrelib/pcre_config.lo ext/pcre/pcrelib/pcre_exec.lo ext/pcre/pcrelib/pcre_fullinfo.lo ext/pcre/pcrelib/pcre_get.lo ext/pcre/pcrelib/pcre_globals.lo ext/pcre/pcrelib/pcre_maketables.lo ext/pcre/pcrelib/pcre_newline.lo ext/pcre/pcrelib/pcre_ord2utf8.lo ext/pcre/pcrelib/pcre_refcount.lo ext/pcre/pcrelib/pcre_study.lo ext/pcre/pcrelib/pcre_tables.lo ext/pcre/pcrelib/pcre_valid_utf8.lo ext/pcre/pcrelib/pcre_version.lo ext/pcre/pcrelib/pcre_xclass.lo ext/pcre/php_pcre.lo ext/sqlite3/sqlite3.lo ext/sqlite3/libsqlite/sqlite3.lo ext/ctype/ctype.lo ext/dom/php_dom.lo ext/dom/attr.lo ext/dom/document.lo ext/dom/domerrorhandler.lo ext/dom/domstringlist.lo ext/dom/domexception.lo ext/dom/namelist.lo ext/dom/processinginstruction.lo ext/dom/cdatasection.lo ext/dom/documentfragment.lo ext/dom/domimplementation.lo ext/dom/element.lo ext/dom/node.lo ext/dom/string_extend.lo ext/dom/characterdata.lo ext/dom/documenttype.lo ext/dom/domimplementationlist.lo ext/dom/entity.lo ext/dom/nodelist.lo ext/dom/text.lo ext/dom/comment.lo ext/dom/domconfiguration.lo ext/dom/domimplementationsource.lo ext/dom/entityreference.lo ext/dom/notation.lo ext/dom/xpath.lo ext/dom/dom_iterators.lo ext/dom/typeinfo.lo ext/dom/domerror.lo ext/dom/domlocator.lo ext/dom/namednodemap.lo ext/dom/userdatahandler.lo ext/fileinfo/fileinfo.lo ext/fileinfo/libmagic/apprentice.lo ext/fileinfo/libmagic/apptype.lo ext/fileinfo/libmagic/ascmagic.lo ext/fileinfo/libmagic/cdf.lo ext/fileinfo/libmagic/cdf_time.lo ext/fileinfo/libmagic/compress.lo ext/fileinfo/libmagic/encoding.lo ext/fileinfo/libmagic/fsmagic.lo ext/fileinfo/libmagic/funcs.lo ext/fileinfo/libmagic/is_tar.lo ext/fileinfo/libmagic/magic.lo ext/fileinfo/libmagic/print.lo ext/fileinfo/libmagic/readcdf.lo ext/fileinfo/libmagic/readelf.lo ext/fileinfo/libmagic/softmagic.lo ext/filter/filter.lo ext/filter/sanitizing_filters.lo ext/filter/logical_filters.lo ext/filter/callback_filter.lo ext/hash/hash.lo ext/hash/hash_md.lo ext/hash/hash_sha.lo ext/hash/hash_ripemd.lo ext/hash/hash_haval.lo ext/hash/hash_tiger.lo ext/hash/hash_gost.lo ext/hash/hash_snefru.lo ext/hash/hash_whirlpool.lo ext/hash/hash_adler32.lo ext/hash/hash_crc32.lo ext/hash/hash_salsa.lo ext/iconv/iconv.lo ext/json/json.lo ext/json/utf8_to_utf16.lo ext/json/utf8_decode.lo ext/json/JSON_parser.lo ext/pdo/pdo.lo ext/pdo/pdo_dbh.lo ext/pdo/pdo_stmt.lo ext/pdo/pdo_sql_parser.lo ext/pdo/pdo_sqlstate.lo ext/pdo_sqlite/pdo_sqlite.lo ext/pdo_sqlite/sqlite_driver.lo ext/pdo_sqlite/sqlite_statement.lo ext/phar/util.lo ext/phar/tar.lo ext/phar/zip.lo ext/phar/stream.lo ext/phar/func_interceptors.lo ext/phar/dirstream.lo ext/phar/phar.lo ext/phar/phar_object.lo ext/phar/phar_path_check.lo ext/posix/posix.lo ext/reflection/php_reflection.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/simplexml/simplexml.lo ext/simplexml/sxe.lo ext/spl/php_spl.lo ext/spl/spl_functions.lo ext/spl/spl_engine.lo ext/spl/spl_iterators.lo ext/spl/spl_array.lo ext/spl/spl_directory.lo ext/spl/spl_exceptions.lo ext/spl/spl_observer.lo ext/spl/spl_dllist.lo ext/spl/spl_heap.lo ext/spl/spl_fixedarray.lo ext/sqlite/sqlite.lo ext/sqlite/sess_sqlite.lo ext/sqlite/pdo_sqlite2.lo ext/sqlite/libsqlite/src/opcodes.lo ext/sqlite/libsqlite/src/parse.lo ext/sqlite/libsqlite/src/encode.lo ext/sqlite/libsqlite/src/auth.lo ext/sqlite/libsqlite/src/btree.lo ext/sqlite/libsqlite/src/build.lo ext/sqlite/libsqlite/src/delete.lo ext/sqlite/libsqlite/src/expr.lo ext/sqlite/libsqlite/src/func.lo ext/sqlite/libsqlite/src/hash.lo ext/sqlite/libsqlite/src/insert.lo ext/sqlite/libsqlite/src/main.lo ext/sqlite/libsqlite/src/os.lo ext/sqlite/libsqlite/src/pager.lo ext/sqlite/libsqlite/src/printf.lo ext/sqlite/libsqlite/src/random.lo ext/sqlite/libsqlite/src/select.lo ext/sqlite/libsqlite/src/table.lo ext/sqlite/libsqlite/src/tokenize.lo ext/sqlite/libsqlite/src/update.lo ext/sqlite/libsqlite/src/util.lo ext/sqlite/libsqlite/src/vdbe.lo ext/sqlite/libsqlite/src/attach.lo ext/sqlite/libsqlite/src/btree_rb.lo ext/sqlite/libsqlite/src/pragma.lo ext/sqlite/libsqlite/src/vacuum.lo ext/sqlite/libsqlite/src/copy.lo ext/sqlite/libsqlite/src/vdbeaux.lo ext/sqlite/libsqlite/src/date.lo ext/sqlite/libsqlite/src/where.lo ext/sqlite/libsqlite/src/trigger.lo ext/standard/crypt_freesec.lo ext/standard/crypt_blowfish.lo ext/standard/crypt_sha512.lo ext/standard/crypt_sha256.lo ext/standard/php_crypt_r.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo ext/standard/uuencode.lo ext/standard/filters.lo ext/standard/proc_open.lo ext/standard/streamsfuncs.lo ext/standard/http.lo ext/tokenizer/tokenizer.lo ext/tokenizer/tokenizer_data.lo ext/xml/xml.lo ext/xml/compat.lo ext/xmlreader/php_xmlreader.lo ext/xmlwriter/php_xmlwriter.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/getopt.lo main/streams/streams.lo main/streams/cast.lo main/streams/memory.lo main/streams/filter.lo main/streams/plain_wrapper.lo main/streams/userspace.lo main/streams/transports.lo main/streams/xp_socket.lo main/streams/mmap.lo main/streams/glob_wrapper.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cgi/cgi_main.lo sapi/cgi/fastcgi.lo main/internal_functions.lo -lcrypt -lresolv -lcrypt -lrt -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lcrypt -o sapi/cgi/php-cgi
    ext/openssl/openssl.o: In function `zm_startup_openssl':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:992: undefined reference to `SSL_library_init'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:993: undefined reference to `OpenSSL_add_all_ciphers'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:994: undefined reference to `OpenSSL_add_all_digests'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:995: undefined reference to `OPENSSL_add_all_algorithms_noconf'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:997: undefined reference to `ERR_load_ERR_strings'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:998: undefined reference to `ERR_load_crypto_strings'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:999: undefined reference to `ERR_load_EVP_strings'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1003: undefined reference to `SSL_get_ex_new_index'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1078: undefined reference to `X509_get_default_cert_area'
    ext/openssl/openssl.o: In function `zm_info_openssl':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1108: undefined reference to `SSLeay_version'
    ext/openssl/openssl.o: In function `zm_shutdown_openssl':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1118: undefined reference to `EVP_cleanup'
    ext/openssl/openssl.o: In function `add_assoc_name_entry':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:567: undefined reference to `X509_NAME_entry_count'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:572: undefined reference to `X509_NAME_get_entry'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:573: undefined reference to `X509_NAME_ENTRY_get_object'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:574: undefined reference to `OBJ_obj2nid'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:578: undefined reference to `OBJ_nid2sn'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:593: undefined reference to `X509_NAME_get_entry'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:594: undefined reference to `X509_NAME_ENTRY_get_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:595: undefined reference to `ASN1_STRING_type'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:596: undefined reference to `ASN1_STRING_to_UTF8'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:588: undefined reference to `X509_NAME_get_index_by_OBJ'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:567: undefined reference to `X509_NAME_entry_count'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:601: undefined reference to `ASN1_STRING_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:602: undefined reference to `ASN1_STRING_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:580: undefined reference to `OBJ_nid2ln'
    ext/openssl/openssl.o: In function `asn1_time_to_time_t':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:647: undefined reference to `ASN1_STRING_type'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:652: undefined reference to `ASN1_STRING_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:652: undefined reference to `ASN1_STRING_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:657: undefined reference to `ASN1_STRING_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:662: undefined reference to `ASN1_STRING_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:668: undefined reference to `ASN1_STRING_length'
    ext/openssl/openssl.o: In function `setup_verify':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1686: undefined reference to `X509_STORE_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1728: undefined reference to `X509_LOOKUP_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1728: undefined reference to `X509_STORE_add_lookup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1730: undefined reference to `X509_LOOKUP_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1734: undefined reference to `X509_LOOKUP_hash_dir'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1734: undefined reference to `X509_STORE_add_lookup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1736: undefined reference to `X509_LOOKUP_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1709: undefined reference to `X509_LOOKUP_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1709: undefined reference to `X509_STORE_add_lookup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1710: undefined reference to `X509_LOOKUP_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1717: undefined reference to `X509_LOOKUP_hash_dir'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1717: undefined reference to `X509_STORE_add_lookup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1718: undefined reference to `X509_LOOKUP_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1728: undefined reference to `X509_LOOKUP_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1728: undefined reference to `X509_STORE_add_lookup'
    ext/openssl/openssl.o: In function `php_sk_X509_free':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1786: undefined reference to `X509_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1784: undefined reference to `sk_pop'
    ext/openssl/openssl.o: In function `zif_openssl_pkcs12_read':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2024: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2024: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2026: undefined reference to `BIO_write'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2092: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2095: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2098: undefined reference to `X509_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2029: undefined reference to `d2i_PKCS12_bio'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2030: undefined reference to `PKCS12_parse'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2036: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2036: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2037: undefined reference to `PEM_write_bio_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2044: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2046: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2046: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2047: undefined reference to `PEM_write_bio_PrivateKey'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2054: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2073: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2075: undefined reference to `X509_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2061: undefined reference to `sk_pop'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2064: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2064: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2065: undefined reference to `PEM_write_bio_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2067: undefined reference to `BIO_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2078: undefined reference to `sk_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2086: undefined reference to `PKCS12_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2049: undefined reference to `BIO_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2039: undefined reference to `BIO_ctrl'
    ext/openssl/openssl.o: In function `php_openssl_dispose_config':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:859: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:863: undefined reference to `CONF_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:867: undefined reference to `CONF_free'
    ext/openssl/openssl.o: In function `php_openssl_load_rand_file':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:884: undefined reference to `RAND_egd'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:883: undefined reference to `RAND_file_name'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:890: undefined reference to `RAND_load_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:891: undefined reference to `RAND_status'
    ext/openssl/openssl.o: In function `php_openssl_write_rand_file':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:916: undefined reference to `RAND_write_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:914: undefined reference to `RAND_file_name'
    ext/openssl/openssl.o: In function `php_openssl_generate_private_key':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2855: undefined reference to `CONF_get_string'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2858: undefined reference to `EVP_PKEY_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2909: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2885: undefined reference to `DH_generate_parameters'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2889: undefined reference to `DH_get_default_method'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2889: undefined reference to `DH_set_method'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2890: undefined reference to `DH_check'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2895: undefined reference to `DH_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2861: undefined reference to `RSA_generate_key'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2861: undefined reference to `EVP_PKEY_assign'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2868: undefined reference to `DSA_generate_parameters'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2870: undefined reference to `DSA_get_default_method'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2870: undefined reference to `DSA_set_method'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2871: undefined reference to `DSA_generate_key'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2872: undefined reference to `EVP_PKEY_assign'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2876: undefined reference to `DSA_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2890: undefined reference to `DH_generate_key'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2891: undefined reference to `EVP_PKEY_assign'
    ext/openssl/openssl.o: In function `zif_openssl_pkey_get_details':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3282: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3282: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3283: undefined reference to `PEM_write_bio_PUBKEY'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3284: undefined reference to `BIO_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3287: undefined reference to `EVP_PKEY_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3292: undefined reference to `EVP_PKEY_type'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3361: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3302: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3302: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3303: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3303: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3304: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3304: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3305: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3305: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3306: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3306: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3307: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3307: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3308: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3308: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3309: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3309: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3325: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3325: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3326: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3326: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3327: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3327: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3328: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3328: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3329: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3329: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3342: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3342: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3343: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3343: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3344: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3344: undefined reference to `BN_bn2bin'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3345: undefined reference to `BN_num_bits'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3345: undefined reference to `BN_bn2bin'
    ext/openssl/openssl.o: In function `verify_callback':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4408: undefined reference to `X509_STORE_CTX_get_current_cert'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4409: undefined reference to `X509_STORE_CTX_get_error'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4410: undefined reference to `X509_STORE_CTX_get_error_depth'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4413: undefined reference to `SSL_get_ex_data_X509_STORE_CTX_idx'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4413: undefined reference to `X509_STORE_CTX_get_ex_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4414: undefined reference to `SSL_get_ex_data'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4427: undefined reference to `X509_STORE_CTX_set_error'
    ext/openssl/openssl.o: In function `zif_openssl_get_md_methods':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4663: undefined reference to `OBJ_NAME_do_all_sorted'
    ext/openssl/openssl.o: In function `zif_openssl_get_cipher_methods':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4679: undefined reference to `OBJ_NAME_do_all_sorted'
    ext/openssl/openssl.o: In function `zif_openssl_digest':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4700: undefined reference to `EVP_get_digestbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4706: undefined reference to `EVP_MD_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4709: undefined reference to `EVP_DigestInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4710: undefined reference to `EVP_DigestUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4711: undefined reference to `EVP_DigestFinal'
    ext/openssl/openssl.o: In function `zif_openssl_dh_compute_key':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4965: undefined reference to `EVP_PKEY_type'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4969: undefined reference to `BN_bin2bn'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4971: undefined reference to `DH_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4972: undefined reference to `DH_compute_key'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4982: undefined reference to `BN_free'
    ext/openssl/openssl.o: In function `zif_openssl_random_pseudo_bytes':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:5010: undefined reference to `RAND_pseudo_bytes'
    ext/openssl/openssl.o: In function `zif_openssl_error_string':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4079: undefined reference to `ERR_get_error'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4081: undefined reference to `ERR_error_string'
    ext/openssl/openssl.o: In function `zif_openssl_cipher_iv_length':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4938: undefined reference to `EVP_get_cipherbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4944: undefined reference to `EVP_CIPHER_iv_length'
    ext/openssl/openssl.o: In function `zif_openssl_encrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4780: undefined reference to `EVP_get_cipherbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4786: undefined reference to `EVP_CIPHER_key_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4795: undefined reference to `EVP_CIPHER_iv_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4801: undefined reference to `EVP_CIPHER_block_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4804: undefined reference to `EVP_EncryptInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4808: undefined reference to `EVP_EncryptInit_ex'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4810: undefined reference to `EVP_EncryptUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4813: undefined reference to `EVP_EncryptFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4836: undefined reference to `EVP_CIPHER_CTX_cleanup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4806: undefined reference to `EVP_CIPHER_CTX_set_key_length'
    ext/openssl/openssl.o: In function `zif_openssl_decrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4864: undefined reference to `EVP_get_cipherbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4880: undefined reference to `EVP_CIPHER_key_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4889: undefined reference to `EVP_CIPHER_iv_length'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4891: undefined reference to `EVP_CIPHER_block_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4894: undefined reference to `EVP_DecryptInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4898: undefined reference to `EVP_DecryptInit_ex'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4899: undefined reference to `EVP_DecryptUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4901: undefined reference to `EVP_DecryptFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4918: undefined reference to `EVP_CIPHER_CTX_cleanup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4896: undefined reference to `EVP_CIPHER_CTX_set_key_length'
    ext/openssl/openssl.o: In function `php_openssl_csr_from_zval':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2295: undefined reference to `BIO_new_mem_buf'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2297: undefined reference to `PEM_read_bio_X509_REQ'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2298: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2293: undefined reference to `BIO_new_file'
    ext/openssl/openssl.o: In function `zif_openssl_csr_export':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2376: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2376: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2381: undefined reference to `PEM_write_bio_X509_REQ'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2394: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2392: undefined reference to `X509_REQ_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2384: undefined reference to `BIO_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2378: undefined reference to `X509_REQ_print'
    ext/openssl/openssl.o: In function `zif_openssl_csr_get_public_key':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2662: undefined reference to `X509_REQ_get_pubkey'
    ext/openssl/openssl.o: In function `php_openssl_x509_from_zval':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1200: undefined reference to `BIO_new_mem_buf'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1205: undefined reference to `d2i_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1205: undefined reference to `PEM_ASN1_read_bio'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1209: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1191: undefined reference to `BIO_new_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1195: undefined reference to `PEM_read_bio_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1196: undefined reference to `BIO_free'
    ext/openssl/openssl.o: In function `zif_openssl_x509_export_to_file':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1247: undefined reference to `BIO_new_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1252: undefined reference to `PEM_write_bio_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1261: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1250: undefined reference to `X509_print'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1259: undefined reference to `X509_free'
    ext/openssl/openssl.o: In function `zif_openssl_x509_export':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1286: undefined reference to `BIO_s_mem'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1286: undefined reference to `BIO_new'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1290: undefined reference to `PEM_write_bio_X509'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1294: undefined reference to `BIO_ctrl'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1303: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1301: undefined reference to `X509_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1288: undefined reference to `X509_print'
    ext/openssl/openssl.o: In function `php_openssl_evp_from_zval':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2813: undefined reference to `BIO_new_mem_buf'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2811: undefined reference to `BIO_new_file'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2819: undefined reference to `PEM_read_bio_PrivateKey'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2820: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2826: undefined reference to `X509_get_pubkey'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2830: undefined reference to `X509_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2795: undefined reference to `BIO_new_mem_buf'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2800: undefined reference to `PEM_read_bio_PUBKEY'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2801: undefined reference to `BIO_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2826: undefined reference to `X509_get_pubkey'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:2793: undefined reference to `BIO_new_file'
    ext/openssl/openssl.o: In function `zif_openssl_private_encrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3844: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3850: undefined reference to `RSA_private_encrypt'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3871: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_private_decrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3902: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3908: undefined reference to `RSA_private_decrypt'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3934: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_public_encrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3967: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3973: undefined reference to `RSA_public_encrypt'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:3992: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_public_decrypt':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4026: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4032: undefined reference to `RSA_public_decrypt'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4063: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_sign':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4129: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4132: undefined reference to `EVP_DigestInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4133: undefined reference to `EVP_DigestUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4134: undefined reference to `EVP_SignFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4143: undefined reference to `EVP_MD_CTX_cleanup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4145: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4119: undefined reference to `EVP_get_digestbyname'
    ext/openssl/openssl.o: In function `zif_openssl_verify':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4191: undefined reference to `EVP_DigestInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4192: undefined reference to `EVP_DigestUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4193: undefined reference to `EVP_VerifyFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4194: undefined reference to `EVP_MD_CTX_cleanup'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4175: undefined reference to `EVP_get_digestbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4197: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_seal':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4232: undefined reference to `EVP_get_cipherbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4259: undefined reference to `EVP_PKEY_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4264: undefined reference to `EVP_EncryptInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4316: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4275: undefined reference to `EVP_CIPHER_CTX_block_size'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4277: undefined reference to `EVP_SealInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4277: undefined reference to `EVP_EncryptUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4283: undefined reference to `EVP_SealFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4238: undefined reference to `EVP_rc4'
    ext/openssl/openssl.o: In function `zif_openssl_open':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4356: undefined reference to `EVP_get_cipherbyname'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4367: undefined reference to `EVP_OpenInit'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4367: undefined reference to `EVP_DecryptUpdate'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4371: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4368: undefined reference to `EVP_OpenFinal'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4362: undefined reference to `EVP_rc4'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:4383: undefined reference to `EVP_PKEY_free'
    ext/openssl/openssl.o: In function `zif_openssl_x509_check_private_key':
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1327: undefined reference to `X509_check_private_key'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1331: undefined reference to `EVP_PKEY_free'
    /home/yuri/_/php-5.3.29/ext/openssl/openssl.c:1334: undefined reference to `X509_free'
    ext/openssl/openssl.o: In function `zif_openssl_x509_parse':
    /hom

    Which one is it supposed to be? I have both versions installed side-by-side in /usr/lib, the prefix was /usr. Also, I was thinking about openssl installing header files into /usr/include. Aren't they needed to compile this php extension? openssl098 basically installs just the library:
    $ pacaur -Ql openssl098
    openssl098 /usr/
    openssl098 /usr/bin/
    openssl098 /usr/bin/openssl098
    openssl098 /usr/lib/
    openssl098 /usr/lib/libcrypto.so.0.9.8
    openssl098 /usr/lib/libssl.so.0.9.8
    openssl098 /usr/share/
    openssl098 /usr/share/licenses/
    openssl098 /usr/share/licenses/openssl098
    Maybe I should go with compiling openssl from sources after all...
    On a side note
    x33a wrote:In case you do try out an older version, make sure to use one with the heartbleed patch.
    Does it matter? I'm going to use it for development.

  • Unable to drop or truncate a plan table

    Hi guys,
    I was trying to execute 'Explain Plan' on one of my query. However, when I tried to drop the plan table, i was prompted that the table or view does not exists:
    QL> EXPLAIN PLAN FOR
    2 SELECT * FROM ORDERS WHERE TO_CHAR(O_SHIP_DATE, 'YYYY')='2005' AND O_STATUS='PROCESSING';
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1275100350
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 648 | 46008 | 725 (5)| 00:00:09 |
    |* 1 | TABLE ACCESS FULL| ORDERS | 648 | 46008 | 725 (5)| 00:00:09 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    1 - filter("O_STATUS"='PROCESSING' AND
    TO_CHAR(INTERNAL_FUNCTION("O_SHIP_DATE"),'YYYY')='2005')
    14 rows selected.
    SQL> TRUNCATE TABLE PLAN_TABLE;
    TRUNCATE TABLE PLAN_TABLE
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> select count(*) from plan_table;
    COUNT(*)
    6
    Any idea what went wrong? Thanks in advance.

    Ok, I managed to find the scripts to recreate the plan table. Now it works again. Cheers.

  • Performance of SQL in 2 cases

    I am confused with respect to Performance of the below SQL in 2 cases
    In order to get the total no. of records from the innermost select.
    Once i am using the "COUNT(*) OVER () cnt" function
    SELECT b.lastname,
    b.firstname,
    b.department,
    b.org_relationship,
    b.enterprise_name,
    b.cnt
    FROM (
    SELECT a.*,
    rownum rn
    FROM (
    SELECT p.lastname,
    p.firstname,
    porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name,
    COUNT() OVER () cnt --------------&gt;the "COUNT(*) OVER () cnt" function*
    FROM t_person p,
    t_contact c1,
    t_o_person porg
    WHERE p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    ORDER BY upper(p.lastname), upper(p.firstname)
    ) a
    WHERE rownum &lt;= &lt;&lt;max row requested&gt;&gt;
    ) b
    WHERE rn &gt; &lt;&lt;min row requested&gt;&gt;
    Next,I am using an INNER SELECT QUERY to get the total count.
    SELECT b.lastname,
    b.firstname,
    b.department,
    b.org_relationship,
    b.enterprise_name,
    b.cnt
    FROM (
    SELECT a.*,
    rownum rn
    FROM (
    SELECT p.lastname,
    p.firstname,
    porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name,
    *(SELECT count(*) from --------------&gt;INNER SELECT QUERY to get the total count.*
    FROM t_person p,
    t_contact c1,
    t_o_person porg
    WHERE p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    ORDER BY upper(p.lastname), upper(p.firstname)
    *) as cnt*
    FROM t_person p,
    t_contact c1,
    t_o_person porg
    WHERE p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    ORDER BY upper(p.lastname), upper(p.firstname)
    ) a
    WHERE rownum &lt;= &lt;&lt;max row requested&gt;&gt;
    ) b
    WHERE rn &gt; &lt;&lt;min row requested&gt;&gt;
    So wanted to know which option would perform better in the above case? Is it the SEPERATE INNER SELECT to get the COUNT or using the COUNT() over () cnt ?*
    Edited by: [email protected] on Mar 10, 2009 12:41 PM

    Hi Thanks for the inputs.
    Even,if I put a filter on the main query also,it still shows the total records.
    SELECT * FROM (
      SELECT
                    beta.*, rownum as alpha
                from(
    SELECT p.lastname,
    p.firstname,
    porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name,
    (select count(*) from
    tmp_person p,
    tmp_contact c1,
    tmp_o_person porg
    WHERE p.CLM_ID ='1862' and
            p.person_id = c1.ref_id(+)
            AND p.person_id = porg.o_person_id
                    and porg.O_ORG_ID ='1862'
    ) as cnt
    FROM tmp_person p,
    tmp_contact c1,
    tmp_o_person porg
      WHERE p.CLM_ID ='1862' and
            p.person_id = c1.ref_id(+)
            AND p.person_id = porg.o_person_id
                    and porg.O_ORG_ID ='1862'
    ) beta
    WHERE rownum <= 100
    WHERE alpha >=1
    Plan hash value: 132875926
    | Id  | Operation                          | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                    |   100 |   840K|       | 21433   (1)| 00:04:18 |
    |*  1 |  VIEW                              |                    |   100 |   840K|       | 21433   (1)| 00:04:18 |
    |*  2 |   COUNT STOPKEY                    |                    |       |       |       |            |          |
    |   3 |    VIEW                            |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |*  4 |     SORT ORDER BY STOPKEY          |                    | 22858 |  6875K|    14M| 21433   (1)| 00:04:18 |
    |   5 |      MERGE JOIN OUTER              |                    | 22858 |  6875K|       | 18304   (1)| 00:03:40 |
    |   6 |       MERGE JOIN                   |                    | 22858 |  4397K|       | 11337   (1)| 00:02:17 |
    |   7 |        SORT JOIN                   |                    | 22858 |  3013K|  7192K|  5148   (1)| 00:01:02 |
    |*  8 |         TABLE ACCESS FULL          | TMP_PERSON         | 22858 |  3013K|       |  3716   (1)| 00:00:45 |
    |*  9 |        SORT JOIN                   |                    | 24133 |  1461K|  3800K|  6189   (1)| 00:01:15 |
    |  10 |         TABLE ACCESS BY INDEX ROWID| TMP_ORG_PERSON     | 24133 |  1461K|       |  5535   (1)| 00:01:07 |
    |* 11 |          INDEX RANGE SCAN          | TMP_ORG_PERSON_FK1 | 24133 |       |       |   102   (1)| 00:00:02 |
    |* 12 |       SORT JOIN                    |                    | 68472 |  7422K|    15M|  6968   (1)| 00:01:24 |
    |  13 |        TABLE ACCESS FULL           | TMP_CONTACT        | 68472 |  7422K|       |  2895   (1)| 00:00:35 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$2 / from$_subquery$_001@SEL$1
       2 - SEL$2
       3 - SEL$3 / BETA@SEL$2
       4 - SEL$3
       8 - SEL$3 / P@SEL$3
      10 - SEL$3 / PORG@SEL$3
      11 - SEL$3 / PORG@SEL$3
      13 - SEL$3 / C1@SEL$3
    Predicate Information (identified by operation id):
       1 - filter("ALPHA">=1)
       2 - filter(ROWNUM<=100)
       4 - filter(ROWNUM<=100)
       8 - filter("P"."CLM_ID"='1862')
       9 - access("P"."PERSON_ID"="PORG"."O_PERSON_ID")
           filter("P"."PERSON_ID"="PORG"."O_PERSON_ID")
      11 - access("PORG"."O_ORG_ID"='1862')
      12 - access("P"."PERSON_ID"="C1"."REF_ID"(+))
           filter("P"."PERSON_ID"="C1"."REF_ID"(+))
    Column Projection Information (identified by operation id):
       1 - "from$_subquery$_001"."LASTNAME"[NVARCHAR2,100],
           "from$_subquery$_001"."FIRSTNAME"[NVARCHAR2,100], "from$_subquery$_001"."PERSON_ID"[VARCHAR2,30],
           "from$_subquery$_001"."MIDDLENAME"[NVARCHAR2,100], "from$_subquery$_001"."SOCSECNUMBER"[NVARCHAR2,22],
           "from$_subquery$_001"."BIRTHDAY"[VARCHAR2,10], "from$_subquery$_001"."U_NAME"[NVARCHAR2,100],
           "from$_subquery$_001"."U_ID"[VARCHAR2,30], "from$_subquery$_001"."PERSON_XML_DATA"[VARCHAR2,4000],
           "from$_subquery$_001"."BUSPHONE"[VARCHAR2,4000], "from$_subquery$_001"."EMLNAME"[VARCHAR2,4000],
           "from$_subquery$_001"."ORG_NAME"[VARCHAR2,4000], "from$_subquery$_001"."EMPID"[NVARCHAR2,150],
           "from$_subquery$_001"."EMPSTATUS"[NVARCHAR2,40], "from$_subquery$_001"."DEPARTMENT"[NVARCHAR2,200],
           "from$_subquery$_001"."ORG_RELATIONSHIP"[NVARCHAR2,120],
           "from$_subquery$_001"."ENTERPRISE_NAME"[VARCHAR2,100], "from$_subquery$_001"."TOTAL_RESULTS"[NUMBER,22],
           "ALPHA"[NUMBER,22]
       2 - "BETA"."LASTNAME"[NVARCHAR2,100], "BETA"."FIRSTNAME"[NVARCHAR2,100],
           "BETA"."PERSON_ID"[VARCHAR2,30], "BETA"."MIDDLENAME"[NVARCHAR2,100],
           "BETA"."SOCSECNUMBER"[NVARCHAR2,22], "BETA"."BIRTHDAY"[VARCHAR2,10], "BETA"."U_NAME"[NVARCHAR2,100],
           "BETA"."U_ID"[VARCHAR2,30], "BETA"."PERSON_XML_DATA"[VARCHAR2,4000], "BETA"."BUSPHONE"[VARCHAR2,4000],
           "BETA"."EMLNAME"[VARCHAR2,4000], "BETA"."ORG_NAME"[VARCHAR2,4000], "BETA"."EMPID"[NVARCHAR2,150],
           "BETA"."EMPSTATUS"[NVARCHAR2,40], "BETA"."DEPARTMENT"[NVARCHAR2,200],
           "BETA"."ORG_RELATIONSHIP"[NVARCHAR2,120], "BETA"."ENTERPRISE_NAME"[VARCHAR2,100],
           "BETA"."TOTAL_RESULTS"[NUMBER,22], ROWNUM[4]
       3 - "BETA"."LASTNAME"[NVARCHAR2,100], "BETA"."FIRSTNAME"[NVARCHAR2,100],
           "BETA"."PERSON_ID"[VARCHAR2,30], "BETA"."MIDDLENAME"[NVARCHAR2,100],
           "BETA"."SOCSECNUMBER"[NVARCHAR2,22], "BETA"."BIRTHDAY"[VARCHAR2,10], "BETA"."U_NAME"[NVARCHAR2,100],
           "BETA"."U_ID"[VARCHAR2,30], "BETA"."PERSON_XML_DATA"[VARCHAR2,4000], "BETA"."BUSPHONE"[VARCHAR2,4000],
           "BETA"."EMLNAME"[VARCHAR2,4000], "BETA"."ORG_NAME"[VARCHAR2,4000], "BETA"."EMPID"[NVARCHAR2,150],
           "BETA"."EMPSTATUS"[NVARCHAR2,40], "BETA"."DEPARTMENT"[NVARCHAR2,200],
           "BETA"."ORG_RELATIONSHIP"[NVARCHAR2,120], "BETA"."ENTERPRISE_NAME"[VARCHAR2,100],
           "BETA"."TOTAL_RESULTS"[NUMBER,22]
       4 - (#keys=2) UPPER("P"."LASTNAME")[100], UPPER("P"."FIRSTNAME")[100], "P"."LASTNAME"[NVARCHAR2,100],
           "P"."FIRSTNAME"[NVARCHAR2,100], "P"."PERSON_ID"[VARCHAR2,30], "P"."MIDDLENAME"[NVARCHAR2,100],
           "P"."SOCSECNUMBER"[NVARCHAR2,22], TO_CHAR(INTERNAL_FUNCTION("P"."BIRTHDAY"),'mm-dd-yyyy')[10],
           "P"."USERNAME"[NVARCHAR2,100], "P"."CLM_ID"[VARCHAR2,30],
           "XMLTYPE"."GETSTRINGVAL"("XMLTYPE"."EXTRACT"(SYS_MAKEXML("P"."SYS_NC00008$"),'/'))[4000],
           "XMLTYPE"."GETSTRINGVAL"("XMLTYPE"."EXTRACT"(SYS_MAKEXML("C1"."SYS_NC00005$"),'//phone[1]/number/text()')
           )[4000], "XMLTYPE"."GETSTRINGVAL"("XMLTYPE"."EXTRACT"(SYS_MAKEXML("C1"."SYS_NC00005$"),'//email[2]/addres
           s/text()'))[4000], "XMLTYPE"."GETSTRINGVAL"("XMLTYPE"."EXTRACT"(SYS_MAKEXML("C1"."SYS_NC00005$"),'//compa
           ny/text()'))[4000], "PORG"."EMPLID"[NVARCHAR2,150], "PORG"."EMPL_STATUS"[NVARCHAR2,40],
           "PORG"."DEPARTMENT"[NVARCHAR2,200], "PORG"."ORG_RELATIONSHIP"[NVARCHAR2,120],
           "PORG"."ENTERPRISE_NAME"[VARCHAR2,100],  (SELECT /*+ */ COUNT(*) FROM "CLM_ORG_PERSON"
           "PORG","CLM_CONTACT" "C1","CLM_PERSON" "P" WHERE "P"."PERSON_ID"="PORG"."O_PERSON_ID" AND
           "P"."CLM_ID"='1862' AND "P"."PERSON_ID"="C1"."REF_ID"(+) AND "PORG"."O_ORG_ID"='1862')[22]
       5 - (#keys=0) "P"."PERSON_ID"[VARCHAR2,30], "PORG"."ENTERPRISE_NAME"[VARCHAR2,100],
           "P"."CLM_ID"[VARCHAR2,30], "P"."FIRSTNAME"[NVARCHAR2,100], "P"."LASTNAME"[NVARCHAR2,100],
           "P"."MIDDLENAME"[NVARCHAR2,100], "P"."SOCSECNUMBER"[NVARCHAR2,22], "P"."BIRTHDAY"[DATE,7],
           "P"."SYS_NC00008$"[LOB,4000], "P"."USERNAME"[NVARCHAR2,100], "PORG"."ORG_RELATIONSHIP"[NVARCHAR2,120],
           "PORG"."EMPLID"[NVARCHAR2,150], "PORG"."DEPARTMENT"[NVARCHAR2,200], "PORG"."EMPL_STATUS"[NVARCHAR2,40],
           "C1"."SYS_NC00005$"[LOB,4000]
       6 - (#keys=0) "P"."PERSON_ID"[VARCHAR2,30], "P"."CLM_ID"[VARCHAR2,30],
           "P"."FIRSTNAME"[NVARCHAR2,100], "P"."LASTNAME"[NVARCHAR2,100], "P"."MIDDLENAME"[NVARCHAR2,100],
           "P"."SOCSECNUMBER"[NVARCHAR2,22], "P"."BIRTHDAY"[DATE,7], "P"."SYS_NC00008$"[LOB,4000],
           "P"."USERNAME"[NVARCHAR2,100], "PORG"."ORG_RELATIONSHIP"[NVARCHAR2,120], "PORG"."EMPLID"[NVARCHAR2,150],
           "PORG"."DEPARTMENT"[NVARCHAR2,200], "PORG"."EMPL_STATUS"[NVARCHAR2,40],
           "PORG"."ENTERPRISE_NAME"[VARCHAR2,100]
       7 - (#keys=1) "P"."PERSON_ID"[VARCHAR2,30], "P"."CLM_ID"[VARCHAR2,30],
           "P"."FIRSTNAME"[NVARCHAR2,100], "P"."LASTNAME"[NVARCHAR2,100], "P"."MIDDLENAME"[NVARCHAR2,100],
           "P"."SOCSECNUMBER"[NVARCHAR2,22], "P"."BIRTHDAY"[DATE,7], "P"."SYS_NC00008$"[LOB,4000],
           "P"."USERNAME"[NVARCHAR2,100]
       8 - "P"."PERSON_ID"[VARCHAR2,30], "P"."FIRSTNAME"[NVARCHAR2,100], "P"."LASTNAME"[NVARCHAR2,100],
           "P"."MIDDLENAME"[NVARCHAR2,100], "P"."SOCSECNUMBER"[NVARCHAR2,22], "P"."BIRTHDAY"[DATE,7],
           "P"."SYS_NC00008$"[LOB,4000], "P"."USERNAME"[NVARCHAR2,100], "P"."CLM_ID"[VARCHAR2,30]
       9 - (#keys=1) "PORG"."O_PERSON_ID"[VARCHAR2,30], "PORG"."ORG_RELATIONSHIP"[NVARCHAR2,120],
           "PORG"."EMPLID"[NVARCHAR2,150], "PORG"."DEPARTMENT"[NVARCHAR2,200], "PORG"."EMPL_STATUS"[NVARCHAR2,40],
           "PORG"."ENTERPRISE_NAME"[VARCHAR2,100]
      10 - "PORG"."O_PERSON_ID"[VARCHAR2,30], "PORG"."EMPLID"[NVARCHAR2,150],
           "PORG"."DEPARTMENT"[NVARCHAR2,200], "PORG"."EMPL_STATUS"[NVARCHAR2,40],
           "PORG"."ENTERPRISE_NAME"[VARCHAR2,100], "PORG"."ORG_RELATIONSHIP"[NVARCHAR2,120]
      11 - "PORG".ROWID[ROWID,10]
      12 - (#keys=1) "C1"."REF_ID"[VARCHAR2,50], "C1"."SYS_NC00005$"[LOB,4000]
      13 - "C1"."REF_ID"[VARCHAR2,50], "C1"."SYS_NC00005$"[LOB,4000]

  • Kind of loop in sql? Any alternative?

    Hi,
    We have the following table
    create table orders
    order_id NUMBER(10),
    vehicle_id NUMEBR(10),
    customer_id NUMBER(10),
    data VARCHAR(10)
    order_id, customer_id and vehicle_id are indexed.
    In this table are stored multiple orders for multiple vehicles.
    I need an sql-statements which returns me the last 5 orders for each truck.
    For only one vehicle its no problem:
    select * from orders
    where vehicle_id = <ID>
    and rownum <=5
    order by order_id desc;
    But I need something like a loop to perform this statement for each vehicle_id.
    Or is there any way to put it into a subselect?
    Any ideas are welcome ;-)
    Thanks in advance,
    Andreas

    Hello
    Effectively by having the bind variable in there you are partitioning by customer and vehicle id, so by adding customer_id into the partition statement, the optimiser should be able to push the bind variable right down to the inner most view...
    XXX> CREATE TABLE dt_orders
      2  (      order_id NUMBER NOT NULL,
      3         customer_id     NUMBER NOT NULL,
      4         vehicle_id      NUMBER NOT NULL,
      5         some_padding    VARCHAR2(100) NOT NULL
      6  )
      7  /
    Table created.
    Elapsed: 00:00:00.23
    XXX> INSERT INTO dt_orders SELECT ROWNUM ID, MOD(ROWNUM,100),MOD(ROWNUM,100), lpad(
      2  /
    10000 rows created.
    Elapsed: 00:00:00.43
    XXX> CREATE INDEX dt_orders_i1 ON dt_orders(customer_id)
      2  /
    Index created.
    Elapsed: 00:00:00.17
    XXX> select *
      2  from (
      3  select o.*, rank() over(partition by vehicle_id order by order_id desc) rk
      4  from dt_orders o
      5  where customer_id = :var_cust_id
      6  )
      7  where rk <= 5;
    5 rows selected.
    Elapsed: 00:00:00.11
    Execution Plan
    Plan hash value: 3174093828
    | Id  | Operation                     | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |              |   107 | 11128 |    22   (5)| 00:00:01 |
    |*  1 |  VIEW                         |              |   107 | 11128 |    22   (5)| 00:00:01 |
    |*  2 |   WINDOW SORT PUSHED RANK     |              |   107 |  9737 |    22   (5)| 00:00:01 |
    |   3 |    TABLE ACCESS BY INDEX ROWID| DT_ORDERS    |   107 |  9737 |    21   (0)| 00:00:01 |
    |*  4 |     INDEX RANGE SCAN          | DT_ORDERS_I1 |    43 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RK"<=5)
       2 - filter(RANK() OVER ( PARTITION BY "VEHICLE_ID" ORDER BY
                  INTERNAL_FUNCTION("ORDER_ID") DESC )<=5)
       4 - access("CUSTOMER_ID"=TO_NUMBER(:VAR_CUST_ID))  <----
    Note
       - dynamic sampling used for this statement
    Statistics
             36  recursive calls
              0  db block gets
            247  consistent gets
              2  physical reads
              0  redo size
            518  bytes sent via SQL*Net to client
            239  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              5  rows processedyour original statement showing that the bind variable has been applied to access the dt_orders table via the index (predicate 4)
    If I change the statement to put the bind variable outside the inline view, we now do a full scan and you can see from predicate 1 that the customer id is being filtered at the highest level.
    XXX> select *
      2  from (
      3  select o.*, rank() over(partition by vehicle_id order by order_id desc) rk
      4  from dt_orders o
      5  )
      6  where rk <= 5
      7  AND customer_id = :var_cust_id ;
    5 rows selected.
    Elapsed: 00:00:00.32
    Execution Plan
    Plan hash value: 3560032888
    | Id  | Operation                | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |           | 10696 |  1086K|       |   268   (2)| 00:00:04 |
    |*  1 |  VIEW                    |           | 10696 |  1086K|       |   268   (2)| 00:00:04 |
    |*  2 |   WINDOW SORT PUSHED RANK|           | 10696 |   950K|  2216K|   268   (2)| 00:00:04 |
    |   3 |    TABLE ACCESS FULL     | DT_ORDERS | 10696 |   950K|       |    39   (3)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RK"<=5 AND "CUSTOMER_ID"=TO_NUMBER(:VAR_CUST_ID))  <---
       2 - filter(RANK() OVER ( PARTITION BY "VEHICLE_ID" ORDER BY
                  INTERNAL_FUNCTION("ORDER_ID") DESC )<=5)
    Note
       - dynamic sampling used for this statement
    Statistics
              4  recursive calls
              0  db block gets
            240  consistent gets
              0  physical reads
              0  redo size
            519  bytes sent via SQL*Net to client
            239  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              5  rows processedBut those two statements are really the same. By applying the filter inside the view as in your original, it means it's only going to calculate the rank for those customers. So we can add the customer id to the partition by statement which means the optimiser can safely push the predicate back down to the access of the orders table..
    XXX> select *
      2  from (
      3  select o.*, rank() over(partition by customer_id,vehicle_id order by order_id desc) rk
      4  from dt_orders o
      5  )
      6  where rk <= 5
      7  AND customer_id = :var_cust_id ;
    5 rows selected.
    Elapsed: 00:00:00.04
    Execution Plan
    Plan hash value: 3174093828
    | Id  | Operation                     | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |              |   107 | 11128 |    22   (5)| 00:00:01 |
    |*  1 |  VIEW                         |              |   107 | 11128 |    22   (5)| 00:00:01 |
    |*  2 |   WINDOW SORT PUSHED RANK     |              |   107 |  9737 |    22   (5)| 00:00:01 |
    |   3 |    TABLE ACCESS BY INDEX ROWID| DT_ORDERS    |   107 |  9737 |    21   (0)| 00:00:01 |
    |*  4 |     INDEX RANGE SCAN          | DT_ORDERS_I1 |    43 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RK"<=5)
       2 - filter(RANK() OVER ( PARTITION BY "CUSTOMER_ID","VEHICLE_ID" ORDER BY
                  INTERNAL_FUNCTION("ORDER_ID") DESC )<=5)
       4 - access("O"."CUSTOMER_ID"=TO_NUMBER(:VAR_CUST_ID))  <----
    Note
       - dynamic sampling used for this statement
    Statistics
              9  recursive calls
              0  db block gets
            244  consistent gets
              0  physical reads
              0  redo size
            519  bytes sent via SQL*Net to client
            239  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              5  rows processedHTH
    David

Maybe you are looking for