Optimization of simple queries

Hello

I use Oracle 10 g r2.

I have this simple query that seems to take too long to execute:
DECLARE
     nb_mesures INTEGER;
     min_day DATE;
     max_day DATE;
BEGIN
     SELECT
          COUNT(meas_id),
          MIN(meas_day),
          MAX(meas_day)
     INTO
          nb_mesures,
          min_day,
          max_day
     FROM
          geodetic_measurements gm 
          INNER JOIN
          operation_measurements om 
          ON gm.meas_id = om.ogm_meas_id 
     WHERE ogm_op_id = 0;
     htp.p(nb_mesures||' measurements from '||min_day||' to '||max_day);
END;
-Tables (about 11,000 records for the 'Operations' table) and 800,000 for the other 2:
"Operation_measurements" is the table that is the link between the other 2 (get the 2 keys).
SQL> DESCRIBE OPERATIONS

Nom                  NULL     Type
-------------------- -------- ------------
OP_ID                NOT NULL NUMBER(7)
OP_PARENT_OP_ID               NUMBER(7)
OP_RESPONSIBLE       NOT NULL VARCHAR2(10)
OP_DESCRIPT                   VARCHAR2(80)
OP_VEDA_NAME         NOT NULL VARCHAR2(10)
OP_BEGIN             NOT NULL DATE
OP_END                        DATE
OP_INSERT_DATE                DATE
OP_LAST_UPDATE                DATE
OP_INSERT_BY                  VARCHAR2(50)
OP_UPDATE_BY                  VARCHAR2(50)

SQL> DESCRIBE OPERATION_MEASUREMENTS

Nom                  NULL     Type
-------------------- -------- ------------
OGM_MEAS_ID          NOT NULL NUMBER(7)
OGM_OP_ID            NOT NULL NUMBER(6)
OGM_INSERT_DATE               DATE
OGM_LAST_UPDATE               DATE
OGM_INSERT_BY                 VARCHAR2(50)
OGM_UPDATE_BY                 VARCHAR2(50)

SQL> DESCRIBE GEODETIC_MEASUREMENTS

Nom                  NULL     Type
-------------------- -------- ------------
MEAS_ID              NOT NULL NUMBER(7)
MEAS_TYPE            NOT NULL VARCHAR2(2)
MEAS_TEAM            NOT NULL VARCHAR2(10)
MEAS_DAY             NOT NULL DATE
MEAS_OBJ_ID          NOT NULL NUMBER(6)
MEAS_STATUS                   VARCHAR2(1)
MEAS_COMMENT                  VARCHAR2(150)
MEAS_DIRECTION                VARCHAR2(1)
MEAS_DIST_MODE                VARCHAR2(2)
MEAS_SPAT_ID         NOT NULL NUMBER(7)
MEAS_INST_ID                  NUMBER(7)
MEAS_DECALAGE                 NUMBER(8,5)
MEAS_INST_HEIGHT              NUMBER(8,5)
MEAS_READING         NOT NULL NUMBER(11,5)
MEAS_CORRECT_READING          NUMBER(11,5)
MEAS_HUMID_TEMP               NUMBER(4,1)
MEAS_DRY_TEMP                 NUMBER(4,1)
MEAS_PRESSURE                 NUMBER(4)
MEAS_HUMIDITY                 NUMBER(2)
MEAS_CONSTANT                 NUMBER(8,5)
MEAS_ROLE                     VARCHAR2(1)
MEAS_INSERT_DATE              DATE
MEAS_LAST_UPDATE              DATE
MEAS_INSERT_BY                VARCHAR2(50)
MEAS_UPDATE_BY                VARCHAR2(50)
MEAS_TILT_MODE                VARCHAR2(4000) 
-Explain the plan (I'm not familiar with the plans explain... command):
--------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------------------------

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                        |     1 |    19 |   256  (10)| 00:00:02 |
|   1 |  SORT AGGREGATE               |                        |     1 |    19 |            |          |
|   2 |   NESTED LOOPS                |                        |    75 |  1425 |   256  (10)| 00:00:02 |
|*  3 |    TABLE ACCESS FULL          | OPERATION_MEASUREMENTS |    75 |   600 |    90  (27)| 00:00:01 |
|   4 |    TABLE ACCESS BY INDEX ROWID| GEODETIC_MEASUREMENTS  |     1 |    11 |     3   (0)| 00:00:01 |
|*  5 |     INDEX UNIQUE SCAN         | MEAS_PK_2              |     1 |       |     2  (50)| 00:00:01 |
--------------------------------------------------------------------------------------------------------
How to optimize this query?

Thank you.

Yann.

Looks like you are missing a FK-index on the table in the Middle, for FK goes to OPERATIONS.

Currently this:

WHERE ogm_op_id = 0;

Is calculated by a followed by a filter operation full table scan. Assuming that OP_ID is pretty selective, an index on OGM_OP_ID might do the trick here.

Tags: Database

Similar Questions

  • Some simple queries on TimesTen

    Hi, I am completely new to TimesTen, wondering just how he can interact with the standard Oracle databases

    Q1. What is the connection to TimesTen method? i.e. it is Sql * Net?

    Q2. What is used for the backup TimesTen databases? They are essentially a backup of the transaction logs, so no matter what backup file based method? for example installation standard backup of the operating system on which is deployed TimesTen?

    Q3. I assume that tools such as Data Pump, Exim etc do not work with TimesTen?

    Q4. TimesTen usable as Data Source for Oracle BI Server (i.e. OBIEE) or, in the alternative to hold the repository BI?

    Q5. Are the available DML and DDL Sql, basic commands to be used with TimesTen?

    Thank you
    Jim

    Hello, Jim. With regard to your questions:

    Q1. What is the connection to TimesTen method? i.e. it is Sql * Net?

    A1: When TimesTen communicates with Oracle, it regularly uses SQL * Net to mechanisms. For Oracle DB, it appears as just another customer.

    Q2. What is used for the backup TimesTen databases? They are essentially a backup of the transaction logs, so no matter what backup file based method? for example installation standard backup of the operating system on which is deployed TimesTen?

    A2: TimesTen offers it own backup and restore utilities (ttBackup/ttRestore) that allow you to create online, consistent, complete and incremental backups. These tools are the only supported way to back up a database TimesTen. Do not use OS level backup tools files to back up a database as a result "backup" will not be be consistent and probably won't be usable.

    Q3. I assume that tools such as Data Pump, Exim etc do not work with TimesTen?

    A3: Exact, however, TimesTen has its own set of tools that offer many opportunities.

    Q4. TimesTen usable as Data Source for Oracle BI Server (i.e. OBIEE) or, in the alternative to hold the repository BI?

    A4: Yes, TimesTen is supported as a data source for OBIEE. Actually TimesTen is one of the key technologies in OBIEE battery designed BI Exalytics system. It is not currently supported to store the repository of BI in TimesTen.

    Q5. Are the available DML and DDL Sql, basic commands to be used with TimesTen?

    A5: Yes, although there are differences in the syntax and features supported by TImesTen compared to Oracle DB. But TimesTen supports most of the usual SQL.

    You can find to put much more detail on TimesTen by browsing the presentations, whitepapers and documents, available here:

    http://www.Oracle.com/technetwork/database/database-technologies/TimesTen/Overview/index.html

    Chris

  • Simple queries OPA

    (a) I am very new to the OPA. Have a few questions.

    (1) what is an interview?
    (2) what is Web determinations?

    Can someone provide me with the link to documentation on the basics of the OPA.

    Hello

    (1) short, an interview is really all of the questions that will be asked to reach a conclusion. OPA uses Web determinations to run his interviews (see answer to the next question). An interview using a series of screens in question to collect information. Each question screen that appears during an interview contains a question or series of questions. You enter the answers to these questions so that the determinations of the Web can reach a conclusion for the specific purpose of the evaluation (interview). For example, the purpose of an assessment may be to see if a person is eligible for a specific service. The interview contains questions which must be answered in order to determine the eligibility of a person. Once all questions are answered, determinations Web will inform you if the person is eligible.

    (2) determinations of web is an online interface which presents the questions that are asked during an interview, as well as the summary of the results. The determinations of the Web port is configured during the installation of the OPA. Determinations Web URL looks like this: http://localhost: 8080/web-determinations. The 8080 is the port.

    Regarding the documentation to better explain these topics, I suggest you help OPM Pages. OPM is downloadable from the site of delivery of Oracle (edelivery.oracle.com) and its help pages explain a lot about everything and have images, which I think will really help you to better understand.

    Christine

  • Hash Join pouring tempspace

    I am using 11.2.0.4.0 - oracle Version. I have underwear paremters on GV$ parameter
    pga_aggregate_target - 8GB
    hash_area_size - 128 KB
    Sort_area_size - 64 KB

    Now under query plan is running for ~ 1 HR and resulting in question tempspace. Unable to extend segment temp of 128 in tablespace TEMP.
    We have currently allocated ~ 200GB at the tempspace. This query runs good for the daily race with Nested loop and the required index, but to run monthly that it changes the plan due to the volume I think and I went for the join of HASH, who believe is good decision by the optimizer.

    AFAIK, the hash join reverse to temp will slow query response time, so I need expert advice, if we increase the pga_aggregate_target so that HASH_AREA_SIZE will be raised to adequate to accommadate the driving table in this? howmuch size and should put us, it should be the same as the size of the array of conduct? or are there other work around the same? Note - the size of the driving table B is "~ 400GB.

    -----------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                      | Name                     | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------------------------------
    |   0 | INSERT STATEMENT               |                          |       |       |       |    10M(100)|          |       |       |
    |   1 |  LOAD TABLE CONVENTIONAL       |                          |       |       |       |            |          |       |       |
    |   2 |   FILTER                       |                          |       |       |       |            |          |       |       |
    |   3 |    HASH JOIN                   |                          |  8223K|  1811M|       |    10M  (1)| 35:30:55 |       |       |
    |   4 |     TABLE ACCESS STORAGE FULL  | A_GT                     |    82 |   492 |       |     2   (0)| 00:00:01 |       |       |
    |   5 |     HASH JOIN                  |                          |  8223K|  1764M|   737M|    10M  (1)| 35:30:55 |       |       |
    |   6 |      PARTITION RANGE ITERATOR  |                          |  8223K|   643M|       |    10M  (1)| 34:18:55 |   KEY |   KEY |
    |   7 |       TABLE ACCESS STORAGE FULL| B                        |  8223K|   643M|       |    10M  (1)| 34:18:55 |   KEY |   KEY |
    |   8 |      TABLE ACCESS STORAGE FULL | C_GT                     |    27M|  3801M|       |   118K  (1)| 00:23:48 |       |       |
    -----------------------------------------------------------------------------------------------------------------------------------
    
    
    

    Find plans by trial and error is not an efficient use of the time - and if it was a good idea to avoid joins and hash, then Oracle have set up their in the first place. I can understand your DBA with a yen to avoid, however, because any spill of a hash for disc often join a (relative) effect much more important than you might expect.  In this case, however, you have a loop nested in A_GT which operates 39M times to access a table of 82 lines index - clearly (a) CPU work to achieve would be reduced if you included table columns in the index definition, but more significantly the cost of CPU of the A_GT/C_GT join would drop if you have built a hash in memory of A_GT table that is not a hash join.

    What you ask for is a description of how to optimize a warehouse of data on Exadata machine - a forum is not the right place for this discussion; all I can say is that you and your databases need to do some testing to find out the best way to match queries to the Exadata has, so keep an eye on queries that produces the application in case of change of usage patterns.  There are a few trivial generalities that anyone could offer:

    (a) partitioning a day is good, so you can ensure that your queries are able to do partitioning to remove only the days where they want; even better is if there is a limited set of partitions that you can

    (b) e/s for joins of large hash spilling to disk can be catastrophic compared to the underlying i/o for tablescans for the first access to the data, which means that simple queries can give the impression that Exadata is incredibly fast (especially when the index the flash cache and storage are effective), but slightly more complex queries are surprisingly slow in comparison.

    (c) once you have passed the flash server cell cache, single block reads are very large and slow - queries that do a lot of single e/s (viz: big reports using nested against randomly scattered data loops joins) can cause very slow IO.

    You must know the data types, know the general structure of your queries, be ready to generate of materialized views for derived complex data and understand the strengths and weaknesses of the Exadata.

    Concerning

    Jonathan Lewis

  • Beginner or questions on statistics?

    I work with an old database (version 8i) which is still in use, but be eliminated and I am experiencing performance problems when querying it. (For the record, I am not the ADMINISTRATOR, I simply query the database data). Usually, for simple queries, the performance are acceptable, except on some larger tables (> 1 million rows). I know that the default optimizer mode is based on rules, but I know that I can use the indicator to choose to force using the CBO. I checked to see when the statistics were generated last for some tables involved in slow queries, and 'last_analyzed' is empty for some of the paintings and more than two years for others (no more recent than the one at all). I guess it's bad. I want to tell someone to fix this problem, but I'd like to at least know what I'm talking about when I ask...

    Then...
    Statistics should be generated for each table or only some?
    Are there restrictions on whether or not the statistics can be generated?
    Are there guidelines on how often of statistics should be generated/how do you know that statistics are too old?
    Statistics can be generated when the database is used? (i.e. the application using the database is to write on it, and people are there access)
    Is there anything else important I should know to intelligently demand to be fixed?

    Just to be clear, the / * + CHOOSE * / suspicion does not force the Oracle to use the CBO. Instead, it forces the optimizer_mode for reporting to CHOOSE. Which, in turn, means that if at least one of the objects in the query has statistics, the CBO will be used. Otherwise, we would use the RBO.

    If the optimizer_mode for instance has been set to the RULE and other applications that the database never change the optimizer_mode (whether by changing the value of their session or through councils or by using one of the structures that will force the CBO to use) access, then collection of statistics is a relatively low risk. Check that no application changes never optimizer_mode for their session or for one of their applications, however, can be a little tricky. I saw a lot of applications that swore to people using only the RBO who suddenly entered the wrong herbs because some developers at some point had written a query that forced the CBO to be used or changed optimizer_mode of the session or something in that sense. So even if everyone expects that the collection of statistics would cause no problem, if you already have fire-fighting people in fashion, they missing you something may be too large to justify the collection of statistics for queries (of course, I do not know how critical your reports are compared to other processes running on the database) It's quite possible that the risk is worth).

    You can force the CBO to use whether or not statistics exist on objects by using the / * + ALL_ROWS * / index (or by changing the to your session at ALL_ROWS optimizer_mode). If an object is not statistical, Oracle dynamically gather statistics during parsing of the query. As I mentioned earlier, which is generally less accurate than to have appropriate statistics, but it is often close enough.

    Justin

  • Questions about CURSOR FOR... LOOP

    Good evening

    In reading the posts here, I came across a number of cases where it was clear that there is no special affection for the cursor for loops.

    I googled... found around articles naming some minor inconveniences, but nothing which would justify the aversion towards them, I noticed here.

    My questions are:

    1. why the cursor for loops so undesirable?
    2. What are alternative fuels?

    Thank you for helping,

    John.

    Published by: 440bx - 11 GR 2 on August 12, 2010 21:23 - plural on the issue and remove superfluous in the subject.

    Hey John,

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:760210800346068768

    Has some good points on the subject.

    Cursor loops are not "bad" per say, but they go against the philosophy of treatment in bulk (unless you do things like increase your cursor with BULK COLLECT and FORALL, that would go to point 2 in your question).

    Basically, when you see a large number of cursor loops you get something like someone writing their own LOOPS IMBRIQUEES join inside pl/sql

    for x in
    (
       select * from table1
    )
    loop
       for y in
       (
          select * from table2 where table2.column1 = x.column1
       )
       loop
    ....
    

    While you could just write a single SQL

       for x in
       (
          select x.columns, y.columns
          from table1 x, table2 y
          where x.column1 = y.column1
       )
       loop
          ....
    

    The former removes a lot of options for optimization of Oracle queries can / could do since he doesn't see s a SQL both. You hit repeatedly table2 (probably via a sweep of index which means that you will get a single block IO as opposed to IO multiples of block that can be done for FULL TABLE SCAN) and remove any chance of Oracle doing the treatment 'fantasy' through things like the HASH JOINS (if the optimizer has determined the request was a good fit for one) etc...

    In general, tie you the hands of the Oracles by dictating treatment rather than run through a whole considerable options to determine the best paths to the data you need.

    You can find much better on the site, AskTom explanations, I hope that this is a decent Preview so :)

    In Oracle 10 and better, Oracle will actually convert an implicit cursor (as I used above) in bulk, with a size of default array of 100 elements (you can measure this easily with a TKPROF and a simple implicit cursor). But that still won't help you much if you write your own nested loops join like I faked it above.

    Published by: Tubby on August 12, 2010 18:51

    Added a little more... too much to say on the subject, and not enough time :)

  • Star schema and snowflake schema

    Hi experts,


    What is the star schema and snowflake schema? What is the difference between them? What is the best?

    Hello

    The scheme must be used for a project BI/DW depends on business/needs. Therotically, a schema is a collection of database objects, including tables, views, indexes and synonyms. You can organize the objects of schema in the schema of models designed for the data warehouse in a variety of ways. Most data warehouses use a dimensional model. Below the two schemas are widely used: -.

    The star patterns *:-the star schema is the simplest scheme of data store. It is called a star schema, because the schema looks like a star, with a Center radiation points. The Star Center consists of one or multiple fact tables and the points of the star are dimension tables. The most natural to model how a data warehouse is like a star schema, where a single join establishes the relationship between the fact table and the dimensiontables. A star schema optimizes the performance of simple queries and providing an answer fast hold time. Information on each level are stored in a row.

    Snowflake patterns *:-the snowflake schema is a data warehouse model more complex that a diagram star and is a schema type star. It is called a snowflake schema, because the schema from the schema looks like a snowflake. Snowflake patterns normalise dimensions to eliminate redundancies. In other words, dimension data has been grouped into several tables instead of a large table. For example, a product in a star schema dimension table could be standard in a products table, a table product_category and a product_manufacturer table in a snowflake schema. While this saves space, it increases the number of dimension tables and requires several foreign key joins. The result is more complex queries and reduces the performance of the queries.

    Hope it help you.

    Atul K,.

  • Effectively reach views with the same underlying objects?

    I have 3 views of the end user, and they all 2 underlying objects in common (1 table, 1 review).

    Example:
    a = table
    b = view
    c - e = support for tables

    View 1:
    Of a, b, c
    WHERE THE...

    View 2:
    Of a, b, d
    WHERE THE...

    View 3:
    Of a, b, e
    WHERE THE...

    Is there a way to allow end users to bring together these 3 points of view while limiting the number of times that the underlying objects are accessible? Ideally, Oracle would have access every underlying object only once by request of the end user, even if all 3 views are used in the query. Oracle is hitting the underlying objects once by the sight of the end user in the query.

    In addition, the underlying view (b) cannot be converted to a materialized view because of the size of the data obtained.

    1 option would be to combine all the columns in the view end user 3 in 1 larger view. However, they currently each have their own use functional and consequently were designed to be separate.

    Thanks for your suggestions.

    The general with this kind of structure problem of the view, it is essentially impossible to the optimizer to know that this table should only be consulted once because the logic in any particular view could exclude a line that another view would return or could cause a single row of has to join several lines in table B. It is generally not possible for the optimizer determine that a query that joins A table in three different views could be rewritten to have a single reference to a rather than an intentional 3-way table A self-join.

    You will find many people who complain the performance of queries that use views not because the views improve intrinsically, but because someone has designed a very generic view layer and apparently simple queries join now to a bunch of tables, they don't really need to get the columns are not referencing or perform some other inexpensive filter which is not really necessary.

    If performance is a problem, you could change the view layer so that users do not have to join three distinct views of which attached to the same table? Or you could allow users to reach the underlying tables for queries that require higher levels of performance?

    Justin

  • Problem with the LG Media Center application

    Hello.
    Sory my English is not very good.

    I have the problem with my LG JM53 8 GB MP4 Player software on my Toshiba laptop L10-192. I canoe convert video files with application included on behalf of LG Media Center: convert the Format. This application does not correct it hang and turns off without reason. I try a lot of things like upgrading drivers widdows but nothings helping. I have windows XP Home SP2, and I thought that's the problem with windows and I activate return of restore cd provided with the laptop to have pure system - but this help too aplication hang again :( He sims as aplication or drivers have some conflicts? Can someone help me? or told me for is to turn this problem? The LG service people do answer my questions.

    Greetings
    Maciej F.

    Hello Maciej

    Problem is that if you use a third party software in case of problems you have to ask the help of the software publisher. I can imagine that LG don t answer and perhaps that they don't deal with simple queries.

    If no one can help you here check it please if you can find some support page or the FAQ section if exist. By the way: you'll be very happy if someone uses the same software.

  • HP 54120 has

    I'm hooked up to an HP 54120 A and I can't seem to connect to it. I have sent simple queries based on the VISA and they all get expired.  Max sees GPIB0::7 and I can choose it as a device ID in LabVIEW. But I can't seem to listen or talk to me. Someone I talked on the phone suggested that I switch the TALK/LISTEN mode on the front panel. All I see is a LOCAL touch and nothing happens when I press it. I have a program that I wrote a year ago and it worked at the time. But someone was playing with the buttons on the scope at the time and there is here no more.

    Use the menu on the Panel before select HPIB > Mode = covered ('someone' probably thought that setting don't mind if she went) or wanted to print on an old plotter

    See page 173

  • Why are all my executeXMLQuery not in SoapUI calls?

    OBIEE 11.1.1.7.140527 under linux.

    SoapUI 5.1.3 running on my Windows 7 laptop.

    Step 1: Call the logon service to authenticate and establish a session:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v6="urn://oracle.bi.webservices/v6">
       <soapenv:Header/>
       <soapenv:Body>
          <v6:logon>
             <v6:name>my_username</v6:name>
             <v6:password>my_password</v6:password>
          </v6:logon>
       </soapenv:Body>
    </soapenv:Envelope>
    

    I get a satisfactory answer in step 1:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:sawsoap="urn://oracle.bi.webservices/v6">
       <soap:Body>
          <sawsoap:logonResult>
             <sawsoap:sessionID xsi:type="xsd:string">cusn6ah4m28ii4oi7a7q305ivrng9e1rsd457oa</sawsoap:sessionID>
          </sawsoap:logonResult>
       </soap:Body>
    </soap:Envelope>
    

    Step 2: Call XMLViewService to run any request BI (I tried many simple BI applications in our catalog, they all fail the same way, see below):

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v6="urn://oracle.bi.webservices/v6">
       <soapenv:Header/>
          <soapenv:Body>
          <v6:executeXMLQuery>
             <v6:report>
                <v6:reportPath>/shared/Demo/Standard Library/Data Analyst/Requests/Account Revenues Trend</v6:reportPath>
                
             </v6:report>
             <v6:outputFormat>SAWRowsetSchemaAndData</v6:outputFormat>
             <v6:executionOptions>
                <v6:async>false</v6:async>
                <v6:maxRowsPerPage>50000</v6:maxRowsPerPage>
               
                <v6:presentationInfo>true</v6:presentationInfo>
             
             </v6:executionOptions>
             
             <v6:sessionID>cusn6ah4m28ii4oi7a7q305ivrng9e1rsd457oa</v6:sessionID>
          </v6:executeXMLQuery>
       </soapenv:Body>
    </soapenv:Envelope>
    

    After trying to do step 2, I get this error returned to SoapUI:

    Error getting response; java.net.SocketTimeoutException: Read Timed out
    

    Then things start to get bad in my environment. I end with the blocked threads and restart services to make them disappear. Here are some log messages relevant I see when the problem occurs:

    Jan 26, 2016 2:58:10 PM EST (Error)
    
    Message ID HTTP-503
    Message Level 1
    REMOTE_HOST 172.20.7.79
    Component ohs1
    Host asicbi01
    Host IP Address 192.168.220.91
    Message 172.20.7.79 - - [26/Jan/2016:14:58:10 -0500] "POST /analytics/saw.dll?SoapImpl=xmlViewService HTTP/1.1" 503 205
    

    Jan 26, 2016 3:03:10 PM EST (Error)
    
    
    
    Message ID OHS-9999
    Message Level 32
    VirtualHost main
    rid 0
    client_id 172.20.7.79
    Relationship ID 0
    Component OHS
    Module core.c
    Host asicbi01
    Host IP Address 192.168.220.91
    User oracle
    Thread ID 140348832077568
    ECID 005A^8QsbbB2vHYVLq6UOA0007O900000l
    Message ap_proxy: trying POST /analytics/saw.dll at backend host 192.168.220.91/9704; got exception 'Backend Server not responding'; state: reading status line or response headers from WLS (wrote? Y read? N); not failing over because method not idempotent
    

    Here's the kicker: if I call ExecuteSQLQuery instead of ExecuteXMLQuery I get a good answer. I even used ExecuteSQLQuery to run the exact logical SQL of the query path that I used in my ExecuteXMLQuery call. I even tried to launch ExecuteXMLQuery to several different requests for BI (all very simple queries that run immediately in the application itself).

    I also have another environment OBIEE, same version and OS, where I can run ExecuteXMLQuery and get a good response.

    Any ideas?

    This problem was caused by him having this line in instanceconfig:

    fake

  • How and why I get lowered note version 4.1 to 3.2 SQL Developer?

    First of all, I must say that I am a newbie.  I know a little SQL to use it on my own over the years to build queries and reports outside the overview of the it Department.  I'm at halfway through the first book Fundamentals SQL for Oracle Database 12 c Certification in the end.

    A week ago when I started this journey, I downloaded Oracle 12 c and later SQL Developer 4.1 and was using SQL Developer 4.1 successfully.  But when I tried to follow the examples of OE and HR in the book of preparation review making simple queries, I had to download the "examples of database" oracle.com/downloads.  I downloaded the zip and run the setup.exe file.  Now, I'm going to open the same exact shortcut, which I had used for SQL Developer 4.1 and it now opens instead of the SQL Developer 3.2!  Why the hell should I suddenly have SQL Developer 3.2 an older version? Has anyone else got a happen to them?  Do you know why it happened to me?  And above all, it won't hurt anything if I returned to oracle.com/downloads and re - download SQL Developer 4.1 the latest version?  Or do I somehow the old version of the SQL Developer to use the HR and OE schemas, tables, and data?

    Thanks for any idea you may have in this weird situation.

    Heather

    You can install as many versions of SQL Developer you want, simply unpack each in its own empty directory.

    "Examples of database" download & install must have diverted your shortcut.  Probably version 4.1 is still installed and you just create a new shortcut.  Better yet, 2 shortcuts: one for version 3.2 and one for version 4.1, as in the names of shortcut 'SQLDev32' and 'SQLDev41 '.

    Edit: Using 3.2 for the examples in the book preparation will be easier because the SQL Developer can change from one version to another and no longer exactly correspond with them.

  • Active low Dataguard performance, compared to Production

    We have 11g R2 RAC as production and Active data guard is autonomous. the structure is almost the same

    a single query takes 15 seconds in the production, where the same query is 54 seconds in Dataguard Active.

    How can I set Active Dataguard.

    Thanks in advance.

    REDA

    Hello

    You can use this tool (Standby Statspack) to optimize the running queries on the database pending. It allows you to generate an AWR and SQL report on the primary database for a query running in standby mode.

    Provides report function SQL with STATSPACK STANDBY and Active Data Guard (Doc ID 1081044.1)

    HTH,

    Pradeep

  • Oracle Text

    Hi gurus/masters.

    Please advise on Oracle Text? I search in google. But getting junk info. Is this feature is there in oracle?

    Concerning

    SA

    This is a change from what I previously provided, its replacement by the table and column names and values that you provided, so that if all goes well it will allow you to understand.  I have also provided the text results simple separate query of the procedure that uses it.  I have shown with a string of values and a unique value, you provided.

    Scott@orcl12c >-table:

    Scott@orcl12c > CREATE TABLE Entitlement_dnt

    2 (order_number VARCHAR2 (15),)

    3 customer_num VARCHAR2 (15).

    4 generic_product_name_ext VARCHAR2 (25).

    5 entitlement_ref_id VARCHAR2 (15).

    6 device_asset_id VARCHAR2 (15))

    7.

    Table created.

    Scott@orcl12c >-data:

    Scott@orcl12c > INSERT ALL

    2 INTO Entitlement_dnt VALUES ('1000345', '342345', ' laptop', '123', 'SDILK143')

    3 INTO Entitlement_dnt VALUES ('1000345', '543243', 'portable', '321', '341KLIDS')

    4 INTO Entitlement_dnt VALUES ('5430001', '342345', ' laptop', '123', 'SDILK143')

    5 SELECT * FROM DUAL

    6.

    3 lines were created.

    Scott@orcl12c > SELECT * FROM Entitlement_dnt

    2.

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID

    --------------- --------------- ------------------------- --------------- ---------------

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    5430001 342345 123 SDILK143 laptop

    3 selected lines.

    Scott@orcl12c >-multi_column_datastore:

    Scott@orcl12c > START

    CTX_DDL 2. CREATE_PREFERENCE ("your_datastore", "MULTI_COLUMN_DATASTORE");

    CTX_DDL 3. SET_ATTRIBUTE

    4 ("your_datastore", "COLUMNS",

    5 "order_number customer_num, generic_product_name_ext, entitlement_ref_id, device_asset_id");

    6 END;

    7.

    PL/SQL procedure successfully completed.

    Scott@orcl12c >-extra column for indexing (optional):

    Scott@orcl12c > ALTER TABLE Entitlement_dnt Add (search_cols VARCHAR2 (1))

    2.

    Modified table.

    Scott@orcl12c >-text index Oracle using multi_column_datastore:

    Scott@orcl12c > your_index CREATE INDEX

    2 on Entitlement_dnt (search_cols)

    3 INDEXTYPE IS CTXSYS. FRAMEWORK

    4 SETTINGS ("your_datastore of the DATA store")

    5.

    The index is created.

    Scott@orcl12c >-simple queries:

    Scott@orcl12c > i_OpenSearchText VARIABLE VARCHAR2 (4000)

    Scott@orcl12c > EXEC: i_OpenSearchText: = 1000345, 342345, laptop, 123, SDILK143'

    PL/SQL procedure successfully completed.

    Scott@orcl12c > SELECT *.

    2 from Entitlement_dnt

    3 WHERE CONTAINS (search_cols, REPLACE (: i_OpenSearchText, ', 'AND' ')) > 0

    6 m

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

    --------------- --------------- ------------------------- --------------- --------------- -

    1000345 342345 123 SDILK143 laptop

    1 selected line.

    Scott@orcl12c > EXEC: i_OpenSearchText: = '1000345'

    PL/SQL procedure successfully completed.

    Scott@orcl12c > SELECT *.

    2 from Entitlement_dnt

    3 WHERE CONTAINS (search_cols, REPLACE (: i_OpenSearchText, ', 'AND' ')) > 0

    6 m

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

    --------------- --------------- ------------------------- --------------- --------------- -

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    2 selected lines.

    Scott@orcl12c >-procedure that accepts the string of values separated by commas

    Scott@orcl12c >- and returns ref cursor using the query:

    Scott@orcl12c > prc_open_search CREATE OR REPLACE PROCEDURE

    2 (i_OpenSearchText IN VARCHAR2,

    3 o_result SYS_REFCURSOR to)

    4 AS

    5 BEGIN

    6 - slider Ref that uses Oracle Text query using wil Oracle text index:

    7 OPEN FOR o_result

    8. SELECT *.

    9 OF Entitlement_dnt

    10 WHERE CONTAINS (search_cols, REPLACE (i_OpenSearchText, ', 'AND')) > 0;

    11 END prc_open_search;

    12.

    Created procedure.

    Scott@orcl12c > SHOW ERRORS

    No errors.

    Scott@orcl12c >-execution:

    Scott@orcl12c > g_ref VARIABLE REFCURSOR

    Scott@orcl12c > START

    2 prc_open_search

    3 (i_OpenSearchText-online 1000345, 342345, laptop, 123, SDILK143',)

    4 o_result =>: g_ref);

    5 END;

    6.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > g_ref PRINT

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

    --------------- --------------- ------------------------- --------------- --------------- -

    1000345 342345 123 SDILK143 laptop

    1 selected line.

    Scott@orcl12c > START

    2 prc_open_search

    3 (i_OpenSearchText-online '1000345',

    4 o_result =>: g_ref);

    5 END;

    6.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > g_ref PRINT

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

    --------------- --------------- ------------------------- --------------- --------------- -

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    2 selected lines.

  • [SQL] Tuning why he can't use indexes?

    Here's a SQL that cannot use indexes

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T.FNUMBER ('1410582816' N)) OR (T1.) CFCUSTOMERTRANSNUMBER (N '1410582816')));

    Elapsed time: 00:00:12.15

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2925502694

    ------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | TempSpc | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                 |     2.   420.       | 48996 (3) | 00:01:16 |       |       |

    |   1.  NESTED EXTERNAL LOOPS |                 |     2.   420.       | 48996 (3) | 00:01:16 |       |       |

    |*  2 |   FILTER |                 |       |       |       |            |          |       |       |

    |*  3 |    EXTERNAL RIGHT HASH JOIN |                 |     2.   310.    67 M | 48995 (3) | 00:01:16 |       |       |

    |   4.     RANGE OF PARTITION ALL THE |                 |  1241K |    53 M |       | 36422 (3) | 00:00:57 |     1.    63.

    |   5.      TABLE ACCESS FULL | CT_OPE_WAYBILL |  1241K |    53 M |       | 36422 (3) | 00:00:57 |     1.    63.

    |   6.     TABLE ACCESS FULL | CT_OPE_SIGNBILL |   907K |    95 M |       |  8217 (5) | 00:00:13 |       |       |

    |   7.   TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER |     1.    55.       |     1 (0) | 00:00:01 |       |       |

    |*  8 |    INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |       |     1 (0) | 00:00:01 |       |       |

    ------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 - filter("T".") FNUMBER ' = U ' 1410582816 "OR 'T1'. '. CFCUSTOMERTRANSNUMBER '= U '1410582816')

    3 - access("T1".") IDF"(+) ="T ". ("' CFWAYBILLID")

    8 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    19 db block Gets

    234698 compatible Gets

    191546 physical reads

    0 redo size

    1035 bytes sent via SQL * Net to client

    524 bytes received via SQL * Net from client

    2 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    1 rows processed

    but, if I rewrite it as below, it can use indexes

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T.FNUMBER (N '1410582816')))

    Union

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T1. CFCUSTOMERTRANSNUMBER (N '1410582816')));

    Elapsed time: 00:00:00.02

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2215743926

    -----------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                     | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    -----------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                          |     2.   420.    11 (64) | 00:00:01 |       |       |

    |   1.  UNIQUE FATE |                          |     2.   420.    11 (64) | 00:00:01 |       |       |

    |   2.   UNION-ALL |                          |       |       |            |          |       |       |

    |   3.    NESTED EXTERNAL LOOPS |                          |     1.   210 |     4 (0) | 00:00:01 |       |       |

    |   4.     NESTED EXTERNAL LOOPS |                          |     1.   155.     3 (0) | 00:00:01 |       |       |

    |   5.      TABLE ACCESS BY INDEX ROWID | CT_OPE_SIGNBILL |     1.   110.     2 (0) | 00:00:01 |       |       |

    |*  6 |       INDEX RANGE SCAN | IDX_CT_OPE_SIGNBILL_IT01 |     1.       |     1 (0) | 00:00:01 |       |       |

    |   7.      TABLE ACCESS BY INDEX ROWID | CT_OPE_WAYBILL |  1241K |    53 M |     1 (0) | 00:00:01 | ROWID | ROWID |

    |*  8 |       INDEX UNIQUE SCAN | CPK_OPE_WAYBILLBP7 |     1.       |     1 (0) | 00:00:01 |       |       |

    |   9.     TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER | 25598 |  1374K |     1 (0) | 00:00:01 |       |       |

    | * 10 |      INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |     1 (0) | 00:00:01 |       |       |

    |  11.    NESTED LOOPS |                          |     1.   210 |     5 (0) | 00:00:01 |       |       |

    |  12.     NESTED EXTERNAL LOOPS |                          |     1.   100.     4 (0) | 00:00:01 |       |       |

    |  13.      TABLE ACCESS BY INDEX ROWID | CT_OPE_WAYBILL |     1.    45.     3 (0) | 00:00:01 | ROWID | ROWID |

    | * 14 |       INDEX RANGE SCAN | IDX$ $_47CB0003 |     1.       |     2 (0) | 00:00:01 |       |       |

    |  15.      TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER |     1.    55.     1 (0) | 00:00:01 |       |       |

    | * 16.       INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |     1 (0) | 00:00:01 |       |       |

    |  17.     TABLE ACCESS BY INDEX ROWID | CT_OPE_SIGNBILL |     1.   110.     2 (0) | 00:00:01 |       |       |

    | * 18.      INDEX RANGE SCAN | IDX$ $_47C30001 |     1.       |     1 (0) | 00:00:01 |       |       |

    -----------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    6 - access("T".") FNUMBER "= U '1410582816')

    8 - access("T1".") IDF"(+) ="T ". ("' CFWAYBILLID")

    10 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    14 - access("T1".") CFCUSTOMERTRANSNUMBER '= U '1410582816')

    16 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    18 - access("T1".") IDF '=' T '. ("' CFWAYBILLID")

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    Gets 11 coherent

    0 physical reads

    0 redo size

    1035 bytes sent via SQL * Net to client

    524 bytes received via SQL * Net from client

    2 SQL * Net back and forth to and from the client

    1 sorts (memory)

    0 sorts (disk)

    1 rows processed

    SQL >

    My Question is why the first statement cannot use indexes? What is its mechanism?

    as Maria Colgan explains in his commentary on https://blogs.oracle.com/optimizer/entry/or_expansion_transformation: "since OR expansion is a transformation focused on costs, it cannot always take place." It cannot take place, then it can be forced by using the indicator, USE_CONCAT. "Fundamentally OR expansion is

    a transformation that can be used to optimize the disjunctive queries (queries that contain clauses of GOLD). The basic idea of in the expansion of the GOLD is to transform a query containing the disjunctions in the form of a query UNION ALL of two or more branches. This is done by dividing the disjunction in components and by associating each component with a branch of a query UNION all.

    So, you can use the USE_CONCAT flag to check if OR expansion is an option at all for the optimizer in your example. The strategy itself is quite old and mentioned by Tom Kyte in https://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:921229345078.

Maybe you are looking for

  • How to switch from firefox to its own directory?

    I had to use Chrome to install Firefox and it get program_files automatically. I need in its own directory - can I move it?

  • How to transfer phone contacts from my Huawei phone to my iPhone 5 s

    How to transfer contacts from my phone android from Huawei to my new iPhone 5 s?

  • Preview the files appear at startup unwanted

    At startup, the application overview charge and maintains a library on the desktop file.  Each time I leave Preview to clear the screen. How can I stop to load at startup? This is an iMac of 2998 early with ElCapitan.  The problem started after I upg

  • Rapid decline question

    I use fast down a bit lately.  I use CTRL + Space keys, CTRL + I to insert the screws in the existing threads, but time ago were it's faster for me to slide the screw from the palette on the block diagram. Someone at - it a rapid drop plugin that all

  • Problem with release semaphore reference

    I wrote a simple routine to try to understand the functioning of semaphores (see the attached vi).  In this routine, I have 2 LEDs I want to Flash for 5 seconds each (independently of each other).  I assumed that the operation would be the same regar