How to include optimizer hints in Discoverer

We have a Discoverer report which used to run fine prior to DB migration from (9.2.0.6 to 10G Rac 10.2.0.4).
Since the database is migrated to 10g RAC same reports is running for longer time and failes with ROW_ID error,
we ran the sql generated by the report in SQL Plus with below optimizer hint.
Select /*+ optimizer_features_enable('9.2.0') */
this query ran well with optimizer hint, but i am wondering how to use the optimizer hint in Discoverer Plus/Desktop.
Select /*+ optimizer_features_enable('9.2.0') */
C.EMPLOYEE_NUMBER||' '||A.EMPLOYEE_NAME, A.REPORTS_TO, C.SERVICE_CODE, COUNT(B.ACCOUNT_NUMBER)
FROM PSTAGE.NEW_EMPLOYEE_MASTER A,
PSTAGE.NEW_ALL_WORK_ORDER_MASTER B,
PSTAGE.NEW_ALL_WORK_ORDER_DETAIL C
WHERE ( ( B.WORK_ORDER_NUMBER = C.WORK_ORDER_NUMBER AND B.SITE_ID = C.SITE_ID )
AND ( A.EMPLOYEE_NUMBER = C.EMPLOYEE_NUMBER AND A.SITE_ID = C.SITE_ID ) )
AND ( B.WO_STATUS <> 'CN' )
AND ( C.EMPLOYEE_NUMBER = ANY(SELECT S254_200018.EMPLOYEE_NUMBER
FROM PSTAGE.NEW_EMPLOYEE_MASTER S254_199317,
PSTAGE.NEW_ALL_WORK_ORDER_MASTER S254_199854,
PSTAGE.NEW_ALL_WORK_O
Thanks in advance

Hi Sunil
In the Administrator tool, you can add hints to the driving folder used in your query. A first glance at your report seems to indicate that B might be the driver.
If you launch the Administrator tool, open the business area then right-click on the folder in question you can select Properties. The second to last property is called Optimizer hints. Try setting the same hint in here exactly the way you would do it inside SQL.
I am not 100% sure whether this would take as this isn't a folder hint per se, but it is worth a try. You might also want to look at this thread: how to design Optimizer hints  to the generated SQL
Another thing to check is to look at the code that is being generated by your Discoverer worksheets. Do you by chance see a NOREWRITE hint being added? This is a common issue with newer systems. This hint tells the database that the query cannot be rewritten which in most cases will cause poor performance. If this is happening to you I advise you to disable that hint. This is done by editing the pref.txt and adding a new preference called
Out of the box, Discoverer Plus will sometimes add the NOREWRITE hint. This will cause Plus worksheets to operate much slower than Desktop worksheets. You can disable the NOREWRITE hint by adding a new preference called UseNoRewriteHint to pref.txt in the Database section. After you have done this you will have to run the apply preferences script.
[Database]
UseNoRewriteHint = 0
Be sure to close all of your IE windows so that a new JVM is loaded.
For example, you might turn on UseNoRewriteHint (i.e. set it to 1) if you want users to always query against the latest data (e.g. created today), even though this might be slower than querying the summary data (e.g. created yesterday). The NOREWRITE hint instructs the optimizer to disable query rewrite for the query block, which overrides the setting of the parameter QUERY_REWRITE_ENABLED.
Default Value: 0
Valid Values
0 = Do not add the NOREWRITE hint. This is the one I recommend.
1 = Do add the NOREWRITE hint.
Another possible area is with query prediction. This is taken from an Oracle Note: Under some circumstance when you run a query against an Oracle 10g database, the queryprediction might take up the majority of time and CPU may hit 100%.
The cause for this is an an Oracle10g (10.1) database issue but seeing as you are on 10.2 this might not be an issue any more. I throw it out there just in case you still hvae issues and want to raise this with Oracle. The last I heard is that the root cause was still under investigation in an unpublished Bug:4024370. There was a workaround to the issue:
1. Disable Query Prediction (strongly recommended anyway):
For Plus/Viewer:
Edit pref.txt on the middle-tier server and set QPPEnable=0
Run the applypreferences script (.sh or .bat)
For Desktop:
Edit the registry and set QPPEnable=0
HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
2. If you still wish to use Query Prediction while the database issue is being investigate, then you can configure the Query Predictor to use the Explain Plan method rather than the Dynamic Views method.
For Plus/Viewer:
Edit pref.txt on the middle-tier server and set QPPObtainCostMethod=0
Run the applypreferences script (.sh or .bat)
For Desktop:
Edit the registry and set QPPObtainCostMethod=0
HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
Hope this helps
Best wishes
Michael

Similar Messages

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

  • How to include .jars?

    Hello,
    I have been unable to find out how to include in the .ear file generated by wsgen the supporting .jar files that my Web Service EJB needs.
    I thought this could be done with the "classpath" parameter in the wsgen tag in build.xml, but it doesn't seem to do anything.
    Can someone please provide a hint?
    Thanks,
    Pere

    Hi Pete,
    You mentioned the <wsgen> Ant task, so I'm assuming that you're using WLS 6.1
    An automated way to do this, is to include a series of <exec> Ant tasks after
    the <wsgen> one. These <exec> Ant tasks would call the jar.exe and look something
    like this:
    <exec
    dir="."
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="xvf ${APPLICATIONS}/MyWS.ear myEJB.jar"/>
    </exec>
    <delete dir="myEJB-jar"/>
    <mkdir dir="myEJB-jar"/>
    <exec
    dir="myEJB-jar"
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="xvf myEJB.jar"/>
    </exec>
    <copy todir="myEJB-jar">
    <fileset dir=".">
    <include name="jar1-used-by-EJB.jar"/>
    <include name="jar2-used-by-EJB.jar"/>
    </fileset>
    </copy>
    <copy todir="myEJB-jar/META-INF">
    <fileset dir=".">
    <include name="MANIFEST.MF"/>
    </fileset>
    </copy>
    <jar jarfile="myEJB.jar" basedir="myEJB-jar" />
    <exec
    dir="."
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="uvf ${APPLICATIONS}/MyWS.ear myEJB.jar"/>
    </exec>
    I realize this seems like a lot of steps, but they are at least automated :-)
    Note that the contents of the MANIFEST.MF that you copy in must look like this:
    Manifest-Version: 1.0
    Created-By: Ant 1.4
    Class-path: jar1-used-by-EJB.jar jar2-used-by-EJB.jar
    in order for the EJBs to find the newly included .jar files.
    HTH,
    Mike Wooten
    Pere Torrodellas <[email protected]> wrote:
    Hello,
    I have been unable to find out how to include in the .ear file generated
    by wsgen the supporting .jar files that my Web Service EJB needs.
    I thought this could be done with the "classpath" parameter in the wsgen
    tag in build.xml, but it doesn't seem to do anything.
    Can someone please provide a hint?
    Thanks,
    Pere

  • How to include several PDF documents into just one file?

    I have a Word document with 6 pages that I saved in PDF.
    I wanted to transform the entire document in JPEG (JPG) immage, so that I could use it in other tools, such as Facebook for example.
    The problem is that using Adobe Photoshop it opens and saves page by page.
    Can you give me s solution or hint?
    Flavio
    [email protected]

    Thank you!
    I already saved all pages as .pdf w/ Acrobat and have all 6 pages saved in
    .jpg, using Photoshop.
    Problem is that I want to post the whole text in my Facebook page, and to
    have it in six pieces is not quite readable...
    Thanks anyway and have a joyful Xmas!
    2011/12/24 try67 <[email protected]>
       Re: How to include several PDF documents into just one file?  created
    by try67 <http://forums.adobe.com/people/try67> in Adobe Reader - View
    the full discussion <http://forums.adobe.com/message/4102594#4102594>

  • ODBC Driver adds ROWID next to SELECT and disables the optimizer hint

    I want to use an optimizer hint in my sql statement. For example: "select /*+ index(emp,status) +*/ status,name from emp where status=1". I have a bitmap index on status field, i want to force the select statement to use it. This one works fine from sql plus. If i execute the same statement from a VB application and run it via ODBC [Microsoft driver or oracle driver] it's sending the statement like "select rowid,/*+.....+*/ ...". I believe hint has to be next to the word SELECT, so it's not being used. I want to create an ADO connection from the vb application and create a recordset and loop through it and update some values. Any thoughts?
    I tried some other options...like
    select * from (select /*+ index(1,2) +*/....)
    select a.* from (select /*+ index(1,2) +*/...) a
    cn1.execute(sqltext) from vb..
    In all these three methods it's not adding a rowid next to select.. so hint is used and able to use the index. But having issues with updating the recordset. It says "query is not from one table" and "can't be updated" errors..

    The ODBC drivers are going to need to select the rowid in order to get an updatable or a scrollable recordset. Otherwise, they won't know which row in the database to update or how to fetch the previous rows without caching the entire recordset.
    Can you create a view from the hinted select statement and select from that? That's likely to be the fastest solution.
    Justin

  • Optimizer Hint

    When I set the Optimizer Hint property to something like /*+ INDEX(Fin_Budgets Bud_PK)*/ at design time and query the form then the default query does not include the hint I passed. But when I set it programmatically via Set_Block_Property it does include. I checked the :system.last_query system variable in Post-Query trigger.
    Is this is a bug ????
    Your answers and view are appreciated.
    Thanks in advance
    Asif Momen

    When I set the Optimizer Hint property to something like /*+ INDEX(Fin_Budgets Bud_PK)*/ at design time and query the form then the default query does not include the hint I passed. But when I set it programmatically via Set_Block_Property it does include. I checked the :system.last_query system variable in Post-Query trigger.
    Is this is a bug ????
    Your answers and view are appreciated.
    Thanks in advance
    Asif Momen

  • Optimizer Hint after Order By

    Hi,
    We have order by person_id in query which returns 10000 records.
    We have included FIRST_ROWS(20) as Optimizer Hint.
    Will Order by impact Optimizer Hint ?
    Thanks,
    Kiran

    914684 wrote:
    Hi,
    We have order by person_id in query which returns 10000 records.
    We have included FIRST_ROWS(20) as Optimizer Hint.
    Will Order by impact Optimizer Hint ?
    Thanks,
    Kiran
    no

  • How to compile the hint to force selection statement to use index

    Hello expert,
    will you please tell me how to compile the hint to force selection statement to use index?
    Many Thanks,

    Not sure what you mean by compile, but hint is enclosed in /*+ hint */. Index hint is INDEX(table_name,index_name). For example:
    SQL> explain plan for
      2  select * from emp
      3  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    14 |   546 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| EMP  |    14 |   546 |     3   (0)| 00:00:01 |
    8 rows selected.
    SQL> explain plan for
      2  select /*+ index(emp,pk_emp) */ *
      3  from emp
      4  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 4170700152
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |    14 |   546 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |    14 |   546 |     2   (0)| 00:00:01 |
    |   2 |   INDEX FULL SCAN           | PK_EMP |    14 |       |     1   (0)| 00:00:01 |
    9 rows selected.
    SQL> Hint in the above example is forcing optimizer to use index which resul;ts in a bad execution plan. Most of the time optimizer does not need hints and chooses an optimal plan. In most cases sub-optimal plan is result of stale or incomplete statistics.
    SY.

  • How to include old invoices in the invoice list

    How to Include old billing documents in the invoice list.
    TO be more clear:-
    I created 20 invoices in the monthof JAN
    I maintained the factory calender in the payer master in the month of Feb 1st and created 10 more invoices in this month.
    So the system is considering only the invocies which were generated after I maintained the factory calender (Only feb invoices).
    Is there any process to include the previous invoicies (Jan invoices)  also to get include in the invoice list.
    Help me in this regards.
    Regards,
    Mallesh.

    It is not possible.
    Regards,
    Rajesh Banka

  • How to include a jsp page in another jsp jsp page

    hi,
    i m trying to include a jsp page name "header.jsp" into one jsp page name"selectattribute.jsp" i m using these commands in "selectattribute.jsp"
    <%@include file "header.jsp"%> bcz both these jsp page are C:\program files\tomcat 4.0\webapps\examples\jsp\Poject\
    but the problem is that , i m invoking this jsp page "selectattribute.jsp" from a servlet reportcontroller.java using REQUEST DISPATCHER.
    the servlet is in
    C:\Program files\tomcat 4.0\webapps\examples\WEB-INF\classes\Project\
    i want to know how to include some other jsp page in a jsp page and how to invoke applet from jsp page when that particular jsp page is being invoked by servlet.
    plz help
    manish

    use this for including in your selectattribute.jsp
    <jsp:include page="header.jsp" flush="true"/>
    I never tried calling an applet. I think you can write the code for calling the applet in a javabean method and call the method in the jsp

  • How to include one view into another view

    Hi SDN's,
                   Could any please tell me,How to include one view into another view.
    In my requirment.I want to create a 'Z' view for an interface .In that  view i have to take,
    1) Ship-to-email adrr by
                              LIKP-KUNNR -> KNA1-ADRNR
                              KNA1-ADRNR -> ADR6-ADDRESNUMBER.
    2) E-mail addr of person who created the document.i.e
        LIKP-ERNAM -> USR21-BNAME.
        USR21-ADDRESNUMBER ->  ADR6-ADDRESNUMBER 
        USR21-PERSNUMBER -> ADR6-PERSNUMBER.
       In both the case we have to pass ADDRESSNUMBER to ADR6 table.
    If we pass these condition it fails,B'Coz at a time it passes Two ADDRESSNUMBER and a PERSNUMBER.
    So i created two which fetches only the email addr of  person who created the document.and another view fetches Ship-to-email addr.
    Now i want to include the second view into first view . Is it possible?or please
    tell me someother way to get these email addresses in a single view.

    hi
    as per my knowledge, nested views are not possible. However, while creating a new view, selection method will not giv u option to select the already created view(S) except the tables..i think so.
    regards,
    shamim

  • How to delete a workbook in Discoverer 10g

    Hello guys,
    Does anyone know how to delete a workbook from Discoverer 10g? I created a report in Discoverer Plus as SYSADMIN and gave this to my user. My user only has access to Discoverer Viewer. He went and did a "Save As" on this report. Now when he loggs in to Viewer again, he sees two report. One created by SYSADMIN and the on he created. I want to delete the one he created. How do I go about doing this? Can I do it from Discoverer? If so, which one(Viewer or Plus)? Will I have to login as him to do this? Please advise.

    Hi,
    I'm sorry for the question but you said:
    You just login as the user into viewer and delete the workbookWhere do you see the option to delete from the viewer ?
    To delete/ manage workbooks you need to login to either Plus or Desktop versions.
    And yes you need to log in using the owner user name
    Tamir

  • HOW to include a reference currency fields in a view ?

    Hello Experts,
    <b>I am having Currency fields error in generic extraction</b>
    I have table where I am trying to extract data to BW via generic extraction. When I tried
    to extract with the TABLE its giving me an error
    <b>Invalid extract structure template RPSCO of DataSource ZBW_REP3_TEST
    You tried to generate an extract structure with the template structure RPSCO. This operation failed, because the template structure quantityfields or currency fields, for example, field WLP00 refer to a differenttable</b>.
    Now I created a view with all the fields same as my table.
    But its still giving me the same error and taking all the fields as a primary keys. I have over 12 currency fields in the table. I am confused how to fix this issue and add a currency field to my view?
    hOW to include a reference currency fields in a view ?
    All inputs are much appreciated.
    Thanks and Regards,
    Harish

    Thank you for your responce,
    Can you please check my view and let me know where I am going wrong     
    View    Table   Field  Dataele  Data
    field                    type                                            0                                                                
    WLP01     RPSCO     WLP01     BP_WPL     CURR     15     Period value in ledger currency
    WLP02     RPSCO     WLP02     BP_WPL     CURR     15     Period value in ledger currency
    WLP03     RPSCO     WLP03     BP_WPL     CURR     15     Period value in ledger currency
    WLP04     RPSCO     WLP04     BP_WPL     CURR     15     Period value in ledger currency
    WLP05     RPSCO     WLP05     BP_WPL     CURR     15     Period value in ledger currency
    WLP06     RPSCO     WLP06     BP_WPL     CURR     15     Period value in ledger currency
    WLP07     RPSCO     WLP07     BP_WPL     CURR     15     Period value in ledger currency
    WLP08     RPSCO     WLP08     BP_WPL     CURR     15     Period value in ledger currency
    WLP09     RPSCO     WLP09     BP_WPL     CURR     15     Period value in ledger currency
    If I add a
    Table TCURC against any field what would be the view field and data element
    Do I need to tick MOD?
    Please suggest.
    Kapadia,
    If I do that its still taking all the fields are a primary keys and bringing 6 lakh records to where I originally have 49 records in a table
    Thanks and Regards,
    Harish

  • How to include a license header in fxml file?

    How to include a license header in fxml file?
    I tried xml block comments <!-- mylicense here -->
    but it wasn't accepted by screen builder.
    Also I wondered, even if it had been accepted, would screen builder have saved the header back - or deleted it?

    All XML documents should begin with an XML declaration.
    If you have your fxml file starting with  the following lines :
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- mylicense here -->
    .. it will be loaded in Scene Builder, and saved back as is.

  • I would like to know how to include entries in my TOC that refer to paragraph styles that a before the TOC.

    I would like to know how to include entries in my TOC that refer to paragraph styles listed before the TOC.
    Example:
    page i. Title Page
    page ii. Abstract
    page iii. Table of Contents
    I want the TOC on page iii to include the entries "title page" and "abstract". Is this possible?
    Thank you-

    Thesis formatting rules.
    Can you answer another question?
    How do I change the text for a TOC entry? For example,
    I have selected the title on my first page, for example "Summer Report" and selected a paragraph style for it, and added it in the TOC. Now the TOC will have this entry for "Summer Report" and the associated page. But I want it to say "Title Page" instead. Can I edit this text? In order words, have the TOC point to something with whatever name I want to give it, even though it is not the actual name of the section?

Maybe you are looking for

  • MS ACCESS exception when updating memo field

    I use JDBC - stmt.setCharachterStream() to set large amount of characters to the db. I get a MS Access "Function sewuence error" when updating a large amount of data (for smaller amounts there is no problem). Any Ideas ? note: I was using stmt.setAsc

  • Excise duty getting calculated on freight value

    Hi frnds, I have an excisable material and the freight charge (FRA2) for this material.Tax procedure is TAXINN. My issue is - during MIRO the excise duty is calculated on the material as well as on the freight charges. My client does not want excise

  • Epson r1800 won't print

    I have recently changed to imac from pc. My epson r1800 printer was working perfectly but when switched to mac I no longer had access to the full list of printing options, including paper type, so downloaded latest epson drivers. now cannot print at

  • Removal of duplicate photos in iphoto

    how do you delele duplicate phpto in iphoto and prevent duplicate downloads of photos? In Wndows, it will ask if you want download  duplicates  or remove them thanks

  • Extracting object

    What is the best or easiest way to extract an object from a photo, so that is the only thing you see when you save it? No background. I have Elements 6 and cs4, can't seem to do with either. Thanks for any help. I want to remove just the can with the