use of query rewriting

is there a way to connect the materialized views how often are accessible in general or by the query rewriting enabled option?

I would like to know what materialized views are useless, because they are never used by query rewrite.

You can follow with select audit, good example here

http://www.Oracle-base.com/articles/10G/auditing-10gR2.php

If you want to in retrospect you may need something cludge together by hitting the v$ sql and plans to even see who has several SQL identifiers have a plan that rewrite. not good enough.

Tags: Database

Similar Questions

  • How we force a query to use transparently a hint, even if the index is not given in the query as a query rewriting.

    How we force a query to use transparently a hint, even if the index is not given in the query as a query rewriting.

    For example:

    If the user runs a query select deptno, avg (sal) from emp group by deptno;

    We want the optimizer to use a hint of result_cache with this request, and it should be transparent to the user.

    Query should be rewritten to seamlessly

    Select / * + result_cache * / deptno, avg (sal)

    WCP

    Group of deptno;

    How can this feature we make? Please advice.

    I checked the possibility of SPM and contours, but it is not clear if this rewrite is possible here.

    Thank you and best regards,

    Vikas Krishna

    Surely dbms_advanced_rewrite is designed for this situation?

  • using reg query

    Hello

    I'm trying to use Reg Query to review the contents of a registry key.  More precisely

    • HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify

    I just want to know what are the subkeys.  I expect to be

    • IconStreams and
      PastIconsStream

    Since they are both of type reg_binary, when I do this query I have also all binary data as well, make very large output.

    Is there a way to simply retrieve/request which is in the field/column name and not the column/field data ?  I tried the /k options and /v who gave me errors, which I interpreted in the sense I was their use either wrong or they are not used in this instance.

    There is not a lot of examples out there and most of repeat them what you find when you use /?.

    Thank you.

    Hello

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums.

    http://social.msdn.Microsoft.com/forums/en-us/windowsgeneraldevelopmentissues

  • Inserting data by using the query

    Hello

    In a book, I read the Sub statement:

    Inserting data by using the query (DML)

    If the user wants to transfer data from a table to another table in the insert statement are used independently of data that can be processed or not processed form.

    Can someone clarify what is the significance of this (processed or unprocessed form).


    Thank you.

    Why don't you ask the author of the book.

    How can we know what the author means when you take a quote out of context and don't provide any reference so that we can see exactly what is shown to you.

    I can only imagine that they are referring to data that are queried directly, "like what", another table, or who was interrogated and manipulated before be inserted.

  • How can I use join query ANSI in Forms 10 g

    Dear all,

    How I use the query as mentioned below in Forms 10 g

    SELECT <fields>  
      FROM TableA a INNER JOIN TableB b ON a.key = b.key
    

    Kind regards

    Zafar Iqbal

    You cannot use the SQL commands that did not exist in the 8.0 database.

    Oracle Forms (and reports) has a full PL/SQL engine and (only) the SQL parser.

    However, form (and reports) PL/SQL engine / SQL parser is at a level that was in the Oracle 8.0 database.

    Kind regards

    Zlatko

  • the search for empty cells by using the query designer

    Hello

    I'm trying to exclude empty cells in a field (by using the Query Builder), and I did:

    xDocumentSource < match > "CDL".

    < AND >

    < NOT > (xRelatedMsgid < match > "" "")

    but it does not work. I tried "NULL", but it does not work either. Could someone tell me how to do it (or where I can find examples of queries).

    Kind regards

    Iwona

    https://blogs.Oracle.com/Kyle/entry/searching_for_null_values_ucm

  • List of virtual machines in TIME using the query service

    Someone been able to use the query service to produce a range of virtual machines in a paralytic? I don't see all the attributes on the VclQueryadminVMField that reference the vApp.

    I log in the org of system.

    Any help would be appreciated.

    Name of the action: getVAppVms

    Entry: VAPP (vCloud:VApp)

    Output: Array / vCloud:VM

    Script:

    var vcdHost = vApp.getHost();
    var vms = new Array();
    
    var queryService = vcdHost.getQueryService();
    expression = new VclExpression(VclQueryVMField.CONTAINER, vApp.getReference().href, VclExpressionType.EQUALS);
    filter = new VclFilter(expression);
    params = new VclQueryParams();
    params.setFilter(filter);
    
    var resultSet = queryService.queryRecords(VclQueryRecordType.VM, params);
    while (resultSet != null) {
        var records = resultSet.getRecords(new VclQueryResultVMRecord());
        System.log(records.length + " VM records found");
        for each (var record in records) {
         var vmRef = new VclReference();
         vmRef.href = record.href;
         vmRef.name = record.name;
         vmRef.type = record.type;
         vms.push(vcdHost.getEntityByReference(VclEntityType.VM, vmRef));
        }
        resultSet = resultSet.getNextPage();
    }
    
    return vms;
    

    This is what made our team (more precisely - Christophe)

  • Using the QUERY parameter in exp/expdp

    Hi, I've faced a nite last question.
    IM currently using Oracle 10 g (10.2.0.4) OS - MS Windows Server 2003

    I want a dump of tables to export multiple schemas. say (acb.m1, pqr.b2, xyz.b1)

    Each table has a minimum lines of 2,000,000,

    And I want to just the initials 10 rows in each table of export

    Is it possible that I can do this...

    Please answer.
    Thanks in advance

    Export tables in multiple schemas is not supported in Data Pump until 11.1.0.7. So if you're on 10g, you will need to run multiple commands expdp. For only 10 lines of each table, use the query parameter

    Query = "where rownum"<>

    This will apply to all the tables you export.

    I hope this helps.

    Dean

    Published by: Dean WINS January 30, 2012 08:42

  • When we need to use a query variable and how to use it?

    Hello

    When we create a line of dashboard, we set the variable, there are two types: variable presentation and application.
    I'm confuse when we need to use a query variable and how to use it?

    Thank you
    Anne

    Hello
    The variable 'demand' can be used if you want to use session related information specific to you.

    See below a:
    http://gerardnico.com/wiki/dat/OBIEE/logical_sql/obiee_set_request_variable_dashboard_prompt

    FYI... example of
    for the example query variable (a good post Nico)

    http://gerardnico.com/wiki/dat/OBIEE/set_variable

    for the variable of presentation with example

    http://gerardnico.com/wiki/dat/OBIEE/presentation_variable

    Thank you

    Deva

  • Not able to change the password by using the query. Select APPS.fnd_web_sec

    Not able to change the password by using the query.
    Select APPS.fnd_web_sec.change_password ('username', 'password') 'RES' double;

    Can someone tell why and what privileges and subsidies have flexibility to the user non-apps while it can change the password using fnd_web_sec.change_password.



    Concerning

    the information above does not solve my problem, I get the message

    Because you do not have permission on all objects that are referenced by the API (see below).

    Select FND_WEB_SEC. CHANGE_PASSWORD ('MARSHAD', 'mohammad @123') "RES" of the double

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    ORA-06512: at the 'APPS '. FND_CORE_LOG', line 25

    ORA-06512: at the 'APPS '. FND_CORE_LOG', line 432

    ORA-06512: at the 'APPS '. FND_PROFILE', line 110

    ORA-06512: at the 'APPS '. FND_SSO_MANAGER", line 227

    ORA-06512: at the 'APPS '. FND_WEB_SEC', line 1425

    ORA-06512: at line 1...

    can you please list me what are the grants and other Jules Destrooper I should give to a user so that he can change password.

    I don't have the list of objects and you should get yourself by consulting the site code and eTRM API.

    by changing the DDT in the user non-apps after the grant, will, it may be able to change the password.please tell this syntax is correct or not.
    Select applications. FND_WEB_SEC. CHANGE_PASSWORD ('user', 'pwd') "RES" of the double

    What is the point of using 'FND_WEB_SEC. CHANGE_PASSWORD' and not FNDCPASS or FND_USER_PKG API?

    Thank you
    Hussein

  • DataPump import by using the query

    Hello

    I need to import data by filtering using the query. can anyone help?

    Thank you

    Hello
    example of

    expdp HR/hr = emp QUERY:'"WHERE dept_id > 10 AND sal > 10000"' NOLOGFILE = y DIRECTORY = dpump_dir1 DUMPFILE = exp1.dmp

    Impdp HR/hr DIRECTORY = dpump_dir1 DUMPFILE = expfull.dmp QUERY = departments:'WHERE department_id «»< 120"'="" nologfile="">

    See this link

    http://download.Oracle.com/docs/CD/B13789_01/server.101/b10825/dp_import.htm

  • By using the query table data pump

    I am trying to perform an export of data pump on a table by using a query in a parfile and I'm getting a strange behavior. The database version is 10.2.0.4.3 and the AIX 5.3 operating system. The query looks like this.

    QUERY = "POSDECLARATIONQUEUE:where SESSIONID in (select"B.SESSIONID"from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where"B.SESSIONID"="C.ID"and"C.ACCOUNTID"= 'A.ID' and 'Inform' = '10252')" "

    This works, but gets 0 rows. If I run the query against the instance in a session of SQLPlus as below then I get 0 rows returned.

    Select * from POSDECLARATIONQUEUE where SESSIONID in (select "B.SESSIONID" from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where "B.SESSIONID" = "C.ID" AND "C.ACCOUNTID" = 'A.ID' and 'Inform' = '10252');

    If I take the columns all about apostrophes in the query on the Forum with SQLPlus, I get over 2000 rows returned.

    SQL > select count (*) in the POSDECLARATIONQUEUE where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and inform = 10252);

    COUNT (*)
    ----------
    2098

    If I remove the apostrophes in the query parfile then I get the following error in data pump export.

    DEU-00014: invalid value for the parameter, "schemas".

    The PATTERNS option is not specified in parfile him and the TABLES option specifies that the table POSDECLARATIONQUEUE.

    Can someone help with this, I can't seem to be able to get the syntax just to work within data pump.

    Kind regards.
    Graeme.

    Published by: user12219844 on April 14, 2010 03:34

    It seems that your query can be a little wrong:

    That's what you have:

    QUERY = "POSDECLARATIONQUEUE:where SESSIONID in (select"B.SESSIONID"from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where"B.SESSIONID"="C.ID"and"C.ACCOUNTID"= 'A.ID' and 'Inform' = '10252')" "

    That's what I would have thought it should look like:

    QUERY = POSDECLARATIONQUEUE: "where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and inform = 10252).

    You want to double "around the full query and you have not need single ' around all =." The single ' treat these values as strings and he said

    "B.SESSIONID" = "C.ID".
    the B.SESSIONID string is the string C.ID

    In your query you used in sql has been

    B.SESSIONID = C.ID

    that said, it is that the B.SESSIONID stored value equal to the value stored at C.ID

    Which is what you want.

    Dean

  • IMPDP | Possible using the query option

    HI PPL,

    I wanted to know if IMPDP is possible by using the query option, as I took full expdp dump of the mentioned table and want to import only select lines.

    Impdp arup/arup directory = demo_dir dumpfile = employees.dmp
    Query = employees:------"" where salary\ > 10000\ order of salary "tables used ="

    version: 10 gr 2
    platform: UNIX

    concerning

    Obviously, it will be slow if you are using the query option, because IMPDP must import only the data that meets the criteria; It of why we export only limited data (one or two tables as needed) and import them completely.

    Concerning
    Girish Sharma

  • Problem in the export using the QUERY functionality

    Problem in the export using the QUERY functionality


    I'm trying to export some rows in a table using the query functionality
    and I have some errors... I'm using the syntax is

    system@orcl QUERY = scott.emp expdp: '"WHERE emp_no = 123455" '
    DIRECTORY = data_pump_dir DUMPFILE = data_pump.dmp
    LOGFILE = data_pump_12345.log INDEX = n

    Can someone tell me please the problem with that statement

    I also tried to use the simple export

    exp file system@orcl = orcl_export.dmp log = orcl_export.log
    tables = Scott.EMP index = QUERY = n------"WHERE emp_no\ = 123455\"

    and this error

    EXP-00008: ORACLE error 904
    ORA-00904: identify invalid

    My os is Solaris
    Please let me know what the problem

    Hello

    Try to create parfile and use that, otherwise, you will need to escape each clause correctly to run exp or expdp successfully.

    test.par

    tables=emp
    query="WHERE emp_no=123455"
    
    or
    tables=myobjects
    query="WHERE owner='SYS'"
    
    $> exp username/password parfile=test.par
    
    Export: Release 10.2.0.1.0 - Production on Thu Mar 19 10:17:48 2009
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining Scoring Engine options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    
    About to export specified tables via Conventional Path ...
    . . exporting table                      MYOBJECTS      22650 rows exported
    Export terminated successfully without warnings.
    

    Concerning

    Published by: OrionNet on March 19, 2009 10:21

  • Help with Query Rewrite

    Hi guru,.

    First of all thank you very much for any help.

    I want to rewrite the query to make fast performance to retrieve the records. I'm passing date as parameter and its data donations for 1 week.

    I have an index on the column of rundate which I use in where clause. I select only forms a table in the entire query.

    Can you please help me to rewrite the request or suggestions.

    Thanks in advance!...
    SELECT  TO_CHAR(SYSDATE, 'MM/DD/YYYY') AS "GENERATED ON",
           to_char(TRUNC(:pdate, 'Day'), 'mm/dd/yyyy')  AS "FROM DATE",
           to_char(TRUNC(:pdate, 'Day') + 6, 'MM/DD/YYYY')  AS "TO DATE",
           TOTAL_CALLS AS "TOTAL CALLS",
           DEPARTMENT AS "DEPARTMENT",
           TOTAL_DEPTCALLS AS "TOTAL DEPARTMENT CALLS",
           START_DATE AS "START DATE",
           ORIGINAL_CATEGORY AS "ORIGINAL CATEGORY",
           ORIGINAL_SUBCATEGORY AS "ORIGINAL SUBCATEGORY",
           GROUP_ID AS "GROUP ID",
           GROUP_NAME AS "GROUP NAME",
           TOTAL_BY_CAT_SUBCAT AS "TOTAL BY CAT-SUBCAT",
           ROUND((TOTAL_BY_CAT_SUBCAT / TOTAL_CALLS) * 100, 2) AS "% TOTAL BY CAT-SUBCAT",
           TOTAL_BY_GROUP AS "TOTAL BY GROUP",
           ROUND((TOTAL_BY_GROUP / TOTAL_CALLS) * 100, 2) AS "% TOTAL BY GROUP",
           TOTAL_BY_GROUP_CAT_SUBCAT AS "TOTAL BY GROUP CAT-SUBCAT"
      FROM (SELECT DEPARTMENT AS "DEPARTMENT",
                   (SELECT count(1)  FROM PHONE_INQUIRY_CAUSE_REPORT RPT1
                             WHERE RPT1.RUNDATE >=  (TRUNC(:pdate, 'Day'))
                              and rpt1.rundate <= (TRUNC(:pdate, 'Day') + 6))
                               AS "TOTAL_CALLS",
                   CASE
                     WHEN DEPARTMENT = 'M' THEN
                     (SELECT count(1) 
                                 FROM PHONE_INQUIRY_CAUSE_REPORT RPT1
                                WHERE RPT1.RUNDATE >=  (TRUNC(:pdate, 'Day'))
                                 and rpt1.rundate <= (TRUNC(:pdate, 'Day') + 6)
                                  AND RPT1.DEPARTMENT = 'M')
                     WHEN DEPARTMENT = 'F' THEN
                      (SELECT count(1)
                                 FROM PHONE_INQUIRY_CAUSE_REPORT RPT1
                                WHERE RPT1.RUNDATE >=  (TRUNC(:pdate, 'Day'))
                                         and rpt1.rundate <= (TRUNC(:pdate, 'Day') + 6)
                                  AND RPT1.DEPARTMENT = 'F')
                   END AS "TOTAL_DEPTCALLS",
                   START_DATE AS "START_DATE",
                   ORIGINAL_CATEGORY AS "ORIGINAL_CATEGORY",
                   ORIGINAL_SUBCATEGORY AS "ORIGINAL_SUBCATEGORY",
                   GROUP_ID AS "GROUP_ID",
                   GROUP_NAME AS "GROUP_NAME",
                  (SELECT count(1)
                    FROM PHONE_INQUIRY_CAUSE_REPORT RPT2
                   WHERE RPT2.RUNDATE >= (TRUNC(:pdate, 'Day')) AND
                         RPT2.RUNDATE <= (TRUNC(:pdate, 'Day') + 6)
                     AND RPT2.ORIGINAL_CATEGORY = rpt.original_category
                     AND NVL(RPT2.ORIGINAL_SUBCATEGORY, '%') =
                         NVL(RPT.ORIGINAL_SUBCATEGORY, '%')
                    ) AS "TOTAL_BY_CAT_SUBCAT",
               (SELECT count(1)
                    FROM PHONE_INQUIRY_CAUSE_REPORT RPT2
                   WHERE RPT2.RUNDATE >= (TRUNC(:pdate, 'Day')) AND
                         RPT2.RUNDATE <= (TRUNC(:pdate, 'Day') + 6)
                    and rpt2.group_id = rpt.group_id
                 ) AS "TOTAL_BY_GROUP",
                 
                 (
             SELECT count(1)
                    FROM PHONE_INQUIRY_CAUSE_REPORT RPT2
                   WHERE RPT2.RUNDATE >= (TRUNC(:pdate, 'Day')) AND
                         RPT2.RUNDATE <= (TRUNC(:pdate, 'Day') + 6)
                     AND RPT2.ORIGINAL_CATEGORY = rpt.original_category
                     AND NVL(RPT2.ORIGINAL_SUBCATEGORY, '%') =
                         NVL(rpt.original_subcategory, '%')
                     AND RPT2.GROUP_ID = rpt.group_id
                )  AS "TOTAL_BY_GROUP_CAT_SUBCAT"
             FROM PHONE_INQUIRY_CAUSE_REPORT RPT
             WHERE RPT.RUNDATE >=  (TRUNC(:pdate, 'Day'))
             AND rpt.rundate <= (TRUNC(:pdate, 'Day') + 6)
             ORDER BY ORIGINAL_CATEGORY, GROUP_ID)

    Hello

    Try to use the function SUMMARY, rather than the aggregate COUNT:

    WITH    universe     AS
    (
         SELECT  department
         ,       COUNT (*) OVER ()          AS total_calls
         ,       CASE
                         WHEN  department IN ('F', 'M')
                      THEN  COUNT (*) OVER (PARTITION BY  department)
              END                            AS total_deptcalls
              ,       start_date
              ,       original_category
              ,       original_subcategory
              ,       group_id
              ,       group_name
              ,       COUNT (*) OVER (PARTITION BY  original_subcategory)
                                                     AS total_by_subcat
              ,       COUNT (*) OVER (PARTITION BY  group_id)
                                                  AS total_by_group
              ,       COUNT (*) OVER (PARTITION BY  original_subcategory
                                               ,           group_id
                                      )        AS total_by_subcat_group
         FROM    phone_inquiry_cause_report
         WHERE      rundate  >= TRUNC (:pdate, 'Day')
         AND      rundate  <  TRUNC (:pdate, 'Day') + 7
    )
    SELECT    TO_CHAR (SYSDATE,    'MM/DD/YYYY')     AS "GENERATED ON"
    ,         TO_CHAR (:pdate,     'MM/DD/YYYY')       AS "FROM DATE"
    ,         TO_CHAR (:pdate + 6, 'MM/DD/YYYY')       AS "TO DATE"
    ,         total_calls                           AS "TOTAL CALLS"
    ,         department
    ,         total_deptcalls               AS "TOTAL DEPARTMENT CALLS"
    ,         start_date                     AS "START DATE"
    ,         original_category                AS "ORIGINAL CATEGORY"
    ,         original_subcategory                AS "ORIGINAL SUBCATEGORY"
    ,         group_id                     AS "GROUP ID"
    ,         group_name                     AS "GROUP NAME"
    ,         total_by_cat_subcat                AS "TOTAL BY CAT-SUBCAT"
    ,         ROUND ( 100 * total_by_cat_subcat
                      / total_calls
              , 2
              )                    AS "% TOTAL BY CAT-SUBCAT"
    ,         total_by_group                AS "TOTAL BY GROUP"
    ,         ROUND ( 100 * total_by_group
                      / total_calls
              , 2
              )                    AS "% TOTAL BY GROUP"
    ,         total_by_group_cat_subcat           AS "TOTAL BY GROUP CAT-SUBCAT"
    ORDER BY  original_category
    ,            group_id
    ;
    

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

Maybe you are looking for

  • Display number and the name of the caller

    Greetings, I have an Iphone 6 IOS 9.3.3 when I get a call, is only to show the name of the appellant, I want to view calling name and number. I tried so hard, but I have found no Solution.

  • Photos uses iCloud only or can I simply use your hard drive?

    I am confused in regard to if I can store photos using the Photos app on my hard drive or are they only stored on the iCloud? Thank you very much

  • Skype disconnects me

    I really hope someone has a solution to this. Whenever I turn off my cell phone that Skype now disconnects me if I constantly to reconnect. It has just begun in the last week. I have the latest version of Skype, any suggestion would be appreciated. T

  • How to restore a Portege R400?

    Hi all I need a Portege R400 of restore factory.This model is not equipped with a CD/DVD player, and there is no recovery CD in the package. Could someone advise me on how to proceed? Thank you, all the best, federicoan

  • Software malware/adware removal instructions

    OS: 10.11.3 Symptoms: popup on chrome (wonderlandads) I search on google and found pop - up for wonderlandads is adware/malware. I scanned my system with Avast / avira and malware bytes. He did not find anything I checked the extension and did not fi