Ordered hints in Oracle:

There's a fairly popular Ordered Hint example on the web as follows:
<CODE>
select /*+ ordered use_nl(bonus) parallel(e, 4) */
e.ename,
hiredate,
b.comm
from
emp e,
bonus b
where
e.ename = b.ename
</CODE>
I would like to know what the "parallel(e, 4)" clause does. Where does the "4" come from? What is "parallel" here?
I also have another question: If I have 5 tables--T_OREGON, T_UTAH, T_VIRGINIA, T_TEXAS, and T_OKLAHOMA--lined up in a join right behind a FROM, coming in at row counts of
T_OREGON: [a lot of rows; a lot more than T_UTAH]
T_UTAH: [smaller than T_OREGON] 40550 rows
T_VIRGINIA: 14 rows
T_TEXAS: 66 rows
T_OKLAHOMA: 8 rows
like so:
...from T_OREGON or, T_UTAH ut, T_VIRGINIA va, T_TEXAS tx, T_OKLAHOMA ok...
my question is, if an Ordered hint can be used here, is it that the smallest table (in this case T_OKLAHOMA) gets placed first in the join and the rest of the table ascension in the join doesn't matter? Or is it that T_OKLAHOMA gets placed first in the join, followed by T_VIRGINIA [at 14 rows], followed by T_TEXAS, T_UTAH, and finally T_OREGON?
Thank you for any help that you can provide.

It is why my other question involved the table order
behind a FROM keyword, (when employing an Ordered
hint).
Can anybody help with that question? Thanks again.With rule based optimizer order was important.
With cost based optimizer (optimizer mode one of the all_rows, first_rows, forst_rows_n) order is not important Oracle itself chooses the order how to join tables.
If you have gathered statistics leave CBO do his work. See more about optimizer here http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm
And if you have taken this citation out of http://articles.techrepublic.com.com/5100-22_11-1050199.html then there are at least following problems:
1) article is 4 years old
2) article doesn't say anything about downsides using this hint e.g. what if your data changes and order is not relevant anymore, quite high possibility that query is changed but hint forgotten to change, maintaining additional level of complexity where Oracle has invested many many resources to assist users enhancing CBO
3) and there is at least 1 fallacy in this article these sentences are wrong:
"When Oracle evaluates table join orders, it must consider every possible combination of tables. For example, a six-way table join has 720 (permutations of 6, or 6 * 5 * 4 * 3 * 2 * 1 = 720) possible ways that the tables can be joined together. This permutation issue becomes even more pronounced when you have more than 10 joined tables in a query: For a 15-way table join, there are over one trillion (1,307,674,368,000 to be exact) possible query permutations that must be evaluated."
(emphasis is mine - Gints)
CBO abandons each permutation as soon as the cost is higher than the smallest from previous steps. So in reality CBO is much smarter than article tries to explain.
If you really want to know how CBO works then I can only suggest to get book Cost based oracle fundamentals by Jonathan Lewis.
Gints Plivna
http://www.gplivna.eu

Similar Messages

  • ORDERED hint in Oracle 11gR2

    Do we have any difference in 11g with the way /*+ ORDERED */ hint works, compared to 10g? Will this hint cause a plan change in 11g, compared to its plan when used in 10g (assuming no other items contribute to a change of plan)?

    Welcome to the forum.
    Do you mean 10.1 or 10.2 and 11.1 or 11.2?
    Are you aware of the existence of http://tahiti.oracle.com?
    Just test it, follow these instructions:
    http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
    SQL and PL/SQL FAQ

  • Question on Ordered Hint

    oracle 10g
    hi all i attended an interview yesterday and i interviewer asked me a couple of questions
    For which i dont have an exact answer. i even tried to search on web but i couldn't find the answer.
    1. The ordered  hint is used in conjunction with what?  and why?.
       i explained what ordered hint is but he is not happy.
    2. performance of analytical function vs query with sub-query .
    i voted for analytical function, interviewer said that analytical functions are slow.please help me to find answers.
    thanks
    Edited by: new learner on Jul 30, 2010 7:17 AM

    new learner wrote:
    thanks for the response.
    why do we need to use other hints in conjunction with ordered hint for ordered hint to work.
    why cant i say
    Select /*+ordered*/
    from table_a a , table_b b
    where a.id = b.id ;
    To expand on Dom's comment, you can say it, but if you're going to try to dictate details like this to the optimizer you should also tell it what join method you expect it to use, and what access methods you expect it to use, e.g.
    /*+ ordered full(a) use_nl(b) index(b (id)) */Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
    +"Science is more than a body of knowledge; it is a way of thinking"+
    +Carl Sagan+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Ordered hint question

    Hi all, I have query, in ap_payselect app engine, which is taking a lot of time to execute. so i used ordered hint (/*+ ORDERED */).
    My question is, will that ordered hint change the result? will we get same result with ordered hint as it was with out ordered hint.
    Please help me.
    Thank you.

    The ORDERED hint won't change the result, that will remain the same. Only the explain plan (it is how Oracle will process the query behind the scene) and maybe the execution time could change (faster or slower).
    Find out more:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#sthref659
    Nicolas.

  • Performace problem - and ORDERED hint

    Hello,
    The following query is from oracle application EBS 11i , running on 10203 instance.
    Its take about 28 hour before its finished.
    Its exection plan is very long about 150 lines.
    In order to keep it simple i pasted only the first 35 rows from the ORIGINAL plan.
    Id number 34 bellow shows that the unique index :"HZ_PARTIES_U1" fetched each and every row from the table (1,751,000 rows).
    |  34 | ===============>       INDEX UNIQUE SCAN           | HZ_PARTIES_U1                |  1751K
    SELECT * FROM TABLE(dbms_xplan.display_awr('9r0jrz9ygpt9f'));
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    SQL_ID 9r0jrz9ygpt9f                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    SELECT /*+ index(ap_bank_accounts)   */ TRX_ID, ROW_ID, TRX_NUMBER, AMOUNT
    FROM CE_222_TRANSACTIONS_V
    WHERE BANK_ACCOUNT_ID = :B8 AND CURRENCY_CODE = :B7 AND (:B6 IN ('CREDIT','NSF','REJECTED') OR TRX_TYPE = 'MISC')
    AND DECODE(:B6 , 'MISC_DEBIT', -1, 1) * AMOUNT BETWEEN :B2 * (1 - :B5 )
    AND :B2 * (1 + :B5 )
    AND TRX_DATE BETWEEN (:B1 - :B4 )
    AND (:B1 + :B3 )
    AND NOT EXISTS ( SELECT 'already matched trx' FROM IL_CE_REC WHERE TRX_ROWID = ROW_ID)
    ORDER BY ABS(:B2 -  AMOUNT), ABS(:B1 - TRX_DATE)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    Plan hash value: 1193373660                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    | Id  | Operation                                          | Name                         | Rows  | Bytes | Cost (%CPU)| Time     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   0 | SELECT STATEMENT                                   |                              |       |       | 23321 (100)|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   1 |  SORT ORDER BY                                     |                              |     3 |   228 | 23321  (16)| 00:01:02 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   2 |   NESTED LOOPS ANTI                                |                              |     3 |   228 | 23320  (16)| 00:01:02 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   3 |    VIEW                                            | CE_222_TRANSACTIONS_V        |     3 |   192 | 23320  (16)| 00:01:02 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   4 |     UNION-ALL                                      |                              |       |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   5 |      FILTER                                        |                              |       |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   6 |       FILTER                                       |                              |       |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   7 |        NESTED LOOPS                                |                              |     1 |   395 | 11668  (16)| 00:00:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   8 |         NESTED LOOPS OUTER                         |                              |     1 |   359 | 11667  (16)| 00:00:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |   9 |          NESTED LOOPS OUTER                        |                              |     1 |   323 | 11666  (16)| 00:00:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  10 |           FILTER                                   |                              |       |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  21 |                      HASH JOIN                     |                              |     1 |   150 | 11648  (16)| 00:00:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  22 |                       NESTED LOOPS                 |                              |     1 |    54 |     4   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  23 |                        NESTED LOOPS                |                              |     1 |    18 |     2   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  24 |                         TABLE ACCESS BY INDEX ROWID| AP_BANK_ACCOUNTS_ALL         |     1 |    13 |     2   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  25 |                          INDEX UNIQUE SCAN         | AP_BANK_ACCOUNTS_U1          |     1 |       |     1   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  26 |                         INDEX UNIQUE SCAN          | AP_BANK_BRANCHES_U1          |  2022 | 10110 |     0   (0)|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  27 |                        INDEX RANGE SCAN            | FND_LOOKUP_VALUES_U1         |     1 |    36 |     2   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  28 |                       TABLE ACCESS BY INDEX ROWID  | AR_CASH_RECEIPTS_ALL         |     1 |    96 | 11643  (16)| 00:00:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  29 |                        INDEX RANGE SCAN            | AR_CASH_RECEIPTS_N8          |   211K|       |   882  (18)| 00:00:03 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  30 |                      VIEW PUSHED PREDICATE         | RA_HCUSTOMERS                |     1 |    15 |     4   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  31 |                       NESTED LOOPS                 |                              |     1 |    24 |     4   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  32 |                        TABLE ACCESS BY INDEX ROWID | HZ_CUST_ACCOUNTS             |     1 |    18 |     3   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  33 |                         INDEX UNIQUE SCAN          | HZ_CUST_ACCOUNTS_U1          |     1 |       |     2   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  34 | ===============>       INDEX UNIQUE SCAN           | HZ_PARTIES_U1                |  1751K|    10M|     1   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    |  35 |                     TABLE ACCESS BY INDEX ROWID    | AR_RECEIPT_METHODS           |     1 |     8 |     1   (0)| 00:00:01 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     When i added an ORDERED hint inside the view the plan changed as followed:
    |  30 |                      VIEW PUSHED PREDICATE         | RA_HCUSTOMERS                |     1 |    15 |     4   (0)| 00:00:01 |
    |  31 |                       NESTED LOOPS                 |                              |     1 |    24 |     4   (0)| 00:00:01 |
    |  32 |                        TABLE ACCESS BY INDEX ROWID | HZ_CUST_ACCOUNTS             |     1 |    18 |     3   (0)| 00:00:01 |
    |* 33 |                         INDEX UNIQUE SCAN          | HZ_CUST_ACCOUNTS_U1          |     1 |       |     2   (0)| 00:00:01 |
    |* 34 |  ==============>       INDEX UNIQUE SCAN           | HZ_PARTIES_U1                |     1 |     6 |     1   (0)| 00:00:01 |
    |* 35 |                     INDEX UNIQUE SCAN              | FND_LOOKUP_VALUES_U1         |     1 |    36 |     1   (0)| 00:00:01 |
    You can see that line 34 is now return just 1 row and not 1751K rows.Oracle documentaion : http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm said:
    You might want to use the ORDERED hint to specify a join order if you know something about the number of rows selected
    from each table that the optimizer does not.
    Since , i dont want to use the ORDERED hint , i would like to know what statistics information are missing to the optimizer ? What should i look for ?
    I have an uptodate statiscts , and bellow are the resoults .
    SQL> select table_name,last_analyzed,num_rows,blocks
      2  from dba_tables
      3  where table_name='HZ_PARTIES';
    TABLE_NAME                     LAST_ANAL   NUM_ROWS     BLOCKS
    HZ_PARTIES                     06-JUN-10    1760190      65325
    SQL>
    SQL>
    SQL> select count(*) from apps.HZ_PARTIES;
      COUNT(*)
       1771794
    SQL> select index_name,last_analyzed,num_rows,clustering_factor,blevel,distinct_keys
      2  from dba_indexes
      3  where table_name='HZ_PARTIES'
      4  and index_name like '%U1';
    INDEX_NAME                     LAST_ANAL   NUM_ROWS CLUSTERING_FACTOR     BLEVEL DISTINCT_KEYS
    HZ_PARTIES_U1                  06-JUN-10    1758162            158739          2       1758162Thanks for your help

    Nothing I can see in your in your post relates to the optimizer and you, yourself, wrote:
    Oracle documentaion : http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm  said:
    You might want to use the ORDERED hint
    {code}
    so clearly the Oracle documentation does say that.
    Either post in the correct forum, and explain your reasoning, or I can not help you further.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can we use hints in oracle 11g version ?

    can we use hints in oracle 11g version ? is it working ??

    Why do you ask these questions? Have you looked at the SQL Reference Guide and Performance Tuning Guide for your Oracle version - both which covers using hints?
    Have you see a statement that is not supported? Or does not work?
    Or are you simply doing idle speculation and expecting forum members to spend their free time in answering a basic question where the answer is ridiculously simply to find?

  • Global Hints in oracle

    Hi all,
    Can any one please tell me what is Global Hints in oracle.
    i know normal hints usage.
    what is difference between normal hints and global hints.
    Thanks in Advance,
    Sanjeev.

    http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/hintsref.htm#PFGRF50104

  • Does the Order of the tablesjoins in Where clause matter in ORDERED hint?

    The ORDERED hint requests that the tables listed in the FROM clause of a SQL statement be joined in the order specified. But does the order of the join in "where" clause matters?
    Will be there any performance difference between below query? The order of the table in the FROM clause remains the same, but there is a difference in the order of conditions in the WHERE clause
    SELECT /*+ ORDERED */ a.fp_i f
    FROn iw_owner.revenue_fpct b,
    dw_owner.fp_dinn c,
    dw_owner.nanaged_at_dinn a,
    dw_owner.at_dinn_curr d,
    iw_owner.na_progran e,
    dw_owner.fp_dinn_curr f,
    dw_owner.fpn_of_at_dinn g
    WHERE a.nacc_dinn_i = b.nacc_dinn_i
    AND b.fp_dinn_i = c.fp_dinn_i
    AND a.acc_i = d.acc_i
    AND a.acc_nacc_c = e.npn_pro_c
    AND a.fp_i = f.fp_i
    AND b.org_fpn_dinn_i = g.org_fpn_dinn_i(+)
    AND c.fp_i IN ('JG 04')
    AND b.dte_dinn_i BETWEEN '1-Apr-2011' and '30-Apr-2011'
    SELECT /*+ ORDERED */ a.fp_i f
    FROn iw_owner.revenue_fpct b,
    dw_owner.fp_dinn c,
    dw_owner.nanaged_at_dinn a,
    dw_owner.at_dinn_curr d,
    iw_owner.na_progran e,
    dw_owner.fp_dinn_curr f,
    dw_owner.fpn_of_at_dinn g
    WHERE c.fp_i IN ('JG 04')
    AND b.dte_dinn_i BETWEEN '1-Apr-2011' and '30-Apr-2011'
    AND b.fp_dinn_i = c.fp_dinn_i
    AND a.nacc_dinn_i = b.nacc_dinn_i
    AND a.acc_i = d.acc_i
    AND a.acc_nacc_c = e.npn_pro_c
    AND a.fp_i = f.fp_i
    AND b.org_fpn_dinn_i = g.org_fpn_dinn_i(+)
    Thanks

    Gangadhar Reddy wrote:
    Does it matter the order of first 2 tables?This question makes me really wonder. It's fairly easy to see how explain changes when using hints.
    Your question indicates that you do not look at explain plans?
    Then why are you asking about hints in the first place?
    Using hints is something you do when you want to force a specific execution plan as part of some investigation, because you know something that the optimizer does no, or you have found a bug in the optimizert.
    In all cases you know exactly what you are doing.
    The /*+ ORDERED */ is all about you telling the optimizer to join the tables in the order you specified them in the from clause.
    As to your original question, there exists a similar ORDERED_PREDICATES hint.
    Regards
    Peter

  • To add order mgmnt in oracle crm ondemand

    is it possible to add order management in oracle crm ondemand? if it's could u pl tell me the steps involved
    mailid: [email protected]
    Edited by: user9005557 on Jan 19, 2010 4:31 AM

    There are couples of web services provided by oracle for this purpose, by using that you can insert, update, query, delete records in CRM OnDemand.
    So you need to write the web service client program which takes data from your web form and create record in OnDemand. It can be in any language / platform (like java, c++, PHP etc)
    Check web services guide for more details.
    Dinesh

  • LEADING or ORDERED hint in OWB 10gR2

    Hi,
    How does one add a LEADING or ORDERED hint to a mapping in OWB 10g R2?
    The usual way of adding a hint is to "Configure" the map and add the extraction or loading hint under the table (data source) operators. However, the hints in such a case are specific to table under consideration. A NO_INDEX or a PARALLEL hint can be applied under it.
    However, a LEADING or a ORDERED does not necessarily depend on the table but is common to the entire SQL. Although OWB allows attaching the LEADING or ORDERED hint under Map Configure > Table Operators > [Table Name] > Hints > Extraction Hints, it does not attach the correct table aliases.
    Has anyone encountered this problem before? If you've found a workaround, please share it.
    Thanks, JD

    Hi,
    In OWB 10.2 it's often not easy to set hints. Often it's only possible to set them correctly using workarounds :-(
    The most important is not where you define the hint in OWB but where OWB puts it in the generated code.
    So if you want to have the LEADIND or ORDERING hint in your code you could define it at the level of the target table under:
    Map Configure > Table Operators > [Target Table Name] > Hints > Loading Hints
    Another way to do it would be to generate a dummy filter (1=1) in the mapping and then to define the hint for this filter.
    For hints which are not related to a specific table I mostly used the trial-and-error method to find out where I have to define it in OWB.
    Good luck

  • /* + ordered */ hint used in relational cube operator

    We are using OWB 10.2.0.3 build a relational datamart. The mapping which loads the fact table has a joiner joining three tables, the result of the joiner goes into the cube operator. We realized that the code created by the cube operator contains the /* + ordered */ hint. This might make sense if you do not have any joiner outside the cube operator, but in our case the hint results into a sub-optimal explain plain.
    Has anyone any idea how to get rid of this hint? What is the reason for this hint?
    Thanks in advance, Maren

    Hi,
    if you open the configuration of the mapping, select cube operators, select your target cube, select table operators, selct your cube table -> what do you see in the property 'Loading hints'?
    Regards,
    Detlef

  • Order checking via Oracle Wireless

    Dear all;
    I was wondering is it possible to perform order checking thru Oracle 9i Wireless Application. I am currently in a project trying to develop a mobile application that can directly integrate with Oracle 11i E-Business Suite, eg: for order checking, inventory status, credit limit, etc.
    Please help. Would appreciate if u can direct me to where i cane get more technical information regarding this possibilities.
    thank;
    andrew, Malaysia

    Hi,
    Did you change the TNSNAMES.ORA file for DS? you have to add TNS entry to DS TNSNAMES.ORA file.
    Go to $DB_Default_Home$\netword\admin and open TNSNAMES.ORA file in notepad. Copy the tns entry from which you are connecting from SQL*plus.
    Go to $DS_Default_Home$\netword\admin and open TNSNAMES.ORA file in notepad. paste the tns entry you copied.
    Now try to connect from form builder.
    regards,
    Qasim Javaid

  • Prod Orders merge for oracle requirement

    Hi,
    Iu2019m a xi consultant. I need to know about Production Order processing.
    Iu2019ve to send sales orders (with multiple items) from oracle. And I need to get back the
    production orders back to oracle.
    Like:
    Sales order 1 header
    Sales order item1u2026
    Sales order item 2u2026
    Sales order 2 header
    Sales order item1u2026
    Sales order item 2u2026
    u2026.
    As per my understanding, for each sales order item, thereu2019ll be a production order in sap. If this is right, If I use Idoc LOIPRO, Iu2019ll get the individual production orders per every idoc. But I need to send the same way I get the data from Oracle.
    Like:
    Production order 1 header (with ref. to sales order 1 header)
    Production order item1u2026  (with ref. to sales order item 1 header)
    Production order item 2u2026 (with ref. to sales order item 2 header)
    Production order 2 header (with ref. to sales order 2 header)
    Production order item1u2026(with ref. to sales order item 1 header)
    Production order item 2u2026(with ref. to sales order item 2 header)
    u2026
    This is the requirement from customer side.
    Is it possible with standard Idoc LOIPRO?
    If yes, where I need to consolidate(merge) the individual IDocs to a single production order response to oracle?
    Is there any better approach?
    thanks
    zia

    Solved.

  • Append hint + ADO + Oracle OleDB Provider

    Hi everybody!
    This is my first post here in this great forum! ;-)
    I have a problem using Append hint with Oracle OleDB Provider and I've been searching internet for an answer without any luck.
    I'm trying to use Append hint with ADO + Oracle OleDB Provider (OraOLEDB.Oracle.1), like in the SQL below:
    INSERT /*+APPEND*/
    INTO my_table(field1, field2, field3)
    SELECT 0 field1, v.field2, v.field3)
    FROM my_second_table v
    The problem: Oracle is still creting log for this INSERT (It is working like there was no Append hint).
    If I use the same SQL statement with Microsoft Ole DB Provider for Oracle, the Append hint works as expected (log is not created), but doesn't work at all with Oracle DB Provider.
    Trace shows me that the SQL sentence is ok (the append hint is there!).
    I've tried Oracle servers 9.2 and/or 10g, and the problem is the same.
    Question: Does Append hint work with Oracle OleDB Provider? If yes, why it is not working? Something related with connection properties?
    Any help will be much appreciated!
    Thanks in advance.
    Alexandre Machado

    user8010279 wrote:
    Hi Solomon, thanks for you answer.
    Is the same SQL against the same database, with the same program, using ADO + OleDB Provider.
    The table is in NOLOGGING mode.
    When I use Microsoft OleDB Provider for Oracle there is no log creation. Then I disconnect and reconnect to the same server/database, using Oracle OleDB Provider. Then I execute the same SQL and.... there IS log creation, meaning that in that scenario, append hint is being ignored. I can't figure out WHY!!! :-(
    Alexandre,
    I'm not sure what you mean by "there is log creation". In general you need to distinguish between UNDO and REDO generation. A direct-path insert (APPEND hint) doesn't generate undo but still can generate redo, depending on the ARCHIVELOG / FORCE LOGGING mode of the tablespace resp. database and the LOGGING/NOLOGGING attribute of the table.
    Note that in case indexes exist on the table there will always be undo and therefore redo generation for the index maintenance as part of the direct-path insert.
    You should check V$SESSION (SQL_ID in 10g, SQL_ADDRESS + SQL_HASH_VALUE in pre-10g) and V$SQL in the database to double check if the SQL passed by the Oracle OLEDB Provider actually contains the APPEND hint in case the INSERT actually generates UNDO (which is the indicator that shows you if the direct-path insert is used or not). Whether it generates REDO is - as already mentioned - depending on other factors.
    So the question is how have you determined if the direct-path insert mode has been used or not?
    The simplest approach to test if direct-path insert mode is used or not is to issue a query on the object inserted into after the insert before committing the transaction. If it fails with "ORA-12838: cannot read/modify an object after modifying it in parallel" then you successfully inserted using direct-path insert.
    Note that there a number of restrictions that prevent the direct-path insert from happening, in those cases the APPEND hint will be silently ignored, e.g. enabled triggers, foreign keys on the table. A quite comprehensive list of restrictions is listed in the manuals here:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28313/usingpe.htm#CACEJACE
    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/

  • Patches 7446163 y 6851110 in order to use Oracle Text from UCM

    Hello, we have Oracle Enterprise Edition 11.2.0.1 on AIX 6.1.0.0 (64 bits). The client want to use Oracle Text from Universal Content Management, he told me about install the patches 7446163 y 6851110 in order to enable Oracle Text from UCM. I reviewed in Metalink but the readme said that those patches are for Oracle 11.1.0.7. That version (11.2.0.1) include already those patches or those are necessary for we can use the funcionality of Oracle Text from Universal Content Management? I reviewed the components installed on database and the Oracle Text is installed and active.
    Thanks for your help.
    Sincerely,
    Ruben Nieto
    DBA

    Hi
    Oracle DB usually would be installed with Oracle Text enabled (the db side) . To use the features for this we need to have OracleText component enabled on UCM which as you mentioned is already installed and enabled on the ucm server .
    If both the above conditions are already met then you would not need to install any further patches.
    Let me know if it is fine on db and ucm .
    Verify that Oracle Text is enabled on db by executing the following query :
    select comp_name, status from dba_registry;
    It should return the the following result : Oracle Text VALID
    To verify if the component for UCM is installed then you would need to check Administration - Configuration for <instance name> - Enabled Components
    Thanks
    Srinath
    Edited by: Srinath Menon on Dec 26, 2010 8:38 PM

Maybe you are looking for

  • USB Hard Drive not mounting til after restart

    This weekend I put a new internal hdd in my Power Mac G5, and decided to use this opportunity to go ahead and put Leopard on one of my macs. I'm finding that it doesn't mount some my USB External Hard Drives (3.5" externaly powered cases) unless I pl

  • Refresh adaptive portlet

    I have 2 different adaptive portlets on a page. The first portlet raises a PCC event that is registered on the second portlet. I need to refresh (not postback) the second portlet when it receives the event. I have accomplished this with PTHTTPGETRequ

  • New link to down load 10.7 where can i find it?

    need a link to 10.7 where can i find it?

  • Unit Test Module cannot create repository

    DBA has created user with listed permissions in the documentation and Unit test repository creation is still stating basic permissions need to be met. In addition, I now need to upgrade my (nonexistant) repository and the basic permissions are still

  • Ora-1276 cannot add controlfile - rman duplicate asm database

    Hi, I am trying to duplicate an asm database olddb -> asm database dup in the same diskgroup. somehow got error 0ra-1276 Cannot add file +DISK1/dup/controlfile/current.1669.754164181.  File has an Oracle Managed Files file name. There is nothing in t