Optimizer_index_cost_adj

Hi,
Is there any documentation link by which i may know the formula for calculation of optimizer_index_cost_adj parameter in oracle version 10.2.0.1 for windows 32 bit machine. I knows that the value of this parameter influence index access, so i want to know how do i calculate the proper value for optimizer_index_cost_adj.
Thank you.

You keep asking for a formula. There is no "formula".
Pre-10g, DBAs would either
a. ask another DBA "hey what value do you use" and then the other DBA says "I set it at 25" , so the first DBA says "OK, I will set it at 25"
and/or
b. set it at different values and see the impact on execution plans and actual query execution time -- ie "performance".
Application vendors would say "we have tested different values with our application and highly recommend that you set it at 25" (or "... set it at 10") and so on.
All such methods would ignore the fact that different hardware combinations, under varying loads, perform differently.
Asking for a formula for this is like asking for a formula for the SGA size or for the number of disks or number of CPUs. The answer is : "it depends".
You may finally find someone who gives you a formula. Then you turn around it and use it on 4 different servers with different hardware and different database loads and find that there is no "one size fits all".
Here's a secret :
If you don't collect system statistics, the Optimizer will use certain hardcoded values for "single block" and "multiblock" read times -- and these values may be different for different platforms. Unfortunately, they do not account for differences in Storage subsystem performance and differences in database load (a query intensive application is very different from a write intensive application).
Hemant K Chitale
http://hemantoracledba.blogspot.com

Similar Messages

  • Setting parameters optimizer_index_caching and OPTIMIZER_INDEX_COST_ADJ

    Hi Guys!!
    I have to change the OPTIMIZER_INDEX_COST_ADJ and optimizer_index_caching parameters at the system level . is there any way to do that apart from shutting down the database. Version 9.2.0.8 , OS HP-UX . and please give me the procedure for that
    Thanks in advance
    Vicky

    vivky,
    I believe both the parameters are dynamic and can be changed without bouncing the db.
    I have done it here on my system and it works fine,
    SQL> show parameter optimizer
    NAME                                 TYPE
    VALUE
    optimizer_capture_sql_plan_baselines boolean
    FALSE
    optimizer_dynamic_sampling           integer
    2
    optimizer_features_enable            string
    11.1.0.6
    optimizer_index_caching              integer
    0
    optimizer_index_cost_adj             integer
    NAME                                 TYPE
    VALUE
    100
    optimizer_mode                       string
    ALL_ROWS
    optimizer_secure_view_merging        boolean
    TRUE
    optimizer_use_invisible_indexes      boolean
    FALSE
    optimizer_use_pending_statistics     boolean
    FALSE
    NAME                                 TYPE
    VALUE
    optimizer_use_sql_plan_baselines     boolean
    TRUE
    SQL> alter system set optimizer_index_caching=100;
    System altered.
    SQL> show parameter optimizer
    NAME                                 TYPE
    VALUE
    optimizer_capture_sql_plan_baselines boolean
    FALSE
    optimizer_dynamic_sampling           integer
    2
    optimizer_features_enable            string
    11.1.0.6
    optimizer_index_caching              integer
    100
    optimizer_index_cost_adj             integer
    NAME                                 TYPE
    VALUE
    100
    optimizer_mode                       string
    ALL_ROWS
    optimizer_secure_view_merging        boolean
    TRUE
    optimizer_use_invisible_indexes      boolean
    FALSE
    optimizer_use_pending_statistics     boolean
    FALSE
    NAME                                 TYPE
    VALUE
    optimizer_use_sql_plan_baselines     boolean
    TRUE
    SQL>That said,I shall suggest to be extremely careful when you play with these parameters.
    HTH
    Aman....

  • Performance problem in OLAP DB by using optimizer_index_cost_adj=1

    Hi,
    I have Oracle 11gR2 as my DB and Siebel 8.1 Application
    I would like to ask everyone about the significance of below two parameters:
    1> optimizer_index_cost_adj=1
    2> optimizer_index_caching=0
    I'm facing performance issue while extracting data from my OLTP DB to OLAP DB. Below I have described it much briefly for your persual
    I had noted that the explain plans to extract the data from OLTP are very bad to extract lots of OLTP data.
    For example, the explain plan for one of our transaction called "extract person data" is mostly doing nested loops instead of hash joins. I checked some OLTP parameter and I noted one important Db parameter “optimizer_index_cost_adj “ has the current value 1.This leads to the nested loops as the DB is not acting cost based Since, Oracle recommends this paramter value to 1 for better performance of Siebel application.
    Whereas, If I change the above paramters to below values
    optimizer_index_cost_adj=25;
    optimizer_index_caching=75;
    and I reused this parameter as to create explain plans for the specific long running queries and they changed as expected.
    Now, my question is if Oracle recommends 1> optimizer_index_cost_adj=1 and 2> optimizer_index_caching=0 then why the cost for many queries increase enormously which in turn leads to bad performance during extraction of dat from OLTP system to OLAP system?
    Request you to please comment and suggest me how to proceed
    Thanks,
    Anil

    Going from 10.2.x to 11.2.0.3 I have often noticed two points:
    First, you must re-gather system statistics. If you run
    select * from sys.aux_stats$;
    what do you get? Have they ever been gathered? I suspect the 11.x makes more use of them than earlier releases.
    Secondly, the default for serialdirect_read is now auto, in 10g it was (I think) false. This can have a big effect on pushing the optimizer away from indexes.

  • Whether to use optimizer_index_cost_adj??  Please advise...

    I am troubleshooting some issues we are having with a customer db in which some queries are performing poorly. I have checked (and run) statistics using DBMS_STATS.gather_schema_stats. I have been reviewing parameters and haven't come across anything unusual.
    Currently the parameter optimizer_index_cost_adj is set to 100, the default. I have been experimenting with setting this to different values and have found that the lower I set the the better the plan. Setting it to a value of 1 actually seemed to be the best.
    But I have been reading many docs where it recommended to set it to a higher value, if at all. Can anyone provide some insight as to their experiences with this parameter? I am hesitant to set this without knowing how it might effect other queries.
    Your thoughts are appreciated. Thanks. Tyler

    Hi,
    I agree with the other posters. If you have the time, try to adjust your schema stats BEFORE adjustiung the optimizer parms (unless you are on 9i or earlier, where optimizer parm changes are sometimes the only solution).
    Please note that Oracle11g has codified the well-known empirical approach to holistic tuning with the SPA (SQL Performance Analyzer), which allows you to find optimal settings for your init.ora parms by testing with a representative workload:
    http://www.dba-oracle.com/oracle11g/oracle_11g_sql_performance_advisor.htm
    Are the steps above sufficient for collecting system statistics on an OLTP only database? Yes, that should work.
    Remember, if you are on 10g or later, and you have the time to "optimize" your statistics, you can correct the one root cause of the sub-optimal plans, but some shops must also adjust their optimizer parameters. See my notes here:
    http://www.dba-oracle.com/t_dbms_stats_gather_system_stats.htm
    The dbms_stats.gather_system_stats procedure is very similar to my script for setting optimizer_index_cost_adj, where I compare the relative costs of sequential and scattered read times:
    select
    sum(a.time_waited_micro)/sum(a.total_waits)/1000000 c1,
    sum(b.time_waited_micro)/sum(b.total_waits)/1000000 c2,
    sum(a.total_waits) /
    sum(a.total_waits + b.total_waits)
    ) * 100 c3,
    sum(b.total_waits) /
    sum(a.total_waits + b.total_waits)
    ) * 100 c4,
    sum(b.time_waited_micro) /
    sum(b.total_waits)) /
    (sum(a.time_waited_micro)/sum(a.total_waits)
    ) * 100 c5
    from
    dba_hist_system_event a,
    dba_hist_system_event b
    where
    a.snap_id = b.snap_id
    and
    a.event_name = 'db file scattered read'
    and
    b.event_name = 'db file sequential read';
    Hope this helps. . . .
    Don Burleson
    Oracle Press author
    Author of “Oracle Tuning: The Definitive Reference”
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • How much OPTIMIZER_INDEX_CACHING and OPTIMIZER_INDEX_COST_ADJ should I set?

    Dear all:
    I use CBO and the default parameter of the "OPTIMIZER_INDEX_CACHING" is 0 and "OPTIMIZER_INDEX_COST_ADJ" is 100 these two parameters will impact of CBO. how much OPTIMIZER_INDEX_CACHING should I set?
    my environment is Oracle 9.2.0.8 (64bit)
    Regards
    Terry

    Terry Chen wrote:
    Dear Nicolas:
    Thank you for your quick reply, I have to say I have to modify the default setting of these parameters ,because we use EBS 11.5.9 and the database is more powerful then ever before and the SQL explain plan still show to do sorting with high cost.So I think I will refer to the articles of the provided and find the answers.
    Before you start playing around with these parameters, have you checked very carefully that you are conforming to the suggestions offered for all the parameters listed in the installation notes for EBS, and doing what you're supposed to do with system statistics ?
    Regards
    Jonathan Lewis

  • Pagination query help needed for large table - force a different index

    I'm using a slight modification of the pagination query from over at Ask Tom's: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]
    Mine looks like this when fetching the first 100 rows of all members with last name Smith, ordered by join date:
    SELECT members.*
    FROM members,
        SELECT RID, rownum rnum
        FROM
            SELECT rowid as RID
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
             and RID = members.rowidThe difference between this and the one at Ask Tom's is that my innermost query just returns the ROWID. Then in the outermost query we join the ROWIDs returned to the members table, after we have pruned the ROWIDs down to only the chunk of 100 we want. This makes it MUCH faster (verifiably) on our large tables, as it is able to use the index on the innermost query (well... read on).
    The problem I have is this:
    SELECT rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateThis will use the index for the predicate column (last_name) instead of the unique index I have defined for the joindate column (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can hint it using either of the following methods:
    SELECT /*+ index(members, joindate_idx) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    SELECT /*+ first_rows(100) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateEither way, it now uses the index of the ORDER BY column (joindate_idx), so now it is much faster as it does not have to do a sort (remember, VERY large table, millions of records). So that seems good. But now, on my outermost query, I join the rowid with the meaningful columns of data from the members table, as commented below:
    SELECT members.*      -- Select all data from members table
    FROM members,           -- members table added to FROM clause
        SELECT RID, rownum rnum
        FROM
            SELECT /*+ index(members, joindate_idx) */ rowid as RID   -- Hint is ignored now that I am joining in the outer query
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
            and RID = members.rowid           -- Merge the members table on the rowid we pulled from the inner queriesOnce I do this join, it goes back to using the predicate index (last_name) and has to perform the sort once it finds all matching values (which can be a lot in this table, there is high cardinality on some columns).
    So my question is, in the full query above, is there any way I can get it to use the ORDER BY column for indexing to prevent it from having to do a sort? The join is what causes it to revert back to using the predicate index, even with hints. Remove the join and just return the ROWIDs for those 100 records and it flies, even on 10 million records.
    It'd be great if there was some generic hint that could accomplish this, such that if we change the table/columns/indexes, we don't need to change the hint (the FIRST_ROWS hint is a good example of this, while the INDEX hint is the opposite), but any help would be appreciated. I can provide explain plans for any of the above if needed.
    Thanks!

    Lakmal Rajapakse wrote:
    OK here is an example to illustrate the advantage:
    SQL> set autot traceonly
    SQL> select * from (
    2  select a.*, rownum x  from
    3  (
    4  select a.* from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  )
    9  where x >= 1100
    10  /
    101 rows selected.
    Execution Plan
    Plan hash value: 3711662397
    | Id  | Operation                      | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  1 |  VIEW                          |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  2 |   COUNT STOPKEY                |            |       |       |            |          |
    |   3 |    VIEW                        |            |  1200 |   506K|   192   (0)| 00:00:03 |
    |   4 |     TABLE ACCESS BY INDEX ROWID| EVENTS     |   253M|    34G|   192   (0)| 00:00:03 |
    |   5 |      INDEX FULL SCAN           | EVEN_IDX02 |  1200 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("X">=1100)
    2 - filter(ROWNUM<=1200)
    Statistics
    0  recursive calls
    0  db block gets
    443  consistent gets
    0  physical reads
    0  redo size
    25203  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    SQL>
    SQL>
    SQL> select * from aoswf.events a, (
    2  select rid, rownum x  from
    3  (
    4  select rowid rid from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  ) b
    9  where x >= 1100
    10  and a.rowid = rid
    11  /
    101 rows selected.
    Execution Plan
    Plan hash value: 2308864810
    | Id  | Operation                   | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |   1 |  NESTED LOOPS               |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |*  2 |   VIEW                      |            |  1200 | 30000 |   260K  (1)| 00:52:06 |
    |*  3 |    COUNT STOPKEY            |            |       |       |            |          |
    |   4 |     VIEW                    |            |   253M|  2895M|   260K  (1)| 00:52:06 |
    |   5 |      INDEX FULL SCAN        | EVEN_IDX02 |   253M|  4826M|   260K  (1)| 00:52:06 |
    |   6 |   TABLE ACCESS BY USER ROWID| EVENTS     |     1 |   147 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("X">=1100)
    3 - filter(ROWNUM<=1200)
    Statistics
    8  recursive calls
    0  db block gets
    117  consistent gets
    0  physical reads
    0  redo size
    27539  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    Lakmal (and OP),
    Not sure what advantage you are trying to show here. But considering that we are talking about pagination query here and order of records is important, your 2 queries will not always generate output in same order. Here is the test case:
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.1
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter pga
    NAME                                 TYPE        VALUE
    pga_aggregate_target                 big integer 103M
    SQL> create table t nologging as select * from all_objects where 1 = 2 ;
    Table created.
    SQL> create index t_idx on t(last_ddl_time) nologging ;
    Index created.
    SQL> insert /*+ APPEND */ into t (owner, object_name, object_id, created, last_ddl_time) select owner, object_name, object_id, created, sysdate - dbms_random.value(1, 100) from all_objects order by dbms_random.random;
    40617 rows created.
    SQL> commit ;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(user, 'T', cascade=>true);
    PL/SQL procedure successfully completed.
    SQL> select object_id, object_name, created from t, (select rid, rownum rn from (select rowid rid from t order by created desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    CREATED
         47686 ALL$OLAP2_JOIN_KEY_COLUMN_USES 28-JUL-2009 08:08:39
         47672 ALL$OLAP2_CUBE_DIM_USES        28-JUL-2009 08:08:39
         47681 ALL$OLAP2_CUBE_MEASURE_MAPS    28-JUL-2009 08:08:39
         47682 ALL$OLAP2_FACT_LEVEL_USES      28-JUL-2009 08:08:39
         47685 ALL$OLAP2_AGGREGATION_USES     28-JUL-2009 08:08:39
         47692 ALL$OLAP2_CATALOGS             28-JUL-2009 08:08:39
         47665 ALL$OLAPMR_FACTTBLKEYMAPS      28-JUL-2009 08:08:39
         47688 ALL$OLAP2_DIM_LEVEL_ATTR_MAPS  28-JUL-2009 08:08:39
         47689 ALL$OLAP2_DIM_LEVELS_KEYMAPS   28-JUL-2009 08:08:39
         47669 ALL$OLAP9I2_HIER_DIMENSIONS    28-JUL-2009 08:08:39
         47666 ALL$OLAP9I1_HIER_DIMENSIONS    28-JUL-2009 08:08:39
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> set autotrace traceonly
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc
      2  ;
    11 rows selected.
    Execution Plan
    Plan hash value: 44968669
    | Id  | Operation                       | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |   1 |  SORT ORDER BY                  |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |*  2 |   HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  3 |    VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  4 |     COUNT STOPKEY               |       |       |       |            |          |
    |   5 |      VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   6 |       INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   7 |    TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("T".ROWID="T1"."RID")
       3 - filter("RN">=1190)
       4 - filter(ROWNUM<=1200)
    Statistics
              1  recursive calls
              0  db block gets
            348  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                    |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY          |      |       |       |            |          |
    |   3 |    VIEW                  |      | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|      | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL   | T    | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            343  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    11 rows selected.
    Execution Plan
    Plan hash value: 168880862
    | Id  | Operation                      | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  1 |  HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  2 |   VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  3 |    COUNT STOPKEY               |       |       |       |            |          |
    |   4 |     VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   5 |      INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   6 |   TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("T".ROWID="T1"."RID")
       2 - filter("RN">=1190)
       3 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            349  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 order by last_ddl_time desc ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation           | Name | Rows     | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY       |     |     |     |          |          |
    |   3 |    VIEW            |     | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|     | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL      | T     | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
         175  recursive calls
           0  db block gets
         388  consistent gets
           0  physical reads
           0  redo size
           1063  bytes sent via SQL*Net to client
         385  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           4  sorts (memory)
           0  sorts (disk)
          11  rows processed
    SQL> set autotrace off
    SQL> spool offAs you will see, the join query here has to have an ORDER BY clause at the end to ensure that records are correctly sorted. You can not rely on optimizer choosing NESTED LOOP join method and, as above example shows, when optimizer chooses HASH JOIN, oracle is free to return rows in no particular order.
    The query that does not involve join always returns rows in the desired order. Adding an ORDER BY does add a step in the plan for the query using join but does not affect the other query.

  • Query tuning help required:

    I have a query which is taking long time. Is there any way I can improve the query to shorten its time of execution.
    I have given below the details of it.
    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.25
    SQL> SELECT   pa.regn_no,
      2             (SELECT mst.status_desc
      3                FROM m_status mst
      4               WHERE mst.trans_id = 'PA01'
      5                 AND mst.status_code = pa.regn_status) AS regn_status,
      6             (SELECT pp.NAME
      7                FROM people_profile pp
      8               WHERE pp.pp_id = pa.ident_no) AS NAME, pa.ident_no,
      9             TO_CHAR (pa.approval_date, 'dd/mm/yyyy') AS approval_date,
    10             TO_CHAR (pa.de_reg_date, 'dd/mm/yyyy') AS de_regist_date,
    11             TO_CHAR (pa.cert_reg_exp_date, 'dd/mm/yyyy') AS cert_expiry_date,
    12             pa.gender, pa.fax_no,
    13             (SELECT nationality_desc
    14                FROM people_profile pp, m_nationality
    15               WHERE pp.pp_id = pa.ident_no
    16                 AND pp.nationality = nationality_code) AS nationality,
    17             (SELECT pp.email_add
    18                FROM people_profile pp
    19               WHERE pp.pp_id = pa.ident_no) AS email_add,
    20             (SELECT pp.mobile_no
    21                FROM people_profile pp
    22               WHERE pp.pp_id = pa.ident_no) AS mobile_no,
    23             TO_CHAR ((SELECT pp.birth_date
    24                      FROM people_profile pp
    25                     WHERE pp.pp_id = pa.ident_no),
    26                   'dd/mm/yyyy'
    27                  ) AS birth_date,
    28             REPLACE (sf_get_address_people (pa.ident_no, '2', 'C'),
    29                   '<br>',
    30                   CHR (10)
    31                  ) AS address,
    32             sf_get_pa_firm_info (pa.ident_no) AS firm_profile,
    33             sf_get_pa_firm_partner (pa.ident_no) AS firm_partner,
    34             sf_get_pa_pmp_code (pa.ident_no) AS pmp_code, ppv.pae_name,
    35             ppv.pmp_code AS pmp_code_1, ppv.cycle_no, ppv.seq_no,
    36             DECODE (ppv.visit_type,
    37                  'I', 'INITIAL',
    38                  'R', 'REVISIT',
    39                  ''
    40                 ) AS visit_type,
    41             TO_CHAR (ppv.initial_ltr_date, 'dd/mm/yyyy') AS initial_ltr_date,
    42             TO_CHAR (ppv.sec_ltr_date, 'dd/mm/yyyy') AS sec_ltr_date,
    43             TO_CHAR (ppv.review_from, 'dd/mm/yyyy') AS review_from,
    44             TO_CHAR (ppv.review_to, 'dd/mm/yyyy') AS review_to,
    45             TO_CHAR (ppv.finding_date, 'dd/mm/yyyy') AS finding_date,
    46             TO_CHAR (ppv.finding_due_date, 'dd/mm/yyyy') AS finding_due_date,
    47             TO_CHAR (ppv.finding_reply_date,
    48                   'dd/mm/yyyy'
    49                  ) AS finding_reply_date,
    50             ppv.pmsc,
    51             TO_CHAR (ppv.clarif_ltr_date, 'dd/mm/yyyy') AS clarif_ltr_date,
    52             ppv.paoc_date,
    53             TO_CHAR (ppv.final_paoc_date, 'dd/mm/yyyy') AS final_paoc_date,
    54             (SELECT result_desc
    55                FROM m_pmp_result ms
    56               WHERE result_id = ppv.pmp_status) AS pmp_status,
    57             TO_CHAR (ppv.suspension_end_date,
    58                   'dd/mm/yyyy'
    59                  ) AS suspension_end_date,
    60             TO_CHAR (ppv.final_ltr_date, 'dd/mm/yyyy') AS final_ltr_date,
    61             ppv.findings_summary,
    62             TO_CHAR (ppv.invoice_date, 'dd/mm/yyyy') AS invoice_date,
    63             ppv.amount_billed,
    64             TO_CHAR (ppv.payment_date, 'dd/mm/yyyy') AS payment_date,
    65             DECODE (ppv.pay_icpas,
    66                  'Y', 'YES',
    67                  'N', 'NO',
    68                  'V', 'NA',
    69                  ''
    70                 ) AS pay_icpas,
    71             ppv.updated_date, ppv.updated_by, ppv.remarks,
    72             DECODE ((SELECT ppr.review_status
    73                     FROM pa_pmp_reviews ppr
    74                    WHERE ppr.regn_no = ppv.regn_no
    75                      AND ppr.cycle_no = ppv.cycle_no),
    76                  'P', 'In Progress',
    77                  'C', 'Closed',
    78                  ''
    79                 ) AS review_status,
    80             pcl.complaint_no,
    81             DECODE (pcl.complaint_status,
    82                  'P', 'Pending',
    83                  'C', 'Closed',
    84                  ''
    85                 ) AS complaint_status,
    86             pcl.remarks AS remarks_1,
    87             DECODE (pcl.complaint_outcome,
    88                  'C', 'Cancelled',
    89                  'R', 'Restriction of Practice',
    90                  'P', 'Penalty (Fine) - Disciplinary',
    91                  'E', 'Censure - Disciplinary',
    92                  'S', 'Suspended - Disciplinary',
    93                  ''
    94                 ) AS complaint_outcome,
    95             TO_CHAR (pcl.complaint_date, 'dd/mm/yyyy') AS complaint_date,
    96             pcl.complainant_nric, pcl.complainant_name, pcl.complaint_details,
    97             TO_CHAR (pcl.effective_date, 'dd/mm/yyyy') AS effective_date,
    98             TO_CHAR (pcl.effective_date_to,
    99                   'dd/mm/yyyy') AS effective_date_to,
    100             sf_get_pa_exam_info (pa.regn_no, 'L') AS local_exam_detail,
    101             sf_get_pa_exam_info (pa.regn_no, 'F') AS foreign_exam_detail,
    102             sf_get_pa_exempt_info (pa.regn_no) AS exempt_detail
    103           FROM pa_profile pa, pa_pmp_visits ppv, pa_complaint pcl
    104          WHERE pa.regn_no = ppv.regn_no(+) AND pa.regn_no = pcl.regn_no(+)
    105       ORDER BY pa.regn_no DESC;
    1163 rows selected.
    Elapsed: 00:02:08.87
    Execution Plan
    Plan hash value: 2912197266
    | Id  | Operation                    | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                  |  1109 |   330K|    17  (12)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID | M_STATUS         |     1 |    23 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN           | PK_M_STATUS      |     1 |       |     1   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE   |     1 |    25 |     3   (0)| 00:00:01 |
    |*  4 |   INDEX UNIQUE SCAN          | SYS_C00103408    |     1 |       |     2   (0)| 00:00:01 |
    |   5 |  NESTED LOOPS                |                  |     1 |    26 |     4   (0)| 00:00:01 |
    |   6 |   TABLE ACCESS BY INDEX ROWID| PEOPLE_PROFILE   |     1 |    12 |     3   (0)| 00:00:01 |
    |*  7 |    INDEX UNIQUE SCAN         | SYS_C00103408    |     1 |       |     2   (0)| 00:00:01 |
    |*  8 |   INDEX RANGE SCAN           | PK_M_NATIONALITY |     1 |    14 |     1   (0)| 00:00:01 |
    |   9 |  TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE   |     1 |    20 |     3   (0)| 00:00:01 |
    |* 10 |   INDEX UNIQUE SCAN          | SYS_C00103408    |     1 |       |     2   (0)| 00:00:01 |
    |  11 |  TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE   |     1 |    11 |     3   (0)| 00:00:01 |
    |* 12 |   INDEX UNIQUE SCAN          | SYS_C00103408    |     1 |       |     2   (0)| 00:00:01 |
    |  13 |  TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE   |     1 |    10 |     3   (0)| 00:00:01 |
    |* 14 |   INDEX UNIQUE SCAN          | SYS_C00103408    |     1 |       |     2   (0)| 00:00:01 |
    |  15 |  TABLE ACCESS BY INDEX ROWID | M_PMP_RESULT     |     1 |    37 |     1   (0)| 00:00:01 |
    |* 16 |   INDEX UNIQUE SCAN          | XPK_M_PMP_RESULT |     1 |       |     0   (0)| 00:00:01 |
    |  17 |  TABLE ACCESS BY INDEX ROWID | PA_PMP_REVIEWS   |     1 |     8 |     1   (0)| 00:00:01 |
    |* 18 |   INDEX UNIQUE SCAN          | SYS_C00103321    |     1 |       |     0   (0)| 00:00:01 |
    |  19 |  SORT ORDER BY               |                  |  1109 |   330K|    17  (12)| 00:00:01 |
    |* 20 |   HASH JOIN RIGHT OUTER      |                  |  1109 |   330K|    16   (7)| 00:00:01 |
    |  21 |    TABLE ACCESS FULL         | PA_COMPLAINT     |   146 | 20294 |     3   (0)| 00:00:01 |
    |* 22 |    HASH JOIN RIGHT OUTER     |                  |  1109 |   179K|    13   (8)| 00:00:01 |
    |  23 |     TABLE ACCESS FULL        | PA_PMP_VISITS    |    90 | 11340 |     3   (0)| 00:00:01 |
    |  24 |     TABLE ACCESS FULL        | PA_PROFILE       |  1109 | 44360 |     9   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("MST"."TRANS_ID"='PA01' AND "MST"."STATUS_CODE"=:B1)
           filter("MST"."STATUS_CODE"=:B1)
       4 - access("PP"."PP_ID"=:B1)
       7 - access("PP"."PP_ID"=:B1)
       8 - access("PP"."NATIONALITY"="NATIONALITY_CODE")
      10 - access("PP"."PP_ID"=:B1)
      12 - access("PP"."PP_ID"=:B1)
      14 - access("PP"."PP_ID"=:B1)
      16 - access("RESULT_ID"=:B1)
      18 - access("PPR"."REGN_NO"=:B1 AND "PPR"."CYCLE_NO"=:B2)
      20 - access("PA"."REGN_NO"="PCL"."REGN_NO"(+))
      22 - access("PA"."REGN_NO"="PPV"."REGN_NO"(+))
    Statistics
          17577  recursive calls
              0  db block gets
        8703644  consistent gets
           6138  physical reads
              0  redo size
         424453  bytes sent via SQL*Net to client
           3641  bytes received via SQL*Net from client
             13  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
           1163  rows processed
    NAME                                 TYPE        VALUE
    user_dump_dest                       string      /opt/app/oracle/diag/rdbms/ebi
                                                     zfile/EBIZFILE/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.1
    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                          11-20-2009 09:46
    SYSSTATS_INFO        DSTOP                           11-20-2009 09:46
    SYSSTATS_INFO        FLAGS                         1
    SYSSTATS_MAIN        CPUSPEEDNW           1676.76768
    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

    Hi,
    obviously the problem you are having is described by the following lines of your execution plan
    SORT ORDER BY | | 1109 | 330K| 17 (12)| 00:00:01 |
    |* 20 | HASH JOIN RIGHT OUTER | | 1109 | 330K| 16 (7)| 00:00:01 |
    | 21 | TABLE ACCESS FULL | PA_COMPLAINT | 146 | 20294 | 3 (0)| 00:00:01 |
    |* 22 | HASH JOIN RIGHT OUTER | | 1109 | 179K| 13 (8)| 00:00:01 |
    | 23 | TABLE ACCESS FULL | PA_PMP_VISITS | 90 | 11340 | 3 (0)| 00:00:01 |
    | 24 | TABLE ACCESS FULL | PA_PROFILE | 1109 | 44360 | 9
    You don't have a "real" "WHERE" condition in the query that could lead the Oracle CBO to consider using an index.
    This leads to a full scan of PA_PMP_VISITS and PA_PROFILE and subsequently -in order to process the join condition between these two tables-
    to this "HASH JOIN RIGHT OUTER". You cannot avoid this, with the current WHERE condition ...
    Following thoughts :
    1) Try narrowing down your result set by specifying a "real" WHERE Condition on one of the two tables, specifying an indexed column
    2) If this cannot be done, try using query parallelism (parallel hint). This will give you acceptable SQL-execution times.
    3) If this is not possible, there would be a third approach : You could consider the definition of an index on "pa.regn" and use a hint on your query in order to use it. Due to your order condition there is a possibility that CBO is going to use it, especially if you specify WHERE ROWNUM < ...
    Regards,
    Michalis

  • Help needed for hash_area_size setting for Datawarehouse environment

    We have an Oracle 10g Datawarehousing environment , running on 3 - node RAC
    with 16 GB RAM & 4 CPUs each and roughly we have 200 users and night jobs running on this D/W .
    We find that query performance of all ETL Processes & joins are quite slow .
    How much should we increase the value of hash_area_size parameter for this Datawarehouse environment ? This is a Production database, with Oracle Database 10g Enterprise Edition Release 10.1.0.5.0.
    We use OWB 10g Tool for this D/W and we need to change the hash_area_size to increase the performance of the ETL Processes.
    This is the Oracle init parameter settings used, as shown below : -
    Kindly suggest ,
    Thanks & best regards ,
    ===========================================================
         ORBIT
    __db_cache_size     1073741824
    __java_pool_size     67108864
    __large_pool_size     318767104
    __shared_pool_size     1744830464
    optimizercost_based_transformation     OFF
    active_instance_count     
    aq_tm_processes     1
    archive_lag_target     0
    asm_diskgroups     
    asm_diskstring     
    asm_power_limit     1
    audit_file_dest     /dboracle/orabase/product/10.1.0/rdbms/audit
    audit_sys_operations     FALSE
    audit_trail     NONE
    background_core_dump     partial
    background_dump_dest     /dborafiles/orbit/ORBIT01/admin/bdump
    backup_tape_io_slaves     TRUE
    bitmap_merge_area_size     1048576
    blank_trimming     FALSE
    buffer_pool_keep     
    buffer_pool_recycle     
    circuits     
    cluster_database     TRUE
    cluster_database_instances     3
    cluster_interconnects     
    commit_point_strength     1
    compatible     10.1.0
    control_file_record_keep_time     90
    control_files     #NAME?
    core_dump_dest     /dborafiles/orbit/ORBIT01/admin/cdump
    cpu_count     4
    create_bitmap_area_size     8388608
    create_stored_outlines     
    cursor_sharing     EXACT
    cursor_space_for_time     FALSE
    db_16k_cache_size     0
    db_2k_cache_size     0
    db_32k_cache_size     0
    db_4k_cache_size     0
    db_8k_cache_size     0
    db_block_buffers     0
    db_block_checking     FALSE
    db_block_checksum     TRUE
    db_block_size     8192
    db_cache_advice     ON
    db_cache_size     1073741824
    db_create_file_dest     #NAME?
    db_create_online_log_dest_1     #NAME?
    db_create_online_log_dest_2     #NAME?
    db_create_online_log_dest_3     
    db_create_online_log_dest_4     
    db_create_online_log_dest_5     
    db_domain     
    db_file_multiblock_read_count     64
    db_file_name_convert     
    db_files     999
    db_flashback_retention_target     1440
    db_keep_cache_size     0
    db_name     ORBIT
    db_recovery_file_dest     #NAME?
    db_recovery_file_dest_size     2.62144E+11
    db_recycle_cache_size     0
    db_unique_name     ORBIT
    db_writer_processes     1
    dbwr_io_slaves     0
    ddl_wait_for_locks     FALSE
    dg_broker_config_file1     /dboracle/orabase/product/10.1.0/dbs/dr1ORBIT.dat
    dg_broker_config_file2     /dboracle/orabase/product/10.1.0/dbs/dr2ORBIT.dat
    dg_broker_start     FALSE
    disk_asynch_io     TRUE
    dispatchers     
    distributed_lock_timeout     60
    dml_locks     9700
    drs_start     FALSE
    enqueue_resources     10719
    event     
    fal_client     
    fal_server     
    fast_start_io_target     0
    fast_start_mttr_target     0
    fast_start_parallel_rollback     LOW
    file_mapping     FALSE
    fileio_network_adapters     
    filesystemio_options     asynch
    fixed_date     
    gc_files_to_locks     
    gcs_server_processes     2
    global_context_pool_size     
    global_names     FALSE
    hash_area_size     131072
    hi_shared_memory_address     0
    hpux_sched_noage     0
    hs_autoregister     TRUE
    ifile     
    instance_groups     
    instance_name     ORBIT01
    instance_number     1
    instance_type     RDBMS
    java_max_sessionspace_size     0
    java_pool_size     67108864
    java_soft_sessionspace_limit     0
    job_queue_processes     10
    large_pool_size     318767104
    ldap_directory_access     NONE
    license_max_sessions     0
    license_max_users     0
    license_sessions_warning     0
    local_listener     
    lock_name_space     
    lock_sga     FALSE
    log_archive_config     
    log_archive_dest     
    log_archive_dest_1     LOCATION=+ORBT_A06635_DATA1_ASM/ORBIT/ARCHIVELOG/
    log_archive_dest_10     
    log_archive_dest_2     
    log_archive_dest_3     
    log_archive_dest_4     
    log_archive_dest_5     
    log_archive_dest_6     
    log_archive_dest_7     
    log_archive_dest_8     
    log_archive_dest_9     
    log_archive_dest_state_1     enable
    log_archive_dest_state_10     enable
    log_archive_dest_state_2     enable
    log_archive_dest_state_3     enable
    log_archive_dest_state_4     enable
    log_archive_dest_state_5     enable
    log_archive_dest_state_6     enable
    log_archive_dest_state_7     enable
    log_archive_dest_state_8     enable
    log_archive_dest_state_9     enable
    log_archive_duplex_dest     
    log_archive_format     %t_%s_%r.arc
    log_archive_local_first     TRUE
    log_archive_max_processes     2
    log_archive_min_succeed_dest     1
    log_archive_start     FALSE
    log_archive_trace     0
    log_buffer     1167360
    log_checkpoint_interval     0
    log_checkpoint_timeout     1800
    log_checkpoints_to_alert     FALSE
    log_file_name_convert     
    logmnr_max_persistent_sessions     1
    max_commit_propagation_delay     700
    max_dispatchers     
    max_dump_file_size     UNLIMITED
    max_enabled_roles     150
    max_shared_servers     
    nls_calendar     
    nls_comp     
    nls_currency     #
    nls_date_format     DD-MON-RRRR
    nls_date_language     ENGLISH
    nls_dual_currency     ?
    nls_iso_currency     UNITED KINGDOM
    nls_language     ENGLISH
    nls_length_semantics     BYTE
    nls_nchar_conv_excp     FALSE
    nls_numeric_characters     
    nls_sort     
    nls_territory     UNITED KINGDOM
    nls_time_format     HH24.MI.SSXFF
    nls_time_tz_format     HH24.MI.SSXFF TZR
    nls_timestamp_format     DD-MON-RR HH24.MI.SSXFF
    nls_timestamp_tz_format     DD-MON-RR HH24.MI.SSXFF TZR
    O7_DICTIONARY_ACCESSIBILITY     FALSE
    object_cache_max_size_percent     10
    object_cache_optimal_size     102400
    olap_page_pool_size     0
    open_cursors     1024
    open_links     4
    open_links_per_instance     4
    optimizer_dynamic_sampling     2
    optimizer_features_enable     10.1.0.5
    optimizer_index_caching     0
    optimizer_index_cost_adj     100
    optimizer_mode     ALL_ROWS
    os_authent_prefix     ops$
    os_roles     FALSE
    parallel_adaptive_multi_user     TRUE
    parallel_automatic_tuning     TRUE
    parallel_execution_message_size     4096
    parallel_instance_group     
    parallel_max_servers     80
    parallel_min_percent     0
    parallel_min_servers     0
    parallel_server     TRUE
    parallel_server_instances     3
    parallel_threads_per_cpu     2
    pga_aggregate_target     8589934592
    plsql_code_type     INTERPRETED
    plsql_compiler_flags     INTERPRETED
    plsql_debug     FALSE
    plsql_native_library_dir     
    plsql_native_library_subdir_count     0
    plsql_optimize_level     2
    plsql_v2_compatibility     FALSE
    plsql_warnings     DISABLE:ALL
    pre_page_sga     FALSE
    processes     600
    query_rewrite_enabled     TRUE
    query_rewrite_integrity     enforced
    rdbms_server_dn     
    read_only_open_delayed     FALSE
    recovery_parallelism     0
    remote_archive_enable     TRUE
    remote_dependencies_mode     TIMESTAMP
    remote_listener     
    remote_login_passwordfile     EXCLUSIVE
    remote_os_authent     FALSE
    remote_os_roles     FALSE
    replication_dependency_tracking     TRUE
    resource_limit     FALSE
    resource_manager_plan     
    resumable_timeout     0
    rollback_segments     
    serial_reuse     disable
    service_names     ORBIT
    session_cached_cursors     0
    session_max_open_files     10
    sessions     2205
    sga_max_size     3221225472
    sga_target     3221225472
    shadow_core_dump     partial
    shared_memory_address     0
    shared_pool_reserved_size     102760448
    shared_pool_size     318767104
    shared_server_sessions     
    shared_servers     0
    skip_unusable_indexes     TRUE
    smtp_out_server     
    sort_area_retained_size     0
    sort_area_size     65536
    sp_name     ORBIT
    spfile     #NAME?
    sql_trace     FALSE
    sql_version     NATIVE
    sql92_security     FALSE
    sqltune_category     DEFAULT
    standby_archive_dest     ?/dbs/arch
    standby_file_management     MANUAL
    star_transformation_enabled     TRUE
    statistics_level     TYPICAL
    streams_pool_size     0
    tape_asynch_io     TRUE
    thread     1
    timed_os_statistics     0
    timed_statistics     TRUE
    trace_enabled     TRUE
    tracefile_identifier     
    transactions     2425
    transactions_per_rollback_segment     5
    undo_management     AUTO
    undo_retention     7200
    undo_tablespace     UNDOTBS1
    use_indirect_data_buffers     FALSE
    user_dump_dest     /dborafiles/orbit/ORBIT01/admin/udump
    utl_file_dir     /orbit_serial/oracle/utl_out
    workarea_size_policy     AUTO

    The parameters are already unset in the environment, but do show up in v$parameter, much like shared_pool_size is visible in v$parameter despite only sga_target being set.
    SQL> show parameter sort
    NAME TYPE VALUE
    sortelimination_cost_ratio integer 5
    nls_sort string binary
    sort_area_retained_size integer 0
    sort_area_size integer 65536
    SQL> show parameter hash
    NAME TYPE VALUE
    hash_area_size integer 131072
    SQL> exit
    Only set hash_area_size and sort_area_size should only be set when not using automatic undo, which is not supported in EBS databases.
    Database Initialization Parameters for Oracle Applications 11i
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=216205.1

  • CBO generating different plans for the same data in similar Environments

    Hi All
    I have been trying to compare an SQL from 2 different but similar environments build of the same hardware specs .The issue I am facing is environment A, the query executes in less than 2 minutes with plan mostly showing full table scans and hash join whereas in environment B(problematic), it times out after 2 hours with an error of unable to extend table space . The statistics are up to date in both environments for both tables and indexes . System parameters are exactly similar(default oracle for except for multiblock_read_count ).
    Both Environment have same db parameter for db_file_multiblock_read_count(16), optimizer(refer below),hash_area_size (131072),pga_aggregate_target(1G),db_block_size(8192) etc . SREADTIM, MREADTIM, CPUSPEED, MBRC are all null in aux_stats in both environment because workload was never collected i believe.
    Attached is details about the SQL with table stats, SQL and index stats my main concern is CBO generating different plans for the similar data and statistics and same hardware and software specs. Is there any thing else I should consider .I generally see environment B being very slow and always plans tend to nested loops and index scan whereas what we really need is a sensible FTS in many cases. One of the very surprising thing is METER_CONFIG_HEADER below which has just 80 blocks of data is being asked for index scan.
    show parameter optimizer
    optimizer_dynamic_sampling integer 2
    optimizer_features_enable string 10.2.0.4
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    **Environment**
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Note: : There are slight difference in the no of records in the attached sheet.However, I wanted to tell that i have tested with exact same data and was getting similar results but I couldn't retain the data untill collecting the details in the attachment
    TEST1     COMPARE TABLE LEVE STATS  used by CBO          
    ENVIRONMENT A
    TABLE_NAME     NUM_ROWS     BLOCKS     LAST_ANALYZED
    ASSET     3607425     167760     5/02/2013 22:11
    METER_CONFIG_HEADER     3658     80     5/01/2013 0:07
    METER_CONFIG_ITEM     32310     496     5/01/2013 0:07
    NMI     1899024     33557     18/02/2013 10:55
    REGISTER     4830153     101504     18/02/2013 9:57
    SDP_LOGICAL_ASSET     1607456     19137     18/02/2013 15:48
    SDP_LOGICAL_REGISTER     5110781     78691     18/02/2013 9:56
    SERVICE_DELIVERY_POINT     1425890     42468     18/02/2013 13:54
    ENVIRONMENT B
    TABLE_NAME     NUM_ROWS     BLOCKS     LAST_ANALYZED
    ASSET     4133939     198570     16/02/2013 10:02
    METER_CONFIG_HEADER     3779     80     16/02/2013 10:55
    METER_CONFIG_ITEM     33720     510     16/02/2013 10:55
    NMI     1969000     33113     16/02/2013 10:58
    REGISTER     5837874     120104     16/02/2013 11:05
    SDP_LOGICAL_ASSET     1788152     22325     16/02/2013 11:06
    SDP_LOGICAL_REGISTER     6101934     91088     16/02/2013 11:07
    SERVICE_DELIVERY_POINT     1447589     43804     16/02/2013 11:11
    TEST ITEM 2     COMPARE INDEX STATS  used by CBO          
    ENVIRONMENT A
    TABLE_NAME     INDEX_NAME     UNIQUENESS     BLEVEL     LEAF_BLOCKS     DISTINCT_KEYS     AVG_LEAF_BLOCKS_PER_KEY     AVG_DATA_BLOCKS_PER_KEY     CLUSTERING_FACTOR     NUM_ROWS
    ASSET     IDX_AST_DEVICE_CATEGORY_SK     NONUNIQUE     2     9878     67     147     12982     869801     3553095
    ASSET     IDX_A_SAPINTLOGDEV_SK     NONUNIQUE     2     7291     2747     2     639     1755977     3597916
    ASSET     SYS_C00102592     UNIQUE     2     12488     3733831     1     1     3726639     3733831
    METER_CONFIG_HEADER     SYS_C0092052     UNIQUE     1     12     3670     1     1     3590     3670
    METER_CONFIG_ITEM     SYS_C0092074     UNIQUE     1     104     32310     1     1     32132     32310
    NMI     IDX_NMI_ID     NONUNIQUE     2     6298     844853     1     2     1964769     1965029
    NMI     IDX_NMI_ID_NK     NONUNIQUE     2     6701     1923072     1     1     1922831     1923084
    NMI     IDX_NMI_STATS     NONUNIQUE     1     106     4     26     52     211     211
    REGISTER     REG_EFFECTIVE_DTM     NONUNIQUE     2     12498     795     15     2899     2304831     4711808
    REGISTER     SYS_C00102653     UNIQUE     2     16942     5065660     1     1     5056855     5065660
    SDP_LOGICAL_ASSET     IDX_SLA_SAPINTLOGDEV_SK     NONUNIQUE     2     3667     1607968     1     1     1607689     1607982
    SDP_LOGICAL_ASSET     IDX_SLA_SDP_SK     NONUNIQUE     2     3811     668727     1     2     1606204     1607982
    SDP_LOGICAL_ASSET     SYS_C00102665     UNIQUE     2     5116     1529606     1     1     1528136     1529606
    SDP_LOGICAL_REGISTER     SYS_C00102677     UNIQUE     2     17370     5193638     1     1     5193623     5193638
    SERVICE_DELIVERY_POINT     IDX_SDP_NMI_SK     NONUNIQUE     2     4406     676523     1     2     1423247     1425890
    SERVICE_DELIVERY_POINT     IDX_SDP_SAP_INT_NMI_SK     NONUNIQUE     2     7374     676523     1     2     1458238     1461108
    SERVICE_DELIVERY_POINT     SYS_C00102687     UNIQUE     2     4737     1416207     1     1     1415022     1416207
    ENVIRONMENT B
    TABLE_NAME     INDEX_NAME     UNIQUENESS     BLEVEL     LEAF_BLOCKS     DISTINCT_KEYS     AVG_LEAF_BLOCKS_PER_KEY     AVG_DATA_BLOCKS_PER_KEY     CLUSTERING_FACTOR     NUM_ROWS
    ASSET     IDX_AST_DEVICE_CATEGORY_SK     NONUNIQUE     2     8606     121     71     16428     1987833     4162257
    ASSET     IDX_A_SAPINTLOGDEV_SK     NONUNIQUE     2     8432     1780146     1     1     2048170     4162257
    ASSET     SYS_C00116157     UNIQUE     2     13597     4162263     1     1     4158759     4162263
    METER_CONFIG_HEADER     SYS_C00116570     UNIQUE     1     12     3779     1     1     3734     3779
    METER_CONFIG_ITEM     SYS_C00116592     UNIQUE     1     107     33720     1     1     33459     33720
    NMI     IDX_NMI_ID     NONUNIQUE     2     6319     683370     1     2     1970460     1971313
    NMI     IDX_NMI_ID_NK     NONUNIQUE     2     6597     1971293     1     1     1970771     1971313
    NMI     IDX_NMI_STATS     NONUNIQUE     1     98     48     2     4     196     196
    REGISTER     REG_EFFECTIVE_DTM     NONUNIQUE     2     15615     1273     12     2109     2685924     5886582
    REGISTER     SYS_C00116748     UNIQUE     2     19533     5886582     1     1     5845565     5886582
    SDP_LOGICAL_ASSET     IDX_SLA_SAPINTLOGDEV_SK     NONUNIQUE     2     4111     1795084     1     1     1758441     1795130
    SDP_LOGICAL_ASSET     IDX_SLA_SDP_SK     NONUNIQUE     2     4003     674249     1     2     1787987     1795130
    SDP_LOGICAL_ASSET     SYS_C004520     UNIQUE     2     5864     1795130     1     1     1782147     1795130
    SDP_LOGICAL_REGISTER     SYS_C004539     UNIQUE     2     20413     6152850     1     1     6073059     6152850
    SERVICE_DELIVERY_POINT     IDX_SDP_NMI_SK     NONUNIQUE     2     3227     660649     1     2     1422572     1447803
    SERVICE_DELIVERY_POINT     IDX_SDP_SAP_INT_NMI_SK     NONUNIQUE     2     6399     646257     1     2     1346948     1349993
    SERVICE_DELIVERY_POINT     SYS_C00128706     UNIQUE     2     4643     1447946     1     1     1442796     1447946
    TEST ITEM 3     COMPARE PLANS     
    ENVIRONMENT A
    Plan hash value: 4109575732                                             
    | Id  | Operation                       | Name                   | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                                             
    |   0 | SELECT STATEMENT                |                        |    13 |  2067 |       |   135K  (2)| 00:27:05 |                                             
    |   1 |  HASH UNIQUE                    |                        |    13 |  2067 |       |   135K  (2)| 00:27:05 |                                             
    |*  2 |   HASH JOIN                     |                        |    13 |  2067 |       |   135K  (2)| 00:27:05 |                                             
    |*  3 |    HASH JOIN                    |                        |     6 |   900 |       |   135K  (2)| 00:27:04 |                                             
    |*  4 |     HASH JOIN ANTI              |                        |     1 |   137 |       |   135K  (2)| 00:27:03 |                                             
    |*  5 |      TABLE ACCESS BY INDEX ROWID| NMI                    |     1 |    22 |       |     5   (0)| 00:00:01 |                                             
    |   6 |       NESTED LOOPS              |                        |     1 |   131 |       | 95137   (2)| 00:19:02 |                                             
    |*  7 |        HASH JOIN                |                        |     1 |   109 |       | 95132   (2)| 00:19:02 |                                             
    |*  8 |         TABLE ACCESS FULL       | ASSET                  | 36074 |  1021K|       | 38553   (2)| 00:07:43 |                                             
    |*  9 |         HASH JOIN               |                        | 90361 |  7059K|  4040K| 56578   (2)| 00:11:19 |                                             
    |* 10 |          HASH JOIN              |                        | 52977 |  3414K|  2248K| 50654   (2)| 00:10:08 |                                             
    |* 11 |           HASH JOIN             |                        | 39674 |  1782K|       | 40101   (2)| 00:08:02 |                                             
    |* 12 |            TABLE ACCESS FULL    | REGISTER               | 39439 |  1232K|       | 22584   (2)| 00:04:32 |                                             
    |* 13 |            TABLE ACCESS FULL    | SDP_LOGICAL_REGISTER   |  4206K|    56M|       | 17490   (2)| 00:03:30 |                                             
    |* 14 |           TABLE ACCESS FULL     | SERVICE_DELIVERY_POINT |   675K|    12M|       |  9412   (2)| 00:01:53 |                                             
    |* 15 |          TABLE ACCESS FULL      | SDP_LOGICAL_ASSET      |  1178K|    15M|       |  4262   (2)| 00:00:52 |                                             
    |* 16 |        INDEX RANGE SCAN         | IDX_NMI_ID_NK          |     2 |       |       |     2   (0)| 00:00:01 |                                             
    |  17 |      VIEW                       |                        | 39674 |   232K|       | 40101   (2)| 00:08:02 |                                             
    |* 18 |       HASH JOIN                 |                        | 39674 |  1046K|       | 40101   (2)| 00:08:02 |                                             
    |* 19 |        TABLE ACCESS FULL        | REGISTER               | 39439 |   500K|       | 22584   (2)| 00:04:32 |                                             
    |* 20 |        TABLE ACCESS FULL        | SDP_LOGICAL_REGISTER   |  4206K|    56M|       | 17490   (2)| 00:03:30 |                                             
    |* 21 |     TABLE ACCESS FULL           | METER_CONFIG_HEADER    |  3658 | 47554 |       |    19   (0)| 00:00:01 |                                             
    |* 22 |    TABLE ACCESS FULL            | METER_CONFIG_ITEM      |  7590 | 68310 |       |   112   (2)| 00:00:02 |                                             
    Predicate Information (identified by operation id):                                             
       2 - access("METER_CONFIG_HEADER_SK"="METER_CONFIG_HEADER_SK")                                             
       3 - access("NETWORK_TARIFF_CD"="NETWORK_TARIFF_CD")                                             
       4 - access("SERVICE_DELIVERY_POINT_SK"="TMP"."SERVICE_DELIVERY_POINT_SK")                                             
       5 - filter("ROW_CURRENT_IND"='Y' AND ("NMI_STATUS_CD"='A' OR "NMI_STATUS_CD"='D'))                                             
       7 - access("ASSET_CD"="EQUIP_CD" AND "SAP_INT_LOG_DEVICE_SK"="SAP_INT_LOG_DEVICE_SK")                                             
       8 - filter("ROW_CURRENT_IND"='Y')                                             
       9 - access("SERVICE_DELIVERY_POINT_SK"="SERVICE_DELIVERY_POINT_SK")                                             
      10 - access("SERVICE_DELIVERY_POINT_SK"="SERVICE_DELIVERY_POINT_SK")                                             
      11 - access("SAP_INT_LOGICAL_REGISTER_SK"="SAP_INT_LOGICAL_REGISTER_SK")                                             
      12 - filter("REGISTER_TYPE_CD"='C' AND (SUBSTR("REGISTER_ID_CD",1,1)='4' OR                                              
                  SUBSTR("REGISTER_ID_CD",1,1)='5' OR SUBSTR("REGISTER_ID_CD",1,1)='6') AND "ROW_CURRENT_IND"='Y')                                             
      13 - filter("ROW_CURRENT_IND"='Y')                                             
      14 - filter("ROW_CURRENT_IND"='Y')                                             
      15 - filter("ROW_CURRENT_IND"='Y')                                             
      16 - access("NMI_SK"="NMI_SK")                                             
      18 - access("SAP_INT_LOGICAL_REGISTER_SK"="SAP_INT_LOGICAL_REGISTER_SK")                                             
      19 - filter("REGISTER_TYPE_CD"='C' AND (SUBSTR("REGISTER_ID_CD",1,1)='1' OR                                              
                  SUBSTR("REGISTER_ID_CD",1,1)='2' OR SUBSTR("REGISTER_ID_CD",1,1)='3') AND "ROW_CURRENT_IND"='Y')                                             
      20 - filter("ROW_CURRENT_IND"='Y')                                             
      21 - filter("ROW_CURRENT_IND"='Y')                                             
      22 - filter("ROW_CURRENT_IND"='Y' AND "CONROL_REGISTER"='X')                                             
    ENVIRONMENT B
    Plan hash value: 2826260434                                   
    | Id  | Operation                            | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |                                   
    |   0 | SELECT STATEMENT                     |                        |     1 |   181 |   103K  (2)| 00:20:47 |                                   
    |   1 |  HASH UNIQUE                         |                        |     1 |   181 |   103K  (2)| 00:20:47 |                                   
    |*  2 |   HASH JOIN ANTI                     |                        |     1 |   181 |   103K  (2)| 00:20:47 |                                   
    |*  3 |    HASH JOIN                         |                        |     1 |   176 | 56855   (2)| 00:11:23 |                                   
    |*  4 |     HASH JOIN                        |                        |     1 |   163 | 36577   (2)| 00:07:19 |                                   
    |*  5 |      TABLE ACCESS BY INDEX ROWID     | ASSET                  |     1 |    44 |     4   (0)| 00:00:01 |                                   
    |   6 |       NESTED LOOPS                   |                        |     1 |   131 |  9834   (2)| 00:01:59 |                                   
    |   7 |        NESTED LOOPS                  |                        |     1 |    87 |  9830   (2)| 00:01:58 |                                   
    |   8 |         NESTED LOOPS                 |                        |     1 |    74 |  9825   (2)| 00:01:58 |                                   
    |*  9 |          HASH JOIN                   |                        |     1 |    52 |  9820   (2)| 00:01:58 |                                   
    |* 10 |           TABLE ACCESS BY INDEX ROWID| METER_CONFIG_HEADER    |     1 |    14 |     1   (0)| 00:00:01 |                                   
    |  11 |            NESTED LOOPS              |                        |     1 |    33 |   116   (2)| 00:00:02 |                                   
    |* 12 |             TABLE ACCESS FULL        | METER_CONFIG_ITEM      |     1 |    19 |   115   (2)| 00:00:02 |                                   
    |* 13 |             INDEX RANGE SCAN         | SYS_C00116570          |     1 |       |     1   (0)| 00:00:01 |                                   
    |* 14 |           TABLE ACCESS FULL          | SERVICE_DELIVERY_POINT |   723K|    13M|  9699   (2)| 00:01:57 |                                   
    |* 15 |          TABLE ACCESS BY INDEX ROWID | NMI                    |     1 |    22 |     5   (0)| 00:00:01 |                                   
    |* 16 |           INDEX RANGE SCAN           | IDX_NMI_ID_NK          |     2 |       |     2   (0)| 00:00:01 |                                   
    |* 17 |         TABLE ACCESS BY INDEX ROWID  | SDP_LOGICAL_ASSET      |     1 |    13 |     5   (0)| 00:00:01 |                                   
    |* 18 |          INDEX RANGE SCAN            | IDX_SLA_SDP_SK         |     2 |       |     2   (0)| 00:00:01 |                                   
    |* 19 |        INDEX RANGE SCAN              | IDX_A_SAPINTLOGDEV_SK  |     2 |       |     2   (0)| 00:00:01 |                                   
    |* 20 |      TABLE ACCESS FULL               | REGISTER               | 76113 |  2378K| 26743   (2)| 00:05:21 |                                   
    |* 21 |     TABLE ACCESS FULL                | SDP_LOGICAL_REGISTER   |  5095K|    63M| 20245   (2)| 00:04:03 |                                   
    |  22 |    VIEW                              |                        | 90889 |   443K| 47021   (2)| 00:09:25 |                                   
    |* 23 |     HASH JOIN                        |                        | 90889 |  2307K| 47021   (2)| 00:09:25 |                                   
    |* 24 |      TABLE ACCESS FULL               | REGISTER               | 76113 |   966K| 26743   (2)| 00:05:21 |                                   
    |* 25 |      TABLE ACCESS FULL               | SDP_LOGICAL_REGISTER   |  5095K|    63M| 20245   (2)| 00:04:03 |                                   
    Predicate Information (identified by operation id):                                   
       2 - access("SERVICE_DELIVERY_POINT_SK"="TMP"."SERVICE_DELIVERY_POINT_SK")                                   
       3 - access("SERVICE_DELIVERY_POINT_SK"="SERVICE_DELIVERY_POINT_SK" AND                                    
                  "SAP_INT_LOGICAL_REGISTER_SK"="SAP_INT_LOGICAL_REGISTER_SK")                                   
       4 - access("ASSET_CD"="EQUIP_CD")                                   
       5 - filter("ROW_CURRENT_IND"='Y')                                   
       9 - access("NETWORK_TARIFF_CD"="NETWORK_TARIFF_CD")                                   
      10 - filter("ROW_CURRENT_IND"='Y')                                   
      12 - filter("ROW_CURRENT_IND"='Y' AND "CONROL_REGISTER"='X')                                   
      13 - access("METER_CONFIG_HEADER_SK"="METER_CONFIG_HEADER_SK")                                   
      14 - filter("ROW_CURRENT_IND"='Y')                                   
      15 - filter("ROW_CURRENT_IND"='Y' AND ("NMI_STATUS_CD"='A' OR "NMI_STATUS_CD"='D'))                                   
      16 - access("NMI_SK"="NMI_SK")                                   
      17 - filter("ROW_CURRENT_IND"='Y')                                   
      18 - access("SERVICE_DELIVERY_POINT_SK"="SERVICE_DELIVERY_POINT_SK")                                   
      19 - access("SAP_INT_LOG_DEVICE_SK"="SAP_INT_LOG_DEVICE_SK")                                   
      20 - filter((SUBSTR("REGISTER_ID_CD",1,1)='4' OR SUBSTR("REGISTER_ID_CD",1,1)='5' OR                                    
                  SUBSTR("REGISTER_ID_CD",1,1)='6') AND "REGISTER_TYPE_CD"='C' AND "ROW_CURRENT_IND"='Y')                                   
      21 - filter("ROW_CURRENT_IND"='Y')                                   
      23 - access("SAP_INT_LOGICAL_REGISTER_SK"="SAP_INT_LOGICAL_REGISTER_SK")                                   
      24 - filter((SUBSTR("REGISTER_ID_CD",1,1)='1' OR SUBSTR("REGISTER_ID_CD",1,1)='2' OR                                    
                  SUBSTR("REGISTER_ID_CD",1,1)='3') AND "REGISTER_TYPE_CD"='C' AND "ROW_CURRENT_IND"='Y')                                   
      25 - filter("ROW_CURRENT_IND"='Y')Edited by: abhilash173 on Feb 24, 2013 9:16 PM
    Edited by: abhilash173 on Feb 24, 2013 9:18 PM

    Hi Paul,
    I misread your question initially .The system stats are outdated in both ( same result as seen from aux_stats) .I am not a DBA and do not have access to gather system stats fresh.
    select * from sys.aux_stats$
    SNAME     PNAME     PVAL1     PVAL2
    SYSSTATS_INFO     STATUS     NULL     COMPLETED
    SYSSTATS_INFO     DSTART     NULL     02-16-2011 15:24
    SYSSTATS_INFO     DSTOP     NULL     02-16-2011 15:24
    SYSSTATS_INFO     FLAGS     1     NULL
    SYSSTATS_MAIN     CPUSPEEDNW     1321.20523     NULL
    SYSSTATS_MAIN     IOSEEKTIM     10     NULL
    SYSSTATS_MAIN     IOTFRSPEED     4096     NULL
    SYSSTATS_MAIN     SREADTIM     NULL     NULL
    SYSSTATS_MAIN     MREADTIM     NULL     NULL
    SYSSTATS_MAIN     CPUSPEED     NULL     NULL
    SYSSTATS_MAIN     MBRC     NULL     NULL
    SYSSTATS_MAIN     MAXTHR     NULL     NULL
    SYSSTATS_MAIN     SLAVETHR     NULL     NULL

  • 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.

  • HOW TO: Post a SQL statement tuning request - template posting

    This post is not a question, but similar to Rob van Wijk's "When your query takes too long ..." post should help to improve the quality of the requests for SQL statement tuning here on OTN.
    On the OTN forum very often tuning requests about single SQL statements are posted, but the information provided is rather limited, and therefore it's not that simple to provide a meaningful advice. Instead of writing the same requests for additional information over and over again I thought I put together a post that describes how a "useful" post for such a request should look like and what information it should cover.
    I've also prepared very detailed step-by-step instructions how to obtain that information on my blog, which can be used to easily gather the required information. It also covers again the details how to post the information properly here, in particular how to use the \ tag to preserve formatting and get a fixed font output:
    http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
    So again: This post here describes how a "useful" post should look like and what information it ideally covers. The blog post explains in detail how to obtain that information.
    In the future, rather than requesting the same additional information and explaining how to obtain it, I'll simply refer to this HOW TO post and the corresponding blog post which describes in detail how to get that information.
    *Very important:*
    Use the \ tag to enclose any output that should have its formatting preserved as shown below.
    So if you want to use fixed font formatting that preserves the spaces etc., do the following:
    \   This preserves formatting
    \And it will look like this:
       This preserves formatting
       . . .Your post should cover the following information:
    1. The SQL and a short description of its purpose
    2. The version of your database with 4-digits (e.g. 10.2.0.4)
    3. Optimizer related parameters
    4. The TIMING and AUTOTRACE output
    5. The EXPLAIN PLAN output
    6. The TKPROF output snippet that corresponds to your statement
    7. If you're on 10g or later, the DBMS_XPLAN.DISPLAY_CURSOR output
    The above mentioned blog post describes in detail how to obtain that information.
    Your post should have a meaningful subject, e.g. "SQL statement tuning request", and the message body should look similar to the following:
    *-- Start of template body --*
    The following SQL statement has been identified to perform poorly. It currently takes up to 10 seconds to execute, but it's supposed to take a second at most.
    This is the statement:
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id;It should return data from a table in a specific order.
    The version of the database is 11.1.0.7.
    These are the parameters relevant to the optimizer:
    SQL>
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      11.1.0.7
    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>
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     8
    SQL>
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL>
    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
      3           , pname
      4           , pval1
      5           , pval2
      6  from
      7           sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          01-30-2009 16:25
    SYSSTATS_INFO        DSTOP                           01-30-2009 16:25
    SYSSTATS_INFO        FLAGS                         0
    SYSSTATS_MAIN        CPUSPEEDNW              494,397
    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.Here is the output of EXPLAIN PLAN:
    SQL> explain plan for
      2  -- put your statement here
      3  select
      4             *
      5  from
      6             t_demo
      7  where
      8             type = 'VIEW'
      9  order by
    10             id;
    Explained.
    Elapsed: 00:00:00.01
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    14 rows selected.Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> rem Set the ARRAYSIZE according to your application
    SQL> set autotrace traceonly arraysize 100
    SQL> select
      2             *
      3  from
      4             t_demo
      5  where
      6             type = 'VIEW'
      7  order by
      8             id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    Execution Plan
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    Statistics
              0  recursive calls
              0  db block gets
         149101  consistent gets
            800  physical reads
            196  redo size
        1077830  bytes sent via SQL*Net to client
          16905  bytes received via SQL*Net from client
           1501  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         149938  rows processed
    SQL>
    SQL> disconnect
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsThe TKPROF output for this statement looks like the following:
    TKPROF: Release 11.1.0.7.0 - Production on Mo Feb 23 10:23:08 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: orcl11_ora_3376_mytrace1.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch     1501      0.53       1.36        800     149101          0      149938
    total     1503      0.53       1.36        800     149101          0      149938
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 88 
    Rows     Row Source Operation
    149938  TABLE ACCESS BY INDEX ROWID T_DEMO (cr=149101 pr=800 pw=0 time=60042 us cost=0 size=60 card=1)
    149938   INDEX RANGE SCAN IDX_DEMO (cr=1881 pr=1 pw=0 time=0 us cost=0 size=0 card=1)(object id 74895)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                    1501        0.00          0.00
      db file sequential read                       800        0.05          0.80
      SQL*Net message from client                  1501        0.00          0.69
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> -- put your statement here
    SQL> -- use the GATHER_PLAN_STATISTICS hint
    SQL> -- if you're not using STATISTICS_LEVEL = ALL
    SQL> select /*+ gather_plan_statistics */
      2  *
      3  from
      4  t_demo
      5  where
      6  type = 'VIEW'
      7  order by
      8  id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    SQL>
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  d4k5acu783vu8, child number 0
    select   /*+ gather_plan_statistics */          * from          t_demo
    where          type = 'VIEW' order by          id
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT            |          |      1 |        |    149K|00:00:00.02 |     149K|   1183 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |      1 |      1 |    149K|00:00:00.02 |     149K|   1183 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |      1 |      1 |    149K|00:00:00.02 |    1880 |    383 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    20 rows selected.I'm looking forward for suggestions how to improve the performance of this statement.
    *-- End of template body --*
    I'm sure that if you follow these instructions and obtain the information described, post them using a proper formatting (don't forget about the \ tag) you'll receive meaningful advice very soon.
    So, just to make sure you didn't miss this point:Use proper formatting!
    If you think I missed something important in this sample post let me know so that I can improve it.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Alex Nuijten wrote:
    ...you missed the proper formatting of the Autotrace section ;-)Alex,
    can't reproduce, does it still look unformatted? Or are you simply kidding? :-)
    Randolf
    PS: Just noticed that it actually sometimes doesn't show the proper formatting although the code tags are there. Changing to the \ tag helped in this case, but it seems to be odd.
    Edited by: Randolf Geist on Feb 23, 2009 11:28 AM
    Odd behaviour of forum software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Slow table creation after upgrade from 10.2.0.3 to 11.2.0.1 using DBUA

    I've recently completed a database upgrade from 10.2.0.3 to 11.2.0.1 using the DBUA.
    I've since encountered a slowdown when running a script which drops and recreates a series of ~250 tables. The script normally runs in around 19 seconds. After the upgrade, the script requires ~2 minutes to run.
    By chance has anyone encountered something similar?
    The problem may be related to the behavior of an "after CREATE on schema" trigger which grants select privileges to a role through the use of a dbms_job call; between 10g and the database that was upgraded from 10G to 11g. Currently researching this angle.
    I will be using the following table creation DDL for this abbreviated test case:
    create table ALLIANCE  (
       ALLIANCEID           NUMBER(10)                      not null,
       NAME                 VARCHAR2(40)                    not null,
       CREATION_DATE        DATE,
       constraint PK_ALLIANCE primary key (ALLIANCEID)
               using index
           tablespace LIVE_INDEX
    tablespace LIVE_DATA;When calling the above DDL, an "after CREATE on schema" trigger is fired which schedules a job to immediately run to grant select privilege to a role for the table which was just created:
    create or replace
    trigger select_grant
    after CREATE on schema
    declare
        l_str varchar2(255);
        l_job number;
    begin
        if ( ora_dict_obj_type = 'TABLE' ) then
            l_str := 'execute immediate "grant select on ' ||
                                         ora_dict_obj_name ||
                                        ' to select_role";';
            dbms_job.submit( l_job, replace(l_str,'"','''') );
        end if;
    end;
    {code}
    Below I've included data on two separate test runs.  The first is on the upgraded database and includes optimizer parameters and an abbreviated TKPROF.  I've also, included the offending sys generate SQL which is not issued when the same test is run on a 10g environment that has been set up with a similar test case.  The 10g test run's TKPROF is also included below.
    The version of the database is 11.2.0.1.
    These are the parameters relevant to the optimizer for the test run on the upgraded 11g SID:
    {code}
    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.1
    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     8
    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> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          03-11-2010 16:33
    SYSSTATS_INFO        DSTOP                           03-11-2010 17:03
    SYSSTATS_INFO        FLAGS                         0
    SYSSTATS_MAIN        CPUSPEEDNW           713.978495
    SYSSTATS_MAIN        IOSEEKTIM                    10
    SYSSTATS_MAIN        IOTFRSPEED                 4096
    SYSSTATS_MAIN        SREADTIM               1565.746
    SYSSTATS_MAIN        MREADTIM
    SYSSTATS_MAIN        CPUSPEED                   2310
    SYSSTATS_MAIN        MBRC
    SYSSTATS_MAIN        MAXTHR
    SYSSTATS_MAIN        SLAVETHR
    13 rows selected.
    {code}
    Output from TKPROF on the 11g SID:
    {code}
    create table ALLIANCE  (
       ALLIANCEID           NUMBER(10)                      not null,
       NAME                 VARCHAR2(40)                    not null,
       CREATION_DATE        DATE,
       constraint PK_ALLIANCE primary key (ALLIANCEID)
               using index
           tablespace LIVE_INDEX
    tablespace LIVE_DATA
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          4           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          4           0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 324
    {code}
    ... large section omitted ...
    Here is the performance hit portion of the TKPROF on the 11g SID:
    {code}
    SQL ID: fsbqktj5vw6n9
    Plan Hash: 1443566277
    select next_run_date, obj#, run_job, sch_job
    from
    (select decode(bitand(a.flags, 16384), 0, a.next_run_date,
      a.last_enabled_time) next_run_date,       a.obj# obj#,
      decode(bitand(a.flags, 16384), 0, 0, 1) run_job, a.sch_job  sch_job  from
      (select p.obj# obj#, p.flags flags, p.next_run_date next_run_date,
      p.job_status job_status, p.class_oid class_oid,      p.last_enabled_time
      last_enabled_time, p.instance_id instance_id,      1 sch_job   from
      sys.scheduler$_job p   where bitand(p.job_status, 3) = 1    and
      ((bitand(p.flags, 134217728 + 268435456) = 0) or
      (bitand(p.job_status, 1024) <> 0))    and bitand(p.flags, 4096) = 0    and
      p.instance_id is NULL    and (p.class_oid is null      or (p.class_oid is
      not null      and p.class_oid in (select b.obj# from sys.scheduler$_class b
                               where b.affinity is null)))   UNION ALL   select
      q.obj#, q.flags, q.next_run_date, q.job_status, q.class_oid,
      q.last_enabled_time, q.instance_id, 1   from sys.scheduler$_lightweight_job
      q   where bitand(q.job_status, 3) = 1    and ((bitand(q.flags, 134217728 +
      268435456) = 0) or         (bitand(q.job_status, 1024) <> 0))    and
      bitand(q.flags, 4096) = 0    and q.instance_id is NULL    and (q.class_oid
      is null      or (q.class_oid is not null      and q.class_oid in (select
      c.obj# from sys.scheduler$_class c                          where
      c.affinity is null)))   UNION ALL   select j.job, 0,
      from_tz(cast(j.next_date as timestamp),      to_char(systimestamp,'TZH:TZM')
      ), 1, NULL,      from_tz(cast(j.next_date as timestamp),
      to_char(systimestamp,'TZH:TZM')),     NULL, 0   from sys.job$ j   where
      (j.field1 is null or j.field1 = 0)    and j.this_date is null) a   order by
      1)   where rownum = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.47       0.47          0       9384          0           1
    total        3      0.48       0.48          0       9384          0           1
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=9384 pr=0 pw=0 time=0 us)
          1   VIEW  (cr=9384 pr=0 pw=0 time=0 us cost=5344 size=6615380 card=194570)
          1    SORT ORDER BY STOPKEY (cr=9384 pr=0 pw=0 time=0 us cost=5344 size=11479630 card=194570)
    194790     VIEW  (cr=9384 pr=0 pw=0 time=537269 us cost=2563 size=11479630 card=194570)
    194790      UNION-ALL  (cr=9384 pr=0 pw=0 time=439235 us)
        231       FILTER  (cr=68 pr=0 pw=0 time=920 us)
        231        TABLE ACCESS FULL SCHEDULER$_JOB (cr=66 pr=0 pw=0 time=690 us cost=19 size=13157 card=223)
          1        TABLE ACCESS BY INDEX ROWID SCHEDULER$_CLASS (cr=2 pr=0 pw=0 time=0 us cost=1 size=40 card=1)
          1         INDEX UNIQUE SCAN SCHEDULER$_CLASS_PK (cr=1 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 5056)
          0       FILTER  (cr=3 pr=0 pw=0 time=0 us)
          0        TABLE ACCESS FULL SCHEDULER$_LIGHTWEIGHT_JOB (cr=3 pr=0 pw=0 time=0 us cost=2 size=95 card=1)
          0        TABLE ACCESS BY INDEX ROWID SCHEDULER$_CLASS (cr=0 pr=0 pw=0 time=0 us cost=1 size=40 card=1)
          0         INDEX UNIQUE SCAN SCHEDULER$_CLASS_PK (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 5056)
    194559       TABLE ACCESS FULL JOB$ (cr=9313 pr=0 pw=0 time=167294 us cost=2542 size=2529254 card=194558)
    {code}
    and the totals at the end of the TKPROF on the 11g SID:
    {code}
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          4           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        3      0.00       0.00          0          0          4           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       70      0.00       0.00          0          0          0           0
    Execute     85      0.01       0.01          0         62        208          37
    Fetch       49      0.48       0.49          0       9490          0          35
    total      204      0.51       0.51          0       9552        208          72
    Misses in library cache during parse: 5
    Misses in library cache during execute: 3
       35  user  SQL statements in session.
       53  internal SQL statements in session.
       88  SQL statements in session.
    Trace file: 11gSID_ora_17721.trc
    Trace file compatibility: 11.1.0.7
    Sort options: default
           1  session in tracefile.
          35  user  SQL statements in trace file.
          53  internal SQL statements in trace file.
          88  SQL statements in trace file.
          51  unique SQL statements in trace file.
        1590  lines in trace file.
          18  elapsed seconds in trace file.
    {code}
    The version of the database is 10.2.0.3.0.
    These are the parameters relevant to the optimizer for the test run on the 10g SID:
    {code}
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.3
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     8
    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> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          09-24-2007 11:09
    SYSSTATS_INFO        DSTOP                           09-24-2007 11:09
    SYSSTATS_INFO        FLAGS                         1
    SYSSTATS_MAIN        CPUSPEEDNW           2110.16949
    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.
    {code}
    Now for the TKPROF of a mirrored test environment running on a 10G SID:
    {code}
    create table ALLIANCE  (
       ALLIANCEID           NUMBER(10)                      not null,
       NAME                 VARCHAR2(40)                    not null,
       CREATION_DATE        DATE,
       constraint PK_ALLIANCE primary key (ALLIANCEID)
               using index
           tablespace LIVE_INDEX
    tablespace LIVE_DATA
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.01          0          2         16           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.01          0          2         16           0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 113
    {code}
    ... large section omitted ...
    Totals for the TKPROF on the 10g SID:
    {code}
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.02          0          0          0           0
    Execute      1      0.00       0.00          0          2         16           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.02          0          2         16           0
    Misses in library cache during parse: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       65      0.01       0.01          0          1         32           0
    Execute     84      0.04       0.09         20         90        272          35
    Fetch       88      0.00       0.10         30        281          0          64
    total      237      0.07       0.21         50        372        304          99
    Misses in library cache during parse: 38
    Misses in library cache during execute: 32
       10  user  SQL statements in session.
       76  internal SQL statements in session.
       86  SQL statements in session.
    Trace file: 10gSID_ora_32003.trc
    Trace file compatibility: 10.01.00
    Sort options: default
           1  session in tracefile.
          10  user  SQL statements in trace file.
          76  internal SQL statements in trace file.
          86  SQL statements in trace file.
          43  unique SQL statements in trace file.
         949  lines in trace file.
           0  elapsed seconds in trace file.
    {code}
    Edited by: user8598842 on Mar 11, 2010 5:08 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    So while this certainly isn't the most elegant of solutions, and most assuredly isn't in the realm of supported by Oracle...
    I've used the DBMS_IJOB.DROP_USER_JOBS('username'); package to remove the 194558 orphaned job entries from the job$ table. Don't ask, I've no clue how they all got there; but I've prepared some evil looks to unleash upon certain developers tomorrow morning.
    Not being able to reorganize the JOB$ table to free the now wasted ~67MB of space I've opted to create a new index on the JOB$ table to sidestep the full table scan.
    CREATE INDEX SYS.JOB_F1_THIS_NEXT ON SYS.JOB$ (FIELD1, THIS_DATE, NEXT_DATE) TABLESPACE SYSTEM;The next option would be to try to find a way to grant the select privilege to the role without using the aforementioned "after CREATE on schema" trigger and dbms_job call. This method was adopted to cover situations in which a developer manually added a table directly to the database rather than using the provided scripts to recreate their test environment.
    I assume that the following quote from the 11gR2 documentation is mistaken, and there is no such beast as "create or replace table" in 11g:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9003.htm#i2061306
    "Dropping a table invalidates dependent objects and removes object privileges on the table. If you want to re-create the table, then you must regrant object privileges on the table, re-create the indexes, integrity constraints, and triggers for the table, and respecify its storage parameters. Truncating and replacing have none of these effects. Therefore, removing rows with the TRUNCATE statement or replacing the table with a *CREATE OR REPLACE TABLE* statement can be more efficient than dropping and re-creating a table."

  • Unable to resync dataguard

    Hi everybody!
    I have a problem. Some weeks ago I opened a post related to this issue. We have two dataguards with dataguard broker. One of them is resync (thanks to mseberg and this forum) and now I have problems with the other.
    Once I have learned how to configure and start/stop dataguard broker, I have a more basic problem, which is to resync it. I follow a process, where I backup the primary with RMAN, I copy the rman files to the other server with the controlfile, at once, I recover with rman again.
    The problem is that it is too big, 2 hours for backing it up more or less, and when I restore it, no archivelog list appears being syncronized.
    I have followed the same process than the other one and I can't resync it. I think there is something at my params or something new at 11g version...
    SQL> show parameters
    NAME TYPE VALUE
    O7_DICTIONARY_ACCESSIBILITY boolean FALSE
    active_instance_count integer
    aq_tm_processes integer 0
    archive_lag_target integer 0
    asm_diskgroups string
    asm_diskstring string
    asm_power_limit integer 1
    asm_preferred_read_failure_groups string
    audit_file_dest string /opt/oracle/admin/MN122010P/ad
    ump
    audit_sys_operations boolean FALSE
    audit_syslog_level string
    audit_trail string DB
    background_core_dump string partial
    background_dump_dest string /opt/oracle/diag/rdbms/mn12201
    0p/MN122010P/trace
    backup_tape_io_slaves boolean FALSE
    bitmap_merge_area_size integer 1048576
    blank_trimming boolean FALSE
    buffer_pool_keep string
    buffer_pool_recycle string
    cell_offload_compaction string ADAPTIVE
    cell_offload_parameters string
    cell_offload_plan_display string AUTO
    cell_offload_processing boolean TRUE
    cell_partition_large_extents string DEFAULT
    circuits integer
    client_result_cache_lag big integer 3000
    client_result_cache_size big integer 0
    cluster_database boolean FALSE
    cluster_database_instances integer 1
    cluster_interconnects string
    commit_logging string
    commit_point_strength integer 1
    commit_wait string
    commit_write string
    compatible string 11.1.0.0.0
    control_file_record_keep_time integer 7
    control_files string /opt/oracle/oradata/MN122010P/
    controlfile/control01.ctl, /op
    t/oracle/oradata1/MN122010P/co
    ntrolfile/control02.ctl
    control_management_pack_access string DIAGNOSTIC+TUNING
    core_dump_dest string /opt/oracle/diag/rdbms/mn12201
    0p/MN122010P/cdump
    cpu_count integer 4
    create_bitmap_area_size integer 8388608
    create_stored_outlines string
    cursor_sharing string EXACT
    cursor_space_for_time boolean FALSE
    db_16k_cache_size big integer 0
    db_2k_cache_size big integer 0
    db_32k_cache_size big integer 0
    db_4k_cache_size big integer 0
    db_8k_cache_size big integer 0
    db_block_buffers integer 0
    db_block_checking string FALSE
    db_block_checksum string TYPICAL
    db_block_size integer 8192
    db_cache_advice string ON
    db_cache_size big integer 0
    db_create_file_dest string /opt/oracle/oradata
    db_create_online_log_dest_1 string /opt/oracle/oradata
    db_create_online_log_dest_2 string /opt/oracle/oradata1
    db_create_online_log_dest_3 string
    db_create_online_log_dest_4 string
    db_create_online_log_dest_5 string
    db_domain string domain.es
    db_file_multiblock_read_count integer 69
    db_file_name_convert string
    db_files integer 200
    db_flashback_retention_target integer 1440
    db_keep_cache_size big integer 0
    db_lost_write_protect string NONE
    db_name string MN122010
    db_recovery_file_dest string /opt/oracle/oradata/flash_reco
    very_area
    db_recovery_file_dest_size big integer 100G
    db_recycle_cache_size big integer 0
    db_securefile string PERMITTED
    db_ultra_safe string OFF
    db_unique_name string MN122010P
    db_writer_processes integer 1
    dbwr_io_slaves integer 0
    ddl_lock_timeout integer 0
    dg_broker_config_file1 string /opt/oracle/product/db111/dbs/
    dr1MN122010P.dat
    dg_broker_config_file2 string /opt/oracle/product/db111/dbs/
    dr2MN122010P.dat
    dg_broker_start boolean FALSE
    diagnostic_dest string /opt/oracle
    disk_asynch_io boolean TRUE
    dispatchers string (PROTOCOL=TCP) (SERVICE=MN1220
    10PXDB)
    distributed_lock_timeout integer 60
    dml_locks integer 844
    drs_start boolean FALSE
    enable_ddl_logging boolean FALSE
    event string
    fal_client string
    fal_server string
    fast_start_io_target integer 0
    fast_start_mttr_target integer 0
    fast_start_parallel_rollback string LOW
    file_mapping boolean FALSE
    fileio_network_adapters string
    filesystemio_options string none
    fixed_date string
    gc_files_to_locks string
    gcs_server_processes integer 0
    global_context_pool_size string
    global_names boolean FALSE
    global_txn_processes integer 1
    hash_area_size integer 131072
    hi_shared_memory_address integer 0
    hs_autoregister boolean TRUE
    ifile file
    instance_groups string
    instance_name string MN122010P
    instance_number integer 0
    instance_type string RDBMS
    java_jit_enabled boolean TRUE
    java_max_sessionspace_size integer 0
    java_pool_size big integer 0
    java_soft_sessionspace_limit integer 0
    job_queue_processes integer 1000
    large_pool_size big integer 0
    ldap_directory_access string NONE
    ldap_directory_sysauth string no
    license_max_sessions integer 0
    license_max_users integer 0
    license_sessions_warning integer 0
    local_listener string LISTENER_MN122010P
    lock_name_space string
    lock_sga boolean FALSE
    log_archive_config string dg_config=(MN122010P,MN122010R
    ,MN12201R)
    log_archive_dest string
    log_archive_dest_1 string location="USE_DB_RECOVERY_FILE
    _DEST", valid_for=(ALL_LOGFIL
    ES,ALL_ROLES)
    log_archive_dest_10 string
    log_archive_dest_2 string service=MN12201R, LGWR SYNC AF
    FIRM delay=0 OPTIONAL compress
    ion=DISABLE max_failure=0 max_
    connections=1 reopen=300 db_
    unique_name=MN12201R net_timeo
    ut=30 valid_for=(online_logfi
    le,primary_role)
    log_archive_dest_3 string
    log_archive_dest_4 string
    log_archive_dest_5 string
    log_archive_dest_6 string
    log_archive_dest_7 string
    log_archive_dest_8 string
    log_archive_dest_9 string
    log_archive_dest_state_1 string ENABLE
    log_archive_dest_state_10 string enable
    log_archive_dest_state_2 string ENABLE
    log_archive_dest_state_3 string ENABLE
    log_archive_dest_state_4 string enable
    log_archive_dest_state_5 string enable
    log_archive_dest_state_6 string enable
    log_archive_dest_state_7 string enable
    log_archive_dest_state_8 string enable
    log_archive_dest_state_9 string enable
    log_archive_duplex_dest string
    log_archive_format string %t_%s_%r.dbf
    log_archive_local_first boolean TRUE
    log_archive_max_processes integer 4
    log_archive_min_succeed_dest integer 1
    log_archive_start boolean FALSE
    log_archive_trace integer 0
    log_buffer integer 7668736
    log_checkpoint_interval integer 0
    log_checkpoint_timeout integer 1800
    log_checkpoints_to_alert boolean FALSE
    log_file_name_convert string
    max_commit_propagation_delay integer 0
    max_dispatchers integer
    max_dump_file_size string unlimited
    max_enabled_roles integer 150
    max_shared_servers integer
    memory_max_target big integer 512M
    memory_target big integer 512M
    nls_calendar string
    nls_comp string BINARY
    nls_currency string
    nls_date_format string
    nls_date_language string
    nls_dual_currency string
    nls_iso_currency string
    nls_language string AMERICAN
    nls_length_semantics string BYTE
    nls_nchar_conv_excp string FALSE
    nls_numeric_characters string
    nls_sort string
    nls_territory string AMERICA
    nls_time_format string
    nls_time_tz_format string
    nls_timestamp_format string
    nls_timestamp_tz_format string
    object_cache_max_size_percent integer 10
    object_cache_optimal_size integer 102400
    olap_page_pool_size big integer 0
    open_cursors integer 300
    open_links integer 4
    open_links_per_instance integer 4
    optimizer_capture_sql_plan_baselines boolean FALSE
    optimizer_dynamic_sampling integer 2
    optimizer_features_enable string 11.1.0.7
    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
    os_authent_prefix string ops$
    os_roles boolean FALSE
    parallel_adaptive_multi_user boolean TRUE
    parallel_automatic_tuning boolean FALSE
    parallel_execution_message_size integer 2152
    parallel_instance_group string
    parallel_io_cap_enabled boolean FALSE
    parallel_max_servers integer 40
    parallel_min_percent integer 0
    parallel_min_servers integer 0
    parallel_server boolean FALSE
    parallel_server_instances integer 1
    parallel_threads_per_cpu integer 2
    pga_aggregate_target big integer 0
    plscope_settings string IDENTIFIERS:NONE
    plsql_ccflags string
    plsql_code_type string INTERPRETED
    plsql_debug boolean FALSE
    plsql_native_library_dir string
    plsql_native_library_subdir_count integer 0
    plsql_optimize_level integer 2
    plsql_v2_compatibility boolean FALSE
    plsql_warnings string DISABLE:ALL
    pre_page_sga boolean FALSE
    processes integer 170
    query_rewrite_enabled string TRUE
    query_rewrite_integrity string enforced
    rdbms_server_dn string
    read_only_open_delayed boolean FALSE
    recovery_parallelism integer 0
    recyclebin string on
    redo_transport_user string
    remote_dependencies_mode string TIMESTAMP
    remote_listener string
    remote_login_passwordfile string EXCLUSIVE
    remote_os_authent boolean FALSE
    remote_os_roles boolean FALSE
    replication_dependency_tracking boolean TRUE
    resource_limit boolean FALSE
    resource_manager_cpu_allocation integer 4
    resource_manager_plan string
    result_cache_max_result integer 5
    result_cache_max_size big integer 1312K
    result_cache_mode string MANUAL
    result_cache_remote_expiration integer 0
    resumable_timeout integer 0
    rollback_segments string
    sec_case_sensitive_logon boolean TRUE
    sec_max_failed_login_attempts integer 10
    sec_protocol_error_further_action string CONTINUE
    sec_protocol_error_trace_action string TRACE
    sec_return_server_release_banner boolean FALSE
    serial_reuse string disable
    service_names string MN122010P.domain.es
    session_cached_cursors integer 50
    session_max_open_files integer 10
    sessions integer 192
    sga_max_size big integer 512M
    sga_target big integer 0
    shadow_core_dump string partial
    shared_memory_address integer 0
    shared_pool_reserved_size big integer 10066329
    shared_pool_size big integer 0
    shared_server_sessions integer
    shared_servers integer 1
    skip_unusable_indexes boolean TRUE
    smtp_out_server string
    sort_area_retained_size integer 0
    sort_area_size integer 65536
    spfile string /opt/oracle/product/db111/dbs/
    spfileMN122010P.ora
    sql92_security boolean FALSE
    sql_trace boolean FALSE
    sql_version string NATIVE
    sqltune_category string DEFAULT
    standby_archive_dest string ?/dbs/arch
    standby_file_management string AUTO
    star_transformation_enabled string FALSE
    statistics_level string TYPICAL
    streams_pool_size big integer 0
    tape_asynch_io boolean TRUE
    thread integer 0
    timed_os_statistics integer 0
    timed_statistics boolean TRUE
    trace_enabled boolean TRUE
    tracefile_identifier string
    transactions integer 211
    transactions_per_rollback_segment integer 5
    undo_management string AUTO
    undo_retention integer 900
    undo_tablespace string UNDOTBS1
    use_indirect_data_buffers boolean FALSE
    user_dump_dest string /opt/oracle/diag/rdbms/mn12201
    0p/MN122010P/trace
    utl_file_dir string
    workarea_size_policy string AUTO
    xml_db_events string enable
    I have tested the connectivity between them and it's ok, I recreated the password file
    [oracle@servername01 MN122010P]$ sqlplus "sys/[email protected] as sysdba"
    SQL> select * from v$instance;
    INSTANCE_NUMBER INSTANCE_NAME
    HOST_NAME
    VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT
    LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO
    1 MN122010P
    servername01
    11.1.0.7.0 09-OCT-11 OPEN NO 1 STARTED
    ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
    [oracle@servername01 MN122010P]$ sqlplus "sys/[email protected] as sysdba"
    SQL> select * from v$instance;
    INSTANCE_NUMBER INSTANCE_NAME
    HOST_NAME
    VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT
    LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO
    1 MN12201R
    servername02
    11.1.0.7.0 28-NOV-11 MOUNTED NO 1 STARTED
    ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
    Recovery Manager: Release 11.1.0.7.0 - Production on Thu Dec 1 10:16:23 2011
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    RMAN> connect target /
    connected to target database: MN122010 (DBID=2440111267)
    RMAN> run{
    ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/opt/oracle/oradata/BACKUPS_01/MN122010P/backup_%d_t%t_s%s_p%p';
    BACKUP DATABASE PLUS ARCHIVELOG;
    2> 3> 4>
    using target database control file instead of recovery catalog
    allocated channel: d1
    channel d1: SID=140 device type=DISK
    Starting backup at 01-DEC-11
    current log archived
    channel d1: starting archived log backup set
    channel d1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=4117 RECID=7260 STAMP=766935608
    input archived log thread=1 sequence=4118 RECID=7261 STAMP=766935619
    input archived log thread=1 sequence=4119 RECID=7262 STAMP=766935630
    input archived log thread=1 sequence=4120 RECID=7263 STAMP=766935635
    ....List of archives....
    Starting backup at 01-DEC-11
    channel d1: starting full datafile backup set
    channel d1: specifying datafile(s) in backup set
    input datafile file number=00010 name=/opt/oracle/oradata/MN122010P/TBCESPANDM_01.DBF
    input datafile file number=00009 name=/opt/oracle/oradata/MN122010P/CESPAROUTING_01.DBF
    input datafile file number=00007 name=/opt/oracle/oradata/MN122010P/TBCESPACALLEJERO_01.DBF
    input datafile file number=00008 name=/opt/oracle/oradata/MN122010P/CESPAGEOCODER_01.DBF
    input datafile file number=00001 name=/opt/oracle/oradata/MN122010P/system01.dbf
    input datafile file number=00002 name=/opt/oracle/oradata/MN122010P/sysaux01.dbf
    input datafile file number=00003 name=/opt/oracle/oradata/MN122010P/undotbs01.dbf
    input datafile file number=00006 name=/opt/oracle/oradata/MN122010P/TBCESPAFONDO_01.DBF
    input datafile file number=00005 name=/opt/oracle/oradata/MN122010P/TBCESPAPOIS_01.DBF
    input datafile file number=00004 name=/opt/oracle/oradata/MN122010P/users01.dbf
    channel d1: starting piece 1 at 01-DEC-11
    channel d1: finished piece 1 at 01-DEC-11
    piece handle=/opt/oracle/oradata/BACKUPS_01/MN122010P/backup_MN122010_t768739341_s768_p1 tag=TAG20111201T104221 comment=NONE
    channel d1: backup set complete, elapsed time: 00:39:26
    Finished backup at 01-DEC-11
    Starting backup at 01-DEC-11
    current log archived
    channel d1: starting archived log backup set
    channel d1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=4256 RECID=7399 STAMP=768741707
    channel d1: starting piece 1 at 01-DEC-11
    channel d1: finished piece 1 at 01-DEC-11
    piece handle=/opt/oracle/oradata/BACKUPS_01/MN122010P/backup_MN122010_t768741708_s769_p1 tag=TAG20111201T112148 comment=NONE
    channel d1: backup set complete, elapsed time: 00:00:01
    Finished backup at 01-DEC-11
    Starting Control File and SPFILE Autobackup at 01-DEC-11
    piece handle=/opt/oracle/product/db111/dbs/c-2440111267-20111201-00 comment=NONE
    Finished Control File and SPFILE Autobackup at 01-DEC-11
    released channel: d1
    I made a alter database create standby controlfile as at Primary and at Standby:
    SQL> shutdown immediate;
    ORA-01109: base de datos sin abrir
    Base de datos desmontada.
    Instancia ORACLE cerrada.
    SQL> startup nomount;
    Instancia ORACLE iniciada.
    Total System Global Area 2937555928 bytes
    Fixed Size 744408 bytes
    Variable Size 1862270976 bytes
    Database Buffers 1073741824 bytes
    Redo Buffers 798720 bytes
    copy the controlfile to standby controlfile locations
    startup standby
    ALTER DATABASE MOUNT STANDBY DATABASE;
    And restoring with rman
    Restoring
    List of Archived Logs in backup set 616
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 4256 27049296 01-DEC-11 27052551 01-DEC-11
    RMAN> run{
    2> allocate channel c1 type disk format '/opt/oracle/oradata/BACKUPS_01/MN122010P/backup_%d_t%t_s%s_p%p';
    3> restore database;
    4> recover database until sequence 4256 thread 1;
    5> sql 'alter database recover managed standby database disconnect from session';
    6> release channel c1;
    7> }
    allocated channel: c1
    channel c1: SID=164 device type=DISK
    Starting restore at 01-DEC-11
    Starting implicit crosscheck backup at 01-DEC-11
    Crosschecked 115 objects
    Finished implicit crosscheck backup at 01-DEC-11
    Starting implicit crosscheck copy at 01-DEC-11
    Crosschecked 24 objects
    Finished implicit crosscheck copy at 01-DEC-11
    searching for all files in the recovery area
    cataloging files...
    no files cataloged
    channel c1: starting datafile backup set restore
    channel c1: specifying datafile(s) to restore from backup set
    channel c1: restoring datafile 00001 to /opt/oracle/oradata/MN122010P/system01.dbf
    channel c1: restoring datafile 00002 to /opt/oracle/oradata/MN122010P/sysaux01.dbf
    channel c1: restoring datafile 00003 to /opt/oracle/oradata/MN122010P/undotbs01.dbf
    channel c1: restoring datafile 00004 to /opt/oracle/oradata/MN122010P/users01.dbf
    channel c1: restoring datafile 00005 to /opt/oracle/oradata/MN122010P/TBCESPAPOIS_01.DBF
    channel c1: restoring datafile 00006 to /opt/oracle/oradata/MN122010P/TBCESPAFONDO_01.DBF
    channel c1: restoring datafile 00007 to /opt/oracle/oradata/MN122010P/TBCESPACALLEJERO_01.DBF
    channel c1: restoring datafile 00008 to /opt/oracle/oradata/MN122010P/CESPAGEOCODER_01.DBF
    channel c1: restoring datafile 00009 to /opt/oracle/oradata/MN122010P/CESPAROUTING_01.DBF
    channel c1: restoring datafile 00010 to /opt/oracle/oradata/MN122010P/TBCESPANDM_01.DBF
    channel c1: reading from backup piece /opt/oracle/oradata/BACKUPS_01/MN122010P/backup_MN122010_t768739341_s768_p1
    After the restoring I found at standby that no archives have been applied:
    SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME,APPLIED
    FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#
    / 2 3
    no rows selected
    SQL> select * from v$Instance;
    INSTANCE_NUMBER INSTANCE_NAME
    HOST_NAME
    VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT
    LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO
    1 MN12201R
    server02
    11.1.0.7.0 01-DEC-11 MOUNTED NO 1 STARTED
    ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
    SQL> select message from v$dataguard_status;
    MESSAGE
    ARC0: Archival started
    ARC1: Archival started
    ARC2: Archival started
    ARC3: Archival started
    ARC0: Becoming the 'no FAL' ARCH
    ARC0: Becoming the 'no SRL' ARCH
    ARC1: Becoming the heartbeat ARCH
    7 rows selected.
    On primary
    MESSAGE
    ARC3: Beginning to archive thread 1 sequence 4258 (27056314-27064244)
    ARC3: Completed archiving thread 1 sequence 4258 (27056314-27064244)
    ARC0: Beginning to archive thread 1 sequence 4259 (27064244-27064251)
    ARC0: Completed archiving thread 1 sequence 4259 (27064244-27064251)
    ARC2: Beginning to archive thread 1 sequence 4260 (27064251-27064328)
    ARC2: Completed archiving thread 1 sequence 4260 (27064251-27064328)
    ARC3: Beginning to archive thread 1 sequence 4261 (27064328-27064654)
    ARC3: Completed archiving thread 1 sequence 4261 (27064328-27064654)
    Edited by: user8898355 on 01-dic-2011 7:02

    I'm seeing those errors at primary
    LNSb started with pid=20, OS id=30141
    LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (16086)
    LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
    trace file:
    *** 2011-12-02 09:52:17.164
    *** SESSION ID:(183.1) 2011-12-02 09:52:17.164
    *** CLIENT ID:() 2011-12-02 09:52:17.164
    *** SERVICE NAME:(SYS$BACKGROUND) 2011-12-02 09:52:17.164
    *** MODULE NAME:() 2011-12-02 09:52:17.164
    *** ACTION NAME:() 2011-12-02 09:52:17.164
    *** TRACE FILE RECREATED AFTER BEING REMOVED ***
    *** 2011-12-02 09:52:17.164 6465 krsu.c
    Initializing NetServer[LNSb] for dest=MN12201R.domain.es mode SYNC
    LNSb is not running anymore.
    New SYNC LNSb needs to be started
    Waiting for subscriber count on LGWR-LNSb channel to go to zero
    Subscriber count went to zero - time now is <12/02/2011 09:52:17>
    Starting LNSb ...
    Waiting for LNSb [pid 30141] to initialize itself
    *** TRACE FILE RECREATED AFTER BEING REMOVED ***
    *** 2011-12-02 09:52:17.164 6465 krsu.c
    Initializing NetServer[LNSb] for dest=MN12201R.domain.es mode SYNC
    LNSb is not running anymore.
    New SYNC LNSb needs to be started
    Waiting for subscriber count on LGWR-LNSb channel to go to zero
    Subscriber count went to zero - time now is <12/02/2011 09:52:17>
    Starting LNSb ...
    Waiting for LNSb [pid 30141] to initialize itself
    *** 2011-12-02 09:52:20.185
    *** 2011-12-02 09:52:20.185 6828 krsu.c
    Netserver LNSb [pid 30141] for mode SYNC has been initialized
    Performing a channel reset to ignore previous responses
    Successfully started LNSb [pid 30141] for dest MN12201R.domain.es mode SYNC ocis=0x2ba2cb1fece8
    *** 2011-12-02 09:52:20.185 2880 krsu.c
    Making upiahm request to LNSb [pid 30141]: Begin Time is <12/02/2011 09:52:17>. NET_TIMEOUT = <30> seconds
    Waiting for LNSb to respond to upiahm
    *** 2011-12-02 09:52:20.262 3044 krsu.c
    upiahm connect done status is 0
    Receiving message from LNSb
    Receiving message from LNSb
    LGWR: Failed
    rfsp: 0x2ba2ca55c328
    rfsmod: 2
    rfsver: 3
    rfsflag: 0x24882

  • How to update Portal 10.1.2 to 10.1.4 under multiportal environment ?

    I install two portal and one infra.
    And Configuring Multiple Middle Tiers with a Load Balancing Router successfully.
    The origin portal virsion is 10.1.2.
    Now i want to update to 10.1.4 but have somthing wrong after I enter the update commond.
    Error message is java.SQLException: IO Exception : connection is reset.
    Then I run de upgrade command again , get the different error message
    ### ERROR: OracleAS Portal 10.1.4 upgrade precheck failed. See /raid/product/OraHome_1/upgrade/temp/portal/precheck.log for details.
    Error: Component upgrade failed PORTAL
    Error: PORTAL component version is: 10.1.2.0.2 INVALID
    FAILURE: Some OracleAS plug-ins report failure during upgrade.
    The Portal Upgrade precheck log is follow:
    -- Portal Upgrade release information: 10.1.4 Release 1
    Upgrade Started in -precheck -force mode at Wed Oct 18 21:22:19 2006
    ### PHASE 1: Initial setup
    Existing temporary directory /raid/product/OraHome_1/upgrade/temp/portal/prechktmp renamed to /raid/product/OraHome_1/upgrade/temp/portal/prechktmp.Wed-Oct-18-21.14.10-2006
    Existing log file /raid/product/OraHome_1/upgrade/temp/portal/precheck.log renamed to /raid/product/OraHome_1/upgrade/temp/portal/precheck.log.Wed-Oct-18-21.14.10-2006
    Creating /raid/product/OraHome_1/upgrade/temp/portal/prechktmp directory
    Creating /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/gen directory
    Welcome to the Oracle Portal Production Upgrade
    The script will lead you through the upgrade step by step.
    For questions asked in this script that have appropriate defaults
    those defaults will be shown in square brackets after the question.
    To accept a default value, simply hit the Return key.
    ### Set New Variables and Validate Environment Variables
    Step started at Wed Oct 18 21:22:19 2006
    PERL5LIB set to ../../../perl/lib/site_perl/5.6.1/i686-linux:../../../perl/lib:../../../perl/lib/5.6.1
    Check SQL*Plus version
    Running upg/frwk/upchkpls.sql### Log shared and environment variables
    Step started at Wed Oct 18 21:22:19 2006
    Log file: /raid/product/OraHome_1/upgrade/temp/portal/precheck.log
    Log dir: /raid/product/OraHome_1/upgrade/temp/portal/prechktmp
    Profile dir: /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/gen
    Verbose flag: 0
    Debug mode: 0
    Force flag: 1
    Nosave flag: 0
    Save flag: 1
    Repos flag: 0
    Compile flag: 0
    Oldver flag: 0
    isPatch flag: 0
    Will save Tables: 1
    Environment variables:
    ===========================================================
    DISPLAY: :0
    G_BROKEN_FILENAMES: 1
    HISTSIZE: 1000
    HOME: /home/oracle
    HOSTNAME: portal1.bizmatch.com.cn
    IBPATH: /usr/bin
    INPUTRC: /etc/inputrc
    KDEDIR: /usr
    LANG: en_US.UTF-8
    LC_CTYPE: en_US.UTF-8
    LD_ASSUME_KERNEL: 2.4.19
    LD_LIBRARY_PATH: /raid/product/OraHome_1/lib32:/raid/product/OraHome_1/lib:/raid/tmp/jdk/jre/lib/i386/client:/raid/tmp/jdk/jre/lib/i386:/raid/tmp/jdk/jre/../lib/i386:/raid/product/OraHome_1/lib32:/raid/product/OraHome_1/network/lib32:/raid/product/OraHome_1/lib:/raid/product/OraHome_1/network/lib:/raid/product/OraHome_1/lib:/usr/lib:/usr/local/lib
    LD_LIBRARY_PATH_64: /raid/product/OraHome_1/lib:/raid/product/OraHome_1/lib32:/raid/product/OraHome_1/network/lib32:/raid/product/OraHome_1/lib:/raid/product/OraHome_1/network/lib:
    LESSOPEN: |/usr/bin/lesspipe.sh %s
    LIBPATH: /raid/product/OraHome_1/lib32:/raid/product/OraHome_1/lib
    LOGNAME: oracle
    LS_COLORS: no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
    MAIL: /var/spool/mail/oracle
    NLSPATH: /usr/dt/lib/nls/msg/%L/%N.cat
    ORACLE_BASE: /raid/product
    ORACLE_HOME: /raid/product/OraHome_1
    ORACLE_SID:
    PATH: /raid/product/OraHome_1/bin:../../../perl/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/raid/product/OraHome_1/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/bin:/sbin:/usr/bin
    PERL5LIB: ../../../perl/lib/site_perl/5.6.1/i686-linux:../../../perl/lib:../../../perl/lib/5.6.1
    PWD: /raid/tmp/mrua
    QTDIR: /usr/lib/qt-3.3
    REPCA_ORACLE_HOME: /raid/tmp
    SHELL: /bin/bash
    SHLIB_PATH: /raid/product/OraHome_1/lib32:/raid/product/OraHome_1/lib
    SHLVL: 3
    SQLPATH: .:owa:/raid/product/OraHome_1/upgrade/temp/portal/prechktmp/gen:upg/frwk:sql:wwc
    SSH_ASKPASS: /usr/libexec/openssh/gnome-ssh-askpass
    TERM: xterm
    USER: oracle
    XAUTHORITY: /root/.Xauthority
    XFILESEARCHPATH: /usr/dt/app-defaults/%L/Dt
    _: /raid/tmp/jdk/bin/java
    ### PHASE 2: User inputs
    Upgrade phase started at Wed Oct 18 21:22:19 2006
    Processing Metadata File: upg/common/inputchk/inputchk.met Running upg/common/inputchk/inputchk.pl ### Verify that the database has been backed up
    Step started at Wed Oct 18 21:22:19 2006
    Before beginning the upgrade, it is important that you backup your database.
    Have you backed up your database (y/n)? [y]: y
    Ask user for schema and database details
    Enter the name of schema that you would like to upgrade [PORTAL]: portal
    Enter the password for the schema that you would like to upgrade [portal]:
    Enter the password for the SYS user of your database [CHANGE_ON_INSTALL]:
    Enter the TNS connect string to connect to the database [ORCL]: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=portaldb.bizmatch.com.cn)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=IASDB.bizmatch.com.cn)))
    Responses to the above questions will now be recorded in the file
    upgrade.in. Placeholders are recorded instead of actual passwords,
    for security reasons. If you wish, this file can be edited and used
    as the standard input for a subsequent run of upgrade.pl.
    ### Verify database connection information.
    Step started at Wed Oct 18 21:22:19 2006
    Validating the connection information supplied by the user
    Running CheckConnections()Check connection to the Portal repository.
    Check connection as SYS to the Portal repository.
    Ending CheckConnections() Wed Oct 18 21:22:19 2006
    ### PHASE 3: Setup
    Upgrade phase started at Wed Oct 18 21:22:19 2006
    Processing Metadata File: upg/common/setup/setup.met Running upg/common/setup/setup.pl Analyzing the product schema
    Running upg/common/setup/upgettbs.sqlPortal SQL script started at Wed Oct 18 21:22:19 2006
    Connected.
    ### Install messaging framework
    Step started at Wed Oct 18 21:22:19 2006
    Portal SQL script started at Wed Oct 18 21:22:19 2006
    Connected.
    No errors.
    No errors.
    Creating sequence 'wwpof_output_id_seq'
    Creating sequence 'wwpof_output_script_run_id_seq'
    Creating table 'wwpof_output$'
    Creating table 'wwpof_msg$'
    Creating index 'wwpof_output_idx1' in tablespace PORTAL
    Creating index 'wwpof_output_idx2' in tablespace PORTAL
    Creating index 'wwpof_output_idx3' in tablespace PORTAL
    Creating index 'wwpof_msg_uk1' in tablespace PORTAL
    No errors.
    No errors.
    Granting privileges on POF objects to SYS
    Loading /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/upgus.ctl using sqlldr
    Copying scripts to de-install message objects.
    Get Portal version and determine upgrade sequence
    Running upg/common/setup/upgetver.sqlPortal SQL script started at Wed Oct 18 21:22:22 2006
    Connected.
    Upgrading to version 10.1.4.0.0
    Version directories to be traversed: upg/10140
    Running upg/common/setup/setseq.pl Set the correct Traversal Sequence
    ### PHASE 4: Pre upgrade checks
    Upgrade phase started at Wed Oct 18 21:22:22 2006
    Processing Metadata File: upg/common/prechk/prechk.met Running upg/common/prechk/prechk.pl Set up subscriber iteration
    Running upg/common/prechk/upgetsub.sqlPortal SQL script started at Wed Oct 18 21:22:22 2006
    Connected.
    ### Perform pre upgrade checks
    Step started at Wed Oct 18 21:22:22 2006
    Running upg/frwk/utlchvpd.sqlPortal SQL script started at Wed Oct 18 21:22:22 2006
    Connected.
    Calling DoPreChecks()Starting precheck at Wed Oct 18 21:22:23 2006
    Calling upg/common/prechk/sysuppre.sql
    Connected.
    Running upg/common/prechk/upgtabs.sqlPortal SQL script started at Wed Oct 18 21:22:23 2006
    Connected.
    ### ERROR: WWU-00013: Tables with UPG_ prefix were found in the OracleAS Portal
    ### schema.
    ### Table Name
    ### UPG_PTL_OBJECTS$
    ### UPG_PTL_TABLES$
    ### UPG_WWV_DOCINFO
    ### CAUSE: The upgrade is terminated when UPG_ prefix tables are present in the
    ### OracleAS Portal schema.
    ### ACTION: Back up all tables with the UPG_ prefix, then delete them from the
    ### OracleAS Portal schema. The script
    ### /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/dropupg.sql can
    ### be used for this purpose.
    ### Check Failed at Wed Oct 18 21:22:23 2006 Continuing as PreCheck mode is specified
    Calling upg/common/prechk/wwvcheck.sql
    Portal SQL script started at Wed Oct 18 21:22:23 2006
    Connected.
    # Beginning outer script: prechk/wwvcheck
    # Check for invalid Portlet Builder (webview) components.
    # Checking if there are too many archive components.
    # Checking for missing application schemas.
    # Ending outer script: prechk/wwvcheck, 0.31 seconds
    Ending precheck at Wed Oct 18 21:22:24 2006
    Running upg/common/prechk/upchkobj.sqlPortal SQL script started at Wed Oct 18 21:22:24 2006
    Connected.
    Running upg/common/prechk/chkmrreg.sqlPortal SQL script started at Wed Oct 18 21:22:24 2006
    Connected.
    # Beginning outer script: prechk/chkmrreg
    # Pre-check to determine that OracleAS Portal is registered with OracleAS Internet Directory
    # OracleAS Portal has been wired with OracleAS Internet Directory
    # Ending outer script: prechk/chkmrreg, 0.10 seconds
    ### Connect to OID as Application Entry
    Running upg/common/prechk/bindapp.sql . Portal SQL script started at Wed Oct 18 21:22:24 2006
    Connected.
    # Beginning outer script: prechk/bindapp
    #-- Beginning inner script: prechk/bindapp
    # Pre-check to test bind to OracleAS Internet Directory Server
    # Connecting to OracleAS Internet Directory as the Application Entry
    # Connecting to OracleAS Internet Directory as the Application Entry was successful
    #-- Ending inner script: prechk/bindapp, 0.14 seconds
    # Ending outer script: prechk/bindapp, 0.20 seconds
    ### Display Tablespace and Parameter Settings
    Running upg/common/prechk/../../frwk/upshoset.sql .
    Subscriber independent Processing.
    Portal SQL script started at Wed Oct 18 21:22:24 2006
    Connected.
    # Beginning outer script: prechk/upshoset
    Tablespace Usage
    TABLESPACE BYTES_USED BYTES_FREE TOTAL BYTES CREATE_BYTES AUT FILE STAT STATUS     ENABLED BLOCKS BLOCK_SIZE FILE_NAME
    B2B_DT     63766528     20054016 83886080          0 YES AVAILABLE ONLINE     READ WRITE     10240     8192 /raid/product/oradata/IASDB/b2b_dt.dbf
    B2B_IDX 14942208     26935296 41943040          0 YES AVAILABLE ONLINE     READ WRITE     5120     8192 /raid/product/oradata/IASDB/b2b_idx.dbf
    B2B_LOB 11141120     30736384 41943040          0 YES AVAILABLE ONLINE     READ WRITE     5120     8192 /raid/product/oradata/IASDB/b2b_lob.dbf
    B2B_RT     39780352     12582912 52428800          0 YES AVAILABLE ONLINE     READ WRITE     6400     8192 /raid/product/oradata/IASDB/b2b_rt.dbf
    BAM     6553600     3866624 10485760          0 YES AVAILABLE ONLINE     READ WRITE     1280     8192 /raid/product/oradata/IASDB/bam.dbf
    DCM     237174784     20709376 257949696          0 YES AVAILABLE ONLINE     READ WRITE     31488     8192 /raid/product/oradata/IASDB/dcm.dbf
    DISCO_PTM5 1310720     1769472 3145728          0 YES AVAILABLE ONLINE     READ WRITE     384     8192 /raid/product/oradata/IASDB/discopltc1.dbf
    _CACHE
    DISCO_PTM5 1310720     1769472 3145728          0 YES AVAILABLE ONLINE     READ WRITE     384     8192 /raid/product/oradata/IASDB/discopltm1.dbf
    _META
    DSGATEWAY_ 5701632     1572864 7340032          0 YES AVAILABLE ONLINE     READ WRITE     896     8192 /raid/product/oradata/IASDB/oss_sys01.dbf
    TAB
    IAS_META 210567168     30539776 241172480          0 YES AVAILABLE ONLINE     READ WRITE     29440     8192 /raid/product/oradata/IASDB/ias_meta01.dbf
    OCATS     1769472     5505024 7340032          0 YES AVAILABLE ONLINE     READ WRITE     896     8192 /raid/product/oradata/IASDB/oca.dbf
    OLTS_ATTRS 2555904     917504 3538944          0 YES AVAILABLE ONLINE     READ WRITE     432     8192 /raid/product/oradata/IASDB/attrs1_oid.dbf
    TORE
    OLTS_BATTR 262144     131072 516096          0 YES AVAILABLE ONLINE     READ WRITE     63     8192 /raid/product/oradata/IASDB/battrs1_oid.dbf
    STORE
    OLTS_DEFAU 3997696     851968 4915200          0 YES AVAILABLE ONLINE     READ WRITE     600     8192 /raid/product/oradata/IASDB/gdefault1_oid.dbf
    LT
    ORABPEL 11993088     29884416 41943040          0 YES AVAILABLE ONLINE     READ WRITE     5120     8192 /raid/product/oradata/IASDB/orabpel.dbf
    PORTAL     74383360     6946816 78643200          0 YES AVAILABLE ONLINE     READ WRITE     9600     8192 /raid/product/oradata/IASDB/portal.dbf
    PORTAL_DOC 851968     3276800 4194304          0 YES AVAILABLE ONLINE     READ WRITE     512     8192 /raid/product/oradata/IASDB/ptldoc.dbf
    PORTAL_IDX 11206656     41156608 52428800          0 YES AVAILABLE ONLINE     READ WRITE     6400     8192 /raid/product/oradata/IASDB/ptlidx.dbf
    PORTAL_LOG 262144     3866624 4194304          0 YES AVAILABLE ONLINE     READ WRITE     512     8192 /raid/product/oradata/IASDB/ptllog.dbf
    SYSAUX     235732992     5373952 241172480          0 YES AVAILABLE ONLINE     READ WRITE     29440     8192 /raid/product/oradata/IASDB/sysaux01.dbf
    SYSTEM     834404352     4390912 838860800          0 YES AVAILABLE SYSTEM     READ WRITE 102400     8192 /raid/product/oradata/IASDB/system01.dbf
    TEMP     6291456     18874368 25165824     25165824 YES AVAILABLE ONLINE     READ WRITE     3072     8192 /raid/product/oradata/IASDB/temp01.dbf
    UDDISYS_TS 19988480     28180480 48234496          0 YES AVAILABLE ONLINE     READ WRITE     5888     8192 /raid/product/oradata/IASDB/uddisys01.dbf
    UNDOTBS1 247201792     4390912 251658240          0 YES AVAILABLE ONLINE     READ WRITE     30720     8192 /raid/product/oradata/IASDB/undotbs01.dbf
    USERS     327680     4849664 5242880          0 YES AVAILABLE ONLINE     READ WRITE     640     8192 /raid/product/oradata/IASDB/users01.dbf
    WCRSYS_TS 1703936     15007744 16777216          0 YES AVAILABLE ONLINE     READ WRITE     2048     8192 /raid/product/oradata/IASDB/wcrsys01.dbf
    Sort Segment Data
    TABLESPACE EXTENT_SIZE TOTAL_EXTENTS USED_EXTENTS FREE_EXTENTS MAX_USED_SIZE
    TEMP          128          5          0     5          1
    SGA Allocation Stats
    POOL     NAME                    BYTES
    java pool free memory               67108864
    Total                              67108864
    SGA Allocation Stats
    POOL     NAME                    BYTES
    large pool free memory               8388608
    Total                              8388608
    SGA Allocation Stats
    POOL     NAME                    BYTES
    shared pool fixed allocation callback               344
    shared pool pl/sql source               1156
    shared pool table definiti               1712
    shared pool alert threshol               2648
    shared pool trigger inform               3048
    shared pool joxs heap                    4220
    shared pool policy hash ta               4220
    shared pool trigger defini               5980
    shared pool KQR S SO                    7176
    shared pool PLS non-lib hp               12208
    shared pool trigger source               18652
    shared pool KQR L SO                    44032
    shared pool repository                76264
    shared pool KQR M SO                    81408
    shared pool parameters                105696
    shared pool type object de               194164
    shared pool KQR S PO                    207136
    shared pool VIRTUAL CIRCUITS               649340
    shared pool FileOpenBlock               746704
    shared pool kmgsb circular statistics          821248
    shared pool KSXR pending messages que          841036
    shared pool KSXR receive buffers          1032500
    shared pool KQR M PO                    1675892
    shared pool sessions                    1835204
    shared pool PL/SQL DIANA               2910560
    shared pool private strands               2928640
    shared pool KTI-UNDO                    3019632
    shared pool KGLS heap                    3105320
    shared pool PL/SQL MPCODE               3705484
    shared pool row cache                    3707272
    shared pool ASH buffers               4194304
    shared pool event statistics per sess          9094400
    shared pool sql area                    9234624
    shared pool library cache               10361688
    shared pool miscellaneous               15820288
    shared pool free memory               74540744
    Total                              150994944
    SGA Allocation Stats
    POOL     NAME                    BYTES
         log_buffer                524288
         fixed_sga                    778968
         buffer_cache               50331648
    Total                              51634904
    Database Parameters
    NAME                    VALUE
    O7_DICTIONARY_ACCESSIBILITY     FALSE
    active_instance_count
    aq_tm_processes           1
    archive_lag_target          0
    asm_diskgroups
    asm_diskstring
    asm_power_limit           1
    audit_file_dest           /raid/product/OraHome_1/rdbms/audit
    audit_sys_operations          FALSE
    audit_trail               NONE
    background_core_dump          partial
    background_dump_dest          /raid/product/admin/IASDB/bdump
    backup_tape_io_slaves          FALSE
    bitmap_merge_area_size          1048576
    blank_trimming               FALSE
    buffer_pool_keep
    buffer_pool_recycle
    circuits
    cluster_database          FALSE
    cluster_database_instances     1
    cluster_interconnects
    commit_point_strength          1
    compatible               10.1.0.2.0
    control_file_record_keep_time     7
    control_files               /raid/product/oradata/IASDB/control01.ctl, /raid/product/oradata/IASDB/control02
                        .ctl, /raid/product/oradata/IASDB/control03.ctl
    core_dump_dest               /raid/product/admin/IASDB/cdump
    cpu_count               2
    create_bitmap_area_size      8388608
    create_stored_outlines
    cursor_sharing               EXACT
    cursor_space_for_time          FALSE
    db_16k_cache_size          0
    db_2k_cache_size          0
    db_32k_cache_size          0
    db_4k_cache_size          0
    db_8k_cache_size          0
    db_block_buffers          0
    db_block_checking          FALSE
    db_block_checksum          TRUE
    db_block_size               8192
    db_cache_advice           ON
    db_cache_size               50331648
    db_create_file_dest
    db_create_online_log_dest_1
    db_create_online_log_dest_2
    db_create_online_log_dest_3
    db_create_online_log_dest_4
    db_create_online_log_dest_5
    db_domain               bizmatch.com.cn
    db_file_multiblock_read_count     16
    db_file_name_convert
    db_files               200
    db_flashback_retention_target     1440
    db_keep_cache_size          0
    db_name                IASDB
    db_recovery_file_dest          /raid/product/flash_recovery_area
    db_recovery_file_dest_size     2147483648
    db_recycle_cache_size          0
    db_unique_name               IASDB
    db_writer_processes          1
    dbwr_io_slaves               0
    ddl_wait_for_locks          FALSE
    dg_broker_config_file1          /raid/product/OraHome_1/dbs/dr1IASDB.dat
    dg_broker_config_file2          /raid/product/OraHome_1/dbs/dr2IASDB.dat
    dg_broker_start           FALSE
    disk_asynch_io               TRUE
    dispatchers               (PROTOCOL=TCP)(PRE=oracle.aurora.server.GiopServer), (PROTOCOL=TCP)(PRE=oracle.a
                        urora.server.SGiopServer)
    distributed_lock_timeout     60
    dml_locks               1760
    drs_start               FALSE
    enqueue_resources          1980
    event
    fal_client
    fal_server
    fast_start_io_target          0
    fast_start_mttr_target          0
    fast_start_parallel_rollback     LOW
    file_mapping               FALSE
    fileio_network_adapters
    filesystemio_options          none
    fixed_date
    gc_files_to_locks
    gcs_server_processes          0
    global_context_pool_size
    global_names               FALSE
    hash_area_size               131072
    hi_shared_memory_address     0
    hs_autoregister           TRUE
    ifile
    instance_groups
    instance_name               IASDB
    instance_number           0
    instance_type               RDBMS
    java_max_sessionspace_size     0
    java_pool_size               67108864
    java_soft_sessionspace_limit     0
    job_queue_processes          5
    large_pool_size           8388608
    ldap_directory_access          NONE
    license_max_sessions          0
    license_max_users          0
    license_sessions_warning     0
    local_listener
    lock_name_space
    lock_sga               FALSE
    log_archive_config
    log_archive_dest
    log_archive_dest_1
    log_archive_dest_10
    log_archive_dest_2
    log_archive_dest_3
    log_archive_dest_4
    log_archive_dest_5
    log_archive_dest_6
    log_archive_dest_7
    log_archive_dest_8
    log_archive_dest_9
    log_archive_dest_state_1     enable
    log_archive_dest_state_10     enable
    log_archive_dest_state_2     enable
    log_archive_dest_state_3     enable
    log_archive_dest_state_4     enable
    log_archive_dest_state_5     enable
    log_archive_dest_state_6     enable
    log_archive_dest_state_7     enable
    log_archive_dest_state_8     enable
    log_archive_dest_state_9     enable
    log_archive_duplex_dest
    log_archive_format          %t_%s_%r.dbf
    log_archive_local_first      TRUE
    log_archive_max_processes     2
    log_archive_min_succeed_dest     1
    log_archive_start          FALSE
    log_archive_trace          0
    log_buffer               524288
    log_checkpoint_interval      0
    log_checkpoint_timeout          1800
    log_checkpoints_to_alert     FALSE
    log_file_name_convert
    logmnr_max_persistent_sessions     1
    max_commit_propagation_delay     0
    max_dispatchers
    max_dump_file_size          UNLIMITED
    max_enabled_roles          150
    max_shared_servers
    nls_calendar
    nls_comp
    nls_currency
    nls_date_format
    nls_date_language
    nls_dual_currency
    nls_iso_currency
    nls_language               AMERICAN
    nls_length_semantics          BYTE
    nls_nchar_conv_excp          FALSE
    nls_numeric_characters
    nls_sort
    nls_territory               AMERICA
    nls_time_format
    nls_time_tz_format
    nls_timestamp_format
    nls_timestamp_tz_format
    object_cache_max_size_percent     10
    object_cache_optimal_size     102400
    olap_page_pool_size          0
    open_cursors               300
    open_links               4
    open_links_per_instance      4
    optimizer_dynamic_sampling     2
    optimizer_features_enable     10.1.0.5
    optimizer_index_caching      0
    optimizer_index_cost_adj     100
    optimizer_mode               ALL_ROWS
    os_authent_prefix          ops$
    os_roles               FALSE
    parallel_adaptive_multi_user     TRUE
    parallel_automatic_tuning     FALSE
    parallel_execution_message_size 2148
    parallel_instance_group
    parallel_max_servers          40
    parallel_min_percent          0
    parallel_min_servers          0
    parallel_server           FALSE
    parallel_server_instances     1
    parallel_threads_per_cpu     2
    pga_aggregate_target          33554432
    plsql_code_type           INTERPRETED
    plsql_compiler_flags          INTERPRETED, NON_DEBUG
    plsql_debug               FALSE
    plsql_native_library_dir
    plsql_native_library_subdir_count 0
    plsql_optimize_level          2
    plsql_v2_compatibility          FALSE
    plsql_warnings               DISABLE:ALL
    pre_page_sga               FALSE
    processes               150
    query_rewrite_enabled          TRUE
    query_rewrite_integrity      enforced
    rdbms_server_dn
    read_only_open_delayed          FALSE
    recovery_parallelism          0
    remote_archive_enable          true
    remote_dependencies_mode     TIMESTAMP
    remote_listener
    remote_login_passwordfile     EXCLUSIVE
    remote_os_authent          FALSE
    remote_os_roles           FALSE
    replication_dependency_tracking TRUE
    resource_limit               FALSE
    resource_manager_plan
    resumable_timeout          0
    rollback_segments
    serial_reuse               disable
    service_names               IASDB.bizmatch.com.cn
    session_cached_cursors          0
    session_max_open_files          10
    sessions               400
    sga_max_size               281018368
    sga_target               0
    shadow_core_dump          partial
    shared_memory_address          0
    shared_pool_reserved_size     7549747
    shared_pool_size          150994944
    shared_server_sessions
    shared_servers               1
    skip_unusable_indexes          TRUE
    smtp_out_server
    sort_area_retained_size      0
    sort_area_size               65536
    sp_name                IASDB
    spfile                    /raid/product/OraHome_1/dbs/spfileIASDB.ora
    sql92_security               FALSE
    sql_trace               FALSE
    sql_version               NATIVE
    sqltune_category          DEFAULT
    standby_archive_dest          ?/dbs/arch
    standby_file_management      MANUAL
    star_transformation_enabled     FALSE
    statistics_level          TYPICAL
    streams_pool_size          0
    tape_asynch_io               TRUE
    thread                    0
    timed_os_statistics          0
    timed_statistics          TRUE
    trace_enabled               TRUE
    tracefile_identifier
    transactions               440
    transactions_per_rollback_segment 5
    undo_management           AUTO
    undo_retention               900
    undo_tablespace           UNDOTBS1
    use_indirect_data_buffers     FALSE
    user_dump_dest               /raid/product/admin/IASDB/udump
    utl_file_dir
    workarea_size_policy          AUTO
    All Portal DBMS jobs
    JOB LOG_USER          PRIV_USER     SCHEMA_USER
         17 PORTAL          PORTAL          PORTAL
         18 PORTAL          PORTAL          PORTAL
         27 PORTAL          PORTAL          PORTAL
         28 PORTAL          PORTAL          PORTAL
         43 PORTAL          PORTAL          PORTAL
    Details of all Portal DBMS jobs
    JOB WHAT
         17 begin execute immediate     'begin wwctx_sso.cleanup_sessions(
         p_hours_old => 168     ); end;'     ; exception     when others then
         null; end;
         18 wwsec_api_private.rename_users;
         27 wwv_context.sync;
         28 wwv_context.optimize(CTX_DDL.OPTLEVEL_FULL,1440,null);
         43 begin execute immediate     'begin wwutl_cache_sys.process_background_inv
         al;     end;'     ; exception     when others then     wwlog_api.log(p_
         domain=>'utl',     p_subdomain=>'cache',          p_name=>'background
         ',          p_action=>'process_background_inval',      p_information =
         > 'Error in process_background_inval '||          sqlerrm);end;
    Database version details
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.2 - Prod
    PL/SQL Release 10.1.0.4.2 - Production
    CORE     10.1.0.4.0     Production
    TNS for Linux: Version 10.1.0.4.0 - Production
    NLSRTL Version 10.1.0.4.2 - Production
    # Ending outer script: prechk/upshoset, 1.83 seconds
    ### Log invalid DB objects in the temporary directory.
    List count of invalid objects in the database in /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/dbinvob1.log
    Running upg/frwk/dbinvobj.sqlPortal SQL script started at Wed Oct 18 21:22:26 2006
    Connected.
    ### Install Schema Validation Utility
    Running upg/common/prechk/svuver.sql . Portal SQL script started at Wed Oct 18 21:22:26 2006
    Connected.
    # Beginning outer script: prechk/svuver
    #-- Beginning inner script: prechk/svuver
    # Portal Schema Version = 10.1.2.0.2
    # Version of schema validation utility being installed = 101202
    # Load the Schema Validation Utility
    Installed version of schema validation utility: 10.1.2.0.6
    Schema Validation Utility version: 10.1.2.0.6 will be installed.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    No errors.
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_SCHEMA_COMMON:
    44/9     PL/SQL: Statement ignored
    44/16     PLS-00905: object PORTAL.WWSBR_SITE_DB is invalid
    70/9     PL/SQL: Statement ignored
    70/17     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    96/10     PL/SQL: Statement ignored
    96/18     PLS-00905: object PORTAL.WWV_THINGDB is invalid
    122/10     PL/SQL: Statement ignored
    122/18     PLS-00905: object PORTAL.WWV_THINGDB is invalid
    No errors.
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_ATTR_VALIDATION:
    740/9     PL/SQL: SQL Statement ignored
    778/26     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_PAGE_GROUP_VALIDATION:
    366/9     PL/SQL: SQL Statement ignored
    372/31     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1447/13 PL/SQL: SQL Statement ignored
    1458/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1624/13 PL/SQL: SQL Statement ignored
    1635/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1783/13 PL/SQL: SQL Statement ignored
    1794/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1896/13 PL/SQL: SQL Statement ignored
    1907/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    2009/13 PL/SQL: SQL Statement ignored
    2020/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    2126/13 PL/SQL: SQL Statement ignored
    2137/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    No errors.
    No errors.
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_PAGE_VALIDATION:
    137/9     PL/SQL: SQL Statement ignored
    144/53     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    258/21     PL/SQL: SQL Statement ignored
    260/43     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    277/17     PL/SQL: SQL Statement ignored
    279/39     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    322/9     PL/SQL: SQL Statement ignored
    327/25     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    353/25     PL/SQL: Statement ignored
    353/40     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    362/29     PL/SQL: SQL Statement ignored
    369/42     PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
         invalid state
    376/33     PL/SQL: Statement ignored
    376/48     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    385/21     PL/SQL: SQL Statement ignored
    388/39     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1214/21 PL/SQL: SQL Statement ignored
    1216/42 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    1262/9     PL/SQL: SQL Statement ignored
    1266/30 PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
         invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_REGION_VALIDATION:
    237/9     PL/SQL: SQL Statement ignored
    249/41     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_STYLE_VALIDATION:
    414/9     PL/SQL: SQL Statement ignored
    424/44     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    584/21     PL/SQL: Statement ignored
    584/52     PLS-00905: object PORTAL.WWSBR_SITE_DB is invalid
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_THING_VALIDATION:
    2129/32 PL/SQL: Item ignored
    2130/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2131/32 PL/SQL: Item ignored
    2132/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2133/32 PL/SQL: Item ignored
    2134/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2135/31 PL/SQL: Item ignored
    2136/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2137/31 PL/SQL: Item ignored
    2138/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2139/31 PL/SQL: Item ignored
    2140/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    2151/32 PL/SQL: Item ignored
    2151/42 PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
    2152/32 PL/SQL: Item ignored
    2152/42 PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
    2153/32 PL/SQL: Item ignored
    2153/42 PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
    2202/17 PL/SQL: SQL Statement ignored
    2212/27 PL/SQL: ORA-06575: Package or function WWSBR_THING_TYPES is in an
         invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_ITEM_VALIDATION:
    322/9     PL/SQL: SQL Statement ignored
    338/30     PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
         invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_PORTLET_VALIDATION:
    155/13     PL/SQL: SQL Statement ignored
    163/36     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    170/13     PL/SQL: SQL Statement ignored
    178/36     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
         invalid state
    459/9     PL/SQL: SQL Statement ignored
    467/31     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
         is in an invalid state
    581/9     PL/SQL: SQL Statement ignored
    584/21     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
         is in an invalid state
    588/9     PL/SQL: SQL Statement ignored
    591/29     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
         is in an invalid state
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY WWUTL_DBPROV_VALIDATION:
    341/25     PL/SQL: Item ignored
    341/45     PLS-00302: component 'URL' must be declared
    559/17     PL/SQL: Statement ignored
    559/17     PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
    562/17     PL/SQL: Statement ignored
    564/40     PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
    No errors.
    No errors.
    ### Invoke Schema Validation Utility in Report Mode
    Running upg/common/prechk/../../frwk/svurun.sql . Portal SQL script started at Wed Oct 18 21:22:31 2006
    Connected.
    # Beginning outer script: prechk/svurun
    #-- Beginning inner script: frwk/svurun
    declare
    ERROR at line 1:
    ORA-20000:
    ORA-06512: at "PORTAL.WWPOF", line 440
    ORA-06512: at line 45
    ORA-20000:
    ORA-06512: at "PORTAL.WWPOF", line 440
    ORA-06512: at "PORTAL.WWUTL_SCHEMA_VALIDATION", line 263
    ORA-04063: package body "PORTAL.WWUTL_PAGE_GROUP_VALIDATION" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    Connected.
    # Run the report mode of the schema validation utility
    #---- Beginning inner script: wwutl_schema_validation.validate_all
    # Running the validation in report mode
    # Schema Validation Utility Version = 10.1.2.0.6
    # Validate Page Groups
    # Handling exception
    # ERROR: When executing schema validation utility
    # ERROR: ORA-06508: PL/SQL: could not find program unit being called
    # ----- PL/SQL Call Stack -----
    object line object
    handle number name
    0x5c4fef28     434 package body PORTAL.WWPOF
    0x5bb96e20     263 package body PORTAL.WWUTL_SCHEMA_VALIDATION
    0x5bb96e20     297 package body PORTAL.WWUTL_SCHEMA_VALIDATION
    0x5b885fe4     18 anonymous block
    # Handling exception
    # ERROR: When running the schema validation utility
    # ERROR: ORA-20000:
    ORA-06512: at "PORTAL.WWPOF", line 440
    ORA-06512: at "PORTAL.WWUTL_SCHEMA_VALIDATION", line 263
    ORA-04063: package body "PORTAL.WWUTL_PAGE_GROUP_VALIDATION" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    # ----- PL/SQL Call Stack -----
    object line object
    handle number name
    0x5c4fef28     434 package body PORTAL.WWPOF
    0x5b885fe4     45 anonymous block
    ### ERROR: Exception Executing upg/common/prechk/../../frwk/svurun.sql REPORT PRECHK for Subscriber: 1
    ### Check Failed at Wed Oct 18 21:22:31 2006 Continuing as PreCheck mode is specified
    ### PHASE 5: Version specific user inputs
    Upgrade phase started at Wed Oct 18 21:22:31 2006
    Processing Metadata File: upg/10140/inputchk/inputchk.met ###
    ### PHASE 6: Version specific pre upgrade checks
    Upgrade phase started at Wed Oct 18 21:22:31 2006
    Processing Metadata File: upg/10140/prechk/prechk.met ###
    ### PHASE 7: Pre upgrade common information gathering
    Upgrade phase started at Wed Oct 18 21:22:31 2006
    Processing Metadata File: upg/common/info/info.met ### Log portal configuration info in the temporary directory.
    Running upg/common/info/ptlinfo.sql . Portal SQL script started at Wed Oct 18 21:22:31 2006
    Connected.
    # Beginning outer script: info/ptlinfo
    # Ending outer script: info/ptlinfo, 0.13 seconds
    Metadata File upg/10140/info/info.met does not exist.
    ### PHASE 8: Verify user inputs
    Upgrade phase started at Wed Oct 18 21:22:32 2006
    Processing Metadata File: upg/common/verfyinp/verfyinp.met Running upg/common/verfyinp/verfyinp.pl The following details have been determined:
    General Details
    ===========================================================
    Log File Name : /raid/product/OraHome_1/upgrade/temp/portal/precheck.log
    RDBMS Version : 10.1.0
    Product Version : 10.1.2.0.2
    Oracle PL/SQL Toolkit Schema : SYS
    Oracle PL/SQL Toolkit version : 10.1.2.0.2
    O7 accessibility : FALSE
    Schema Details
    ===========================================================
    Name : portal
    Connect String : (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=portaldb.bizmatch.com.cn)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=IASDB.bizmatch.com.cn)))
    Tablespace Details
    ===========================================================
    Default Tablespace : PORTAL
    Temporary Tablespace : TEMP
    Document Tablespace : PORTAL_DOC
    Logging Tablespace : PORTAL_LOG
    Index Tablespace : PORTAL
    ### ERROR: WWU-00030: Pre-Check mode encountered the following errors:
    ### 184 : ### ERROR: WWU-00013: Tables with UPG_ prefix were found in the OracleAS Portal
    ### 706 : 44/16     PLS-00905: object PORTAL.WWSBR_SITE_DB is invalid
    ### 708 : 70/17     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    ### 710 : 96/18     PLS-00905: object PORTAL.WWV_THINGDB is invalid
    ### 712 : 122/18     PLS-00905: object PORTAL.WWV_THINGDB is invalid
    ### 719 : 778/26     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 727 : 372/31     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 731 : 1458/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 735 : 1635/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 739 : 1794/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 743 : 1907/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 747 : 2020/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 751 : 2137/28 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 761 : 144/53     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 765 : 260/43     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 769 : 279/39     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 773 : 327/25     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 777 : 353/40     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    ### 779 : 369/42     PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
    ### 783 : 376/48     PLS-00905: object PORTAL.WWPOB_API_PAGE is invalid
    ### 785 : 388/39     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 789 : 1216/42 PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 793 : 1266/30 PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
    ### 801 : 249/41     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 809 : 424/44     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 813 : 584/52     PLS-00905: object PORTAL.WWSBR_SITE_DB is invalid
    ### 819 : 2130/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 821 : 2132/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 823 : 2134/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 825 : 2136/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 827 : 2138/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 829 : 2140/13 PLS-00905: object PORTAL.WWSBR_THING_TYPES is invalid
    ### 831 : 2151/42 PLS-00320: the declaration of the type of this expression is
    ### 835 : 2152/42 PLS-00320: the declaration of the type of this expression is
    ### 839 : 2153/42 PLS-00320: the declaration of the type of this expression is
    ### 843 : 2212/27 PL/SQL: ORA-06575: Package or function WWSBR_THING_TYPES is in an
    ### 851 : 338/30     PL/SQL: ORA-06575: Package or function WWPOB_API_PAGE is in an
    ### 859 : 163/36     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 863 : 178/36     PL/SQL: ORA-06575: Package or function WWSBR_SITE_DB is in an
    ### 867 : 467/31     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
    ### 871 : 584/21     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
    ### 875 : 591/29     PL/SQL: ORA-06575: Package or function WWSBR_SITEBUILDER_PROVIDER
    ### 883 : 341/45     PLS-00302: component 'URL' must be declared
    ### 885 : 559/17     PLS-00320: the declaration of the type of this expression is
    ### 889 : 564/40     PLS-00320: the declaration of the type of this expression is
    ### 904 : ERROR at line 1:
    ### 905 : ORA-20000:
    ### 906 : ORA-06512: at "PORTAL.WWPOF", line 440
    ### 907 : ORA-06512: at line 45
    ### 908 : ORA-20000:
    ### 909 : ORA-06512: at "PORTAL.WWPOF", line 440
    ### 910 : ORA-06512: at "PORTAL.WWUTL_SCHEMA_VALIDATION", line 263
    ### 911 : ORA-04063: package body "PORTAL.WWUTL_PAGE_GROUP_VALIDATION" has errors
    ### 912 : ORA-06508: PL/SQL: could not find program unit being called
    ### 922 : # ERROR: When executing schema validation utility
    ### 923 : # ERROR: ORA-06508: PL/SQL: could not find program unit being called
    ### 933 : # ERROR: When running the schema validation utility
    ### 934 : # ERROR: ORA-20000:
    ### 935 : ORA-06512: at "PORTAL.WWPOF", line 440
    ### 936 : ORA-06512: at "PORTAL.WWUTL_SCHEMA_VALIDATION", line 263
    ### 937 : ORA-04063: package body "PORTAL.WWUTL_PAGE_GROUP_VALIDATION" has errors
    ### 938 : ORA-06508: PL/SQL: could not find program unit being called
    ### 947 : ### ERROR: Exception Executing upg/common/prechk/../../frwk/svurun.sql REPORT PRECHK for Subscriber: 1
    ### Check Failed at Wed Oct 18 21:22:32 2006 Continuing as PreCheck mode is specified
    Pre-Check Completed at Wed Oct 18 21:22:32 2006

    Hi,
    Its good that u pasted the complete log file. In your environment you have to run this upgrade tool only once from any of the middle tier.
    And with respect to your error that u got in precheck is quite simple. All u have to do is just run this script from by connecting to portal schema using sqlplus.
    Run dropupg.sql
    Location-------- /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/dropupg.sql
    Later you re-run the upgrade tool and let me know the status.
    Good luck
    Tanmai

  • Index vs Full Scan - Parallelism

    Hi everyone, i have an problem my scenario is a plataform Linux x64 bits in RAC 10gR2 (10.2.0.5) and we are migrating to RAC 11gR2 (11.2.0.3.3) in AIX 7.1 and my query: Update movimientos set ESTADOENCOLADO = :"SYS_B_0" where tipoproceso = :"SYS_B_1" and ESTADOENCOLADO = :"SYS_B_2"; in my Oracle 10g uses an index in the table MOVIMIENTOS and in the Oracle 11g the optimizer takes a FULL SCAN.
    In both database server the statistics are updated with estimate 100% even the system statistics, fixed tables and data dictionary are taken its statistics.
    I review the cost in both plans in Oracle 11g (with a full scan and other using a hint to index) and the full scan plan has less cost that the index. My db_file_multiblock_read_count is not set up, but in the Oracle 10g i see a value of 16 and in the 11g i see a value dinamic of 192. Understand that it too helps an uses a full scan.
    The problem is that the query taken in Oracle 10g 20 minutes, but in the Oracle 11g with full scan 1.4 h whereas with a hint takes too 20 minutes.
    I use the advisor tuning and no recommendations.
    So basicaly i fix it modifily my parameter optimizer_index_cost_adj to 80 and it works well.
    My doubt is why Oracle11gR2 says me that a full scan is faster than take an index when in the real live it is not working in this mode. I need some posible reasons please.
    Thank you very much if somebody can help me with some tip or idea.
    Regards

    >
    My doubt is why Oracle11gR2 says me that a full scan is faster than take an index when in the real live it is not working in this mode. I need some posible reasons please.
    >
    Well if you can't figure it out by looking at the plans what makes you think anyone can figure it out without looking at them?
    We have no idea what the plans contain. Post the plans, record counts for the table(s) involved, record counts for any filter predicates and the other information needed. See the FAQ for how to post a tuning request and the information needed.

Maybe you are looking for

  • I'm trying to erase everything but it's been loading all day. Help pls

    Hi, I'm trying to erase everything from my iPhone so I can sell it and I selected the erase and everything (I know I sound very technical) and after clicking confirm the black screen with the white spinning circle came on. I left it for a couple of h

  • Tabbed Pane help

    Thanks everyone for the help in the past. I am on to a new section of the program that i am writing and after searching the web and these forums for several hours i am still at a loss. I have a jtabbedpane that i want to add and remove tabs when the

  • Sony DCR-PC1000 Connects and Imports, But No Sound

    My Sony MiniDV camera connects and imports to iMovie, but the import has no sound. Does anyone know how to get sound to import also?

  • Camcorder time/date stamp not working

    I am working on a new movie. I loaded about 20 minutes of raw mini DV from my camcorder, and it loaded onto the clips plane just fine. I wanted to add a second tape, made on the same camcorder at a slightly later date, but this tape does not change c

  • [SOLVED] Quarkcoin-qt, PKGBUILD created

    Hi, I have just created the PKGBUILD, .install, and .desktop files for Quarkcoin-qt. I modified the PKGBUILD for Litecoin and adapted it for Quark. It worked for me. If someone with the permissions want to upload it to the AUR, Here is the code: PKGB