Table of $ OBJ is locked during the query

When we run the following script in Oracle 10 g R2 on Linux:
CREATE TABLE AUDIT_TMP TABLESPACE CIL_DATA AS 
SELECT * FROM AUDIT 
WHERE CREATION_TIME BETWEEN ADD_MONTHS(SYSDATE,-2) AND SYSDATE;
Then the table $ OBJ is locked.
SQL> select object_id, session_id, oracle_username, process, locked_mode from  sys.v_$locked_object;
OBJECT_ID SESSION_ID ORACLE_USERNAME                PROCESS      LOCKED_MODE
---------- ---------- ------------------------------ ------------ -----------
18        281 SYS                            11460                  3
SQL>
SQL>
SQL> select object_name from dba_objects where object_id = '18';
OBJECT_NAME
------------------------------------------------------------------------------------------------------------------------
OBJ$
Can someone tell me like why OBJ$ table is locked. Is this a normal behavior?

Simplistically: A SQL uses one or more SQL objects (tables, indexes, etc.). A SQL must therefore place a lock of data shared on the object, dictionary use, to prevent someone from edit this object (detached, update its definition, evolution, etc.).

Think of it as a protection mechanism - for example the SQL cannot run on a table when another session suddenly drops a column of this table that uses SQL as a filter condition. Therefore the shared - lock to prevent the table change it if it is in use.

Similarly, a change in the data dictionary (create table, alter table, etc.) must also be blocked when you change an object. However, this technique requires an exclusive lock in order to update this object in the data dictionary. Which means THAT DDL must wait a DML on the object to complete, before the DOF can update the definition of the object. And a DML will have to wait a DDL if DDL is busy changing the purpose of the DML want to use.

Tags: Database

Similar Questions

  • Locking during the generation and the online option to avoid problems

    Hi Experts,

    In our suite of applications, schemas are shared among several applications, and even when there is a deployment of an application, the other application remains upward. In this process, we are facing problems of locking. For example, when creating indexes, I get the error "resource busy and acquired with no expectations. This post is specific to this point on error when creating index (change the design of the app etc is out of reach for me currently).

    I was checking the "online" option of create index and I was wondering if that helps. It looks promising for me. When we have large tables (50 million more and creating indexes on them takes about 5 minutes and at the same time we have another app doing short transactions - who commit in 5 seconds, then creating index 'with the option' can help - is what I was asking.)

    Here is an example of what I've tried:

    -- first create a table with a few million rows:
    
    SET SERVEROUTPUT ON
    
    DECLARE
      v_sql VARCHAR2 (200);
    BEGIN
      v_sql := 'create table test as select * from dba_objects';
    
      EXECUTE IMMEDIATE v_sql;
    
      FOR i IN 1 .. 5
      LOOP
      v_sql := 'insert into test select * from test';
    
      EXECUTE IMMEDIATE v_sql;
    
      COMMIT;
      END LOOP;
    END;
    /
    
    --Now in session 1:
    ---------
    
    
    create index ti1 on test(OWNER,OBJECT_NAME,SUBOBJECT_NAME,OBJECT_ID,DATA_OBJECT_ID,OBJECT_TYPE,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS,TEMPORARY,GENERATED,SECONDARY,NAMESPACE)
    online;
    
    session 2:
    ------------
    DELETE FROM TEST WHERE ROWNUM<1000;
    
    commit;
    
    DELETE FROM TEST WHERE ROWNUM<40200;
    rollback;
    
    --etc.
    

    I find that deletions, etc. in the second session is done (they follow by commit and they take a few seconds) with this option 'create an index online '. The option 'create index' is also no error with the error ORA-«resource busy...» ». So what a better way to create indexes to avoid locking issues? Note that is is very good for us to have the creation of index take more time for what's important is that they are not lacking in critical production deployments.

    Are there other possible implications (-except that it takes more time to create the index with the option 'online'), that one should be aware of? Any known issues or is there any other glitches with the creation of online index?

    I will be grateful for any views on that.

    What is your version of DB full?

    In our suite of applications, schemas are shared among several applications, and even when there is a deployment of an application, the other application remains upward. In this process, we are facing problems of locking. For example, when creating indexes, I get the error "resource busy and acquired with no expectations.

    OK-, this exception is not surprising. To create or rebuild an index, Oracle has a lock on the base table. He can't do that if other users perform DML on the table - it must wait.

    And before 11 g ANY other session that then tries to perform DML on the base table that oracle wait will also block.

    I was checking the "online" option of create index and I was wondering if that helps.

    Well, if you do not use the clause of 'ONLINE' you must do that maintenance CONNECTION or you now cause other sessions cling while creating/reconstruction is made;

    It looks promising for me. When we have large tables (50 million more and creating indexes on them takes about 5 minutes and at the same time we have another app doing short transactions - who commit in 5 seconds, then creating index 'with the option' can help - is what I was asking.)

    Yes - it should help. But he cannot eliminate the problem entirely.

    See this article by the Index indicated Richard expert Foote (there are many other related articles index also):

    https://richardfoote.WordPress.com/2008/02/11/index-create-and-rebuild-locking-improvements-in-11g-ch-ch-ch-changes/

  • Coordination of detail during the query mode

    Forms 11g

    I have a relationship of the master / detail, details of autoquery. the two blocks are displayed several records. I want to show a flag value (and the color attribute) next to the master if he got to the detail records.

    To do this, I coded it in the post of the block in detail, because I wanted to avoid the questioning of the secondary table twice (one in the master post-requete and secondly in the population of retail block).

    When running I run the query for the master, but the detail does not seem to be queried for all the record questioned captain. My tracking after request works only for the selected record of the master.

    Is this normal? Is coordination suspended unless you are in NORMAL mode?

    Yes, it comes to the features of normal forms.  To highlight each master record based on if are detail records, you must query the table Details in the trigger of the Master post-requete.

    You could simplify this by creating a database function that returns a TRUE/FALSE value rather than to perform a COUNT (*) SELECT your trigger after request.  Then your trigger after query is simply:

    BEGIN
      If ( YOUR_DB_FUNCTION = TRUE ) THEN
         Set_Item_Instance_Propety('YOUR_BLOCK',CURRENT_RECORD,PROPERTY,PROPERTY_VALUE);
      END IF;
    END;
    

    Craig...

  • How can I filter a table of data control without entering the query

    I have a table from a WSDL-based web service data control.

    I want to filter the table without input query in the filter text box. Without text filter box, each could filter the table with a query hardcoded internally.
    For example, when the user menu button click and then it filters the table where type = '1' and B menu button filters the table by type = '2' and C menu button filters the table by type =' "."

    How can I filter the table without entering the query?

    Could someone point me to a solution please.

    Thank you.
    11.1.5 jdev

    Published by: 893364 on October 26, 2011 12:15

    Published by: 893364 on October 26, 2011 12:21

    Hello

    When you have created the table, have you tried selecting the option "filter". Select the table, and access the property of m.. In the toolbar of the Properties Inspector, there is an icon to change the configuration. His fields of filter adding filter for the user to search in.

    Option 2: Data from the Web Service are actually held in iterators. If you want to filter the Web service request, I wouldn't use the WS domain controller but a proxy of JAX - WS in a POJO to recover data from the WS. Then the data control created from the POJO. You might have a method exposed on the POJO which allows you to filter the data internally that is held

    Frank

  • Table does not exist error during the creation of a procedure

    The query runs and recover files but when the query is in a procedure, the procedure is in error (4/30 PL/SQL: ORA-00942: table or view does not exist) when creating. The snurk_cmms_csht008_rfs_misc is a public synonym with reference to the db2 database. How to do the procedure to get created?

    SQL > CREATE PROCEDURE TEST AS
    2. I VARCHAR2 (20);
    3 BEGIN
    4. SELECT CD_PLANT IN I snurk_cmms_csht008_rfs_misc FROM
    5. WHERE ROWNUM < 2;
    6 END;
    5 m

    CAUTION: Procedure created with compilation errors.

    SQL > SHOW ERRORS;
    SURGICAL errors:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    4/2 PL/SQL: statement ignored
    4/30 PL/SQL: ORA-00942: table or view does not exist

    SQL > SHOW USER;
    The USER is 'ORDV_SRC '.


    SQL > SELECT CD_PLANT FROM snurk_cmms_csht008_rfs_misc WHERE ROWNUM < 2;

    CD_PL
    -----
    AP01A


    Thank you
    Vinodh

    Look for the grant on the table. He must be given a ROLE and if so, then, you must have direct subsidies on the table to use only it in PL/SQL.

  • FRM - 40212 / FRM - 40222 error on a radio during the query group

    Hi all

    This is my first post, so please bear with me if I did not provide enough information or am not clear at all.

    I use Forms Builder (Web) on a 10g database. I have a number of databases and elements non-base of data as part of a block of data.
    My problem is that when I enter a value in a field and click the query button, I have an invalid value FRM-40212 for error field on my radio group (section disabled, non-base of data, which is populated by programming in the triggers of post requests and amended list only). When I click ok, I get an error of FRM-40222 disabled point Validation failure on the same radio group.

    This does not happen if I click on the button "Enter the query" before you enter values in the fields, but I don't want my users to encounter this error if they try to interrogate without clicking "Enter the query" first.

    I would like to know why exactly this error happens - what it means?
    I read in other forums that setting the required article property to false solves this problem. But how can I do this with a group of radio buttons? And if it is not possible, anyone have any suggestions for other workaround solutions?

    Thanks in advance,

    Abigail

    Hello

    You can avoid this by defining "Mapping of other values" to a fo value of radio buttons. As if you need to radio radio1 and radio2 associated group R1 radio button, then set the option buttons the initial value of this property to 'Mapping of other values' radio button R1. You will not see this error.

    This error occurs because as your loading a screen without assigning a value to the option button.

    If this helps brand question as answer or useful.

    Thank you
    Pavan.

  • ORA-28000 account locked during the creation of database (grid with asm on standlone server infrastructure)

    My Details of the operating system environment:

    OEL 6.5 64-bit

    Database version: 11.2.0.4.

    I have set up my lab for the infrastructure of grid with ASM on Stand alone server. Everything was going well with no error. My ASM Diskgroup is mounted, State resource t crsctl shows everything online, also I can connect using sys / as sysasm, my interlocutor is up and running for ASM, creating database using DBCA it gives an error 'ORA-28000 account locked' I'm confused which account is blocked because I have not yet created a data base.  Help, please

    Thank you

    Sunil

    Hello

    Add the dba group to the oracle user.

    And try again

    Best regrads

  • [JDev12.1.2, ADF] "Query with table Panel": how to auto - close the query Panel when the search ends?

    Hallo,

    I would like the Panel request auto - closes when the search is complete.

    This is to give all the space for the result in the talbe.

    How can I achieve this?

    Thank you

    Federico

    Federico,

    to do this, replace the queryListener one leave this point of a bean method. In this method, you run the processQuery by default and after that set the attribute to disclose the af:query component to false and ppr.

    {} public void processQuery (QueryEvent queryEvent)

    The generated QueryListener replaced by this method

    #{bindings. MyAllCriteriaQuery.processQuery}

    QueryDescriptor qdes = queryEvent.getDescriptor ();

    print or save the view criteria

    System.out.println ("NAME" + qdes.getName ());

    appeal by default query event

    {invokeQueryEventMethodExpression ("#{bindings.", QueryEvent "}") MyAllCriteriaQuery.processQuery};

    Object UIComponent = queryEvent.getSource () (UIComponent);

    Riq RichQuery = object (RichQuery);

    riq.setDisclosed (false);

    AdfFacesContext.getCurrentInstance () .addPartialTarget (riq);

    }

    Private Sub (string expression, QueryEvent queryEvent) invokeQueryEventMethodExpression {}

    FacesContext fctx = FacesContext.getCurrentInstance ();

    ELContext elctx = fctx.getELContext ();

    ExpressionFactory efactory = fctx.getApplication () .getExpressionFactory ();

    MethodExpression = me efactory.createMethodExpression (elctx, expression, Object.class, new class [] {QueryEvent.class});

    me. Invoke (elctx, new Object() {queryEvent});

    }

    and on the page

    model = ' #{bindings. " MyAllCriteriaQuery.queryModel}"queryListener =" #{QueryTestBean.processQuery} ' "

    queryOperationListener = ' #{bindings. " "MyAllCriteriaQuery.processQueryOperation}" resultComponentId =": resId1" / >

    Timo

  • Are tables autom. (if any) created during the import with impdp.exe?

    Just another question regarding the process of impdp.exe.

    Suppose that a table is dropped after the previous export operation (expdp.exe) (for the full database)
    Now I perform an import operation (impdp.exe).
    This table is automatically created again?

    What about users (patterns)? They are automatically created if they are in the dumpfile, but
    not found in the target database?

    Peter

    Published by: user559463 on February 9, 2010 07:21

    schemas will be created automatically only when you import lots.
    tables will be created either you do complete / schema / table level import.

    You can give a try test env

  • Computer HP mini: mini Hp locked during the boot

    I have hp mini piece at a yard sale it has a password then I press start 3 times and stopped system CNU8521J90

    Hello:

    Enter the unlock code...

    e9luq73wo1

  • ORA-25401 cannot continue error extraction during the 2nd test of passage for the customer

    Hi, I finally pulled out straight and everything works fine.

    Purpose of test, I ran a very long query in the form: select * from user.longtable and in the Middle I made a switch to the hysdev. The session stops seconds and then switch to the query. I also tested by smon kill remedev in the middle of the query, and the sesion will be able to pause and continue.

    But after the 1st pass and I did another pass back to hydev, it will be given an error: ora-25401 cannot continue extraction error.

    How to solve this problem?

    I tested the failover and during the query, I killed smon on primary, he'll give me the same error.

    Can someone tell me how to solve this problem? Or the world has experienced before?

    Thank you

    Published by: 846422 on December 19, 2011 08:22

    Published by: 846422 on December 19, 2011 08:22

    Hello;

    Wow great progress on your system!

    There are a couple of notes on this Oracle:

    Parallel queries and failover of transparent applications (TAF) [ID 784150.1]

    What are Oracle (TAF events) errors to be handled by switching CARS [337178.1 ID]

    Best regards

    mseberg

    Really hard question! All I can find is "have rerun the statement." Not the answer you are looking for.

    Published by: mseberg on December 19, 2011 10:13

  • Extend the VO - need to change the query of VO - screen is off

    {Re-post the message in this forum (thanks to John Stegeman to lead me here...)   {Posted: August 28, 2009 04:27}

    Dear all,

    Thanks to this great body of knowledge, I ask my questions.

    I need to extend a VO to display the name of the country.
    The column is not in the VO. So, I need to get another table: FndTerritories

    I want to change the query, but the request frame is turned off (in the wizard the View - step 5 of 6 - Generated statement object substitution)

    Could you be it someone please let me know: how to change the application of the VO in this case?

    OR is there another solution for such cases, to maintain development standards

    Thank you very much

    Kind regards

    Hello

    I think that's when you just have to add an attribute, you should not click the expert mode checkbox... make use of
    Mix and add the button.

    But when you need to modify the query, and then we want to use to modify the query window...

    Thank you
    Gerard

  • During the ETG Table lock

    Hello

    I want to clone a table in our database. Version: 11.2.0.4


    Test case:

    CREATE TABLE test_1

    (IDENTIFICATION NUMBER)

    /

    INSERT INTO test_1 (id) values (5);

    COMMIT;

    Now-> I want to start cloning from the table. BUT! After cloning, I must write off line-counts of the original and cloned table. (simple audit)

    To avoid any DML operation during cloning I lock the table in exclusive mode.

    Test_1 in MODE EXCLUSIVE TABLE LOCK.

    -> Now I start the operation of the ETG

    -> DDL's implicit VALIDATION here

    CREATE TABLE test_clone

    AS

    SELECT * from test_1

    /

    -> DDL's implicit VALIDATION here too

    -> Here would be County-parts to start... (The Original County and County of Clone)

    Problem: My DDL statement makes two implicit commits-> first before the DDL and second after the DDL.

    So, in this case the lock on the original table will be released before cloning could begin. --> During a long race THAT DEC can other data manipulations arrive on the original of another session table.

    And in this case if I count the original and the clone table lines I can get a different result.

    Do you know a solution for this?

    -> I can't start a procedure or a second session-> This cloning is done in a DB-Patch which we deliver to DBA.

    -> I can only run an anonymous pl/sql block

    -> In fact, I don't want to use the INSERT INTO (append)... because an ETG is faster and I want to know if there could be a solution for this problem with the DDL.

    I thought to create a trigger on the original table that fires if a DML arrived-> but what happens if a DBA ends the script... then this trigger there. So, I would avoid this change in structure.

    How I could lock the original table so that I can run a DDL in the same session after it without to release the lock on the original table? -> I don't think that would work, but you may know...

    Thanks in advance!

    In fact, I wanted to know if if it was very important how it could be solved. -> In my case, it would have been good to get to know a solution said that maybe I don't know yet.

    A better solution IMHO and the most common way to do it is just put the table in READ ONLY mode.

    ALTER TABLE myTable READ ONLY

    ... do the ETG

    In general, there are many more controls to perform AFTER the operation than just the count of lines. These controls can should be performed by multiple sessions/users for an autonomous transaction will not help you here.

    Reading using only keep data available without him to be changed. You can then rename the original table to keep data online for a period of time or to allow time for it to be saved.

  • How to see the lock on the table and query?

    Hi all
    How do we see the lock on the table and query?


    Thank you
    Rafi

    Yes Rafi,

    It works fine at my end... see below:

    Opening of Session 1 with scott/tiger and:
    setting a day emp set ename = 'xx' where empno = 7499;

    Opening of Session 2 with scott/tiger and:
    setting a day emp set ename = 'xx' where empno = 7499;
    > This session is locked by a superior.

    Open 3 Session with pw/sys as sysdba and:

    SQL> set serveroutput on
    SQL> BEGIN
      2  dbms_output.enable(1000000);
      3  for do_loop in (select session_id, a.object_id, xidsqn, oracle_username, b.owner owner,
      4  b.object_name object_name, b.object_type object_type
      5  FROM v$locked_object a, dba_objects b
      6  WHERE xidsqn != 0
      7  and b.object_id = a.object_id)
      8  loop
      9  dbms_output.put_line('.');
     10  dbms_output.put_line('Blocking Session : '||do_loop.session_id);
     11  dbms_output.put_line('Object (Owner/Name): '||do_loop.owner||'.'||do_loop.object_name);
     12  dbms_output.put_line('Object Type : '||do_loop.object_type);
     13  for next_loop in (select sid from v$lock
     14  where id2 = do_loop.xidsqn
     15  and sid != do_loop.session_id)
     16  LOOP
     17  dbms_output.put_line('Sessions being blocked : '||next_loop.sid);
     18  end loop;
     19  end loop;
     20  END;
     21  /
    .
    Blocking Session : 139
    Object (Owner/Name): SCOTT.EMP
    Object Type : TABLE
    Sessions being blocked : 134
    
    PL/SQL procedure successfully completed.
    

    HTH
    Girish Sharma

  • Slow index by using the query. Fast with full table Scan.

    Salvation;

    (Thanks for the links)

    Here's my question correctly formatted.

    The query:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') )   
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    Works on 32 seconds!


    Same query, but with an extra where clause:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    and  ( (ec.contextVersion = 'REALWORLD')     --- ADDED HERE
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )  
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    This is 400 seconds.

    It should return data from a table, given the conditions.

    The database version is Oracle9i Release 9.2.0.7.0

    These are the parameters relevant for the optimizer:
    SQL> show parameter optimizer
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    optimizer_dynamic_sampling           integer     1
    optimizer_features_enable            string      9.2.0
    optimizer_index_caching              integer     99
    optimizer_index_cost_adj             integer     10
    optimizer_max_permutations           integer     2000
    optimizer_mode                       string      CHOOSE
    
    SQL> 
    Here is the output of the PLAN to EXPLAIN for the first quick query:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
    --------------------------------------------------------------------------------
    | Id  | Operation                     |  Name               | Rows  | Bytes | Cost  |
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |                         |           |       |       |
    |   1 |  SORT AGGREGATE       |                         |           |       |       |
    |*  2 |   TABLE ACCESS FULL   | EHCONS            |       |       |       |
    --------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
       2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE"
                  IS NULL AND "EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy
    -mm-dd
    
                  hh24:mi:ss') AND "EC"."TYPE"='BAR')
    
    Note: rule based optimization
    Here is the output of the EXPLAIN of PLAN for slow queries:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       |       |
    
    |   1 |  SORT AGGREGATE              |                             |       |
       |       |
    
    |*  2 |   TABLE ACCESS BY INDEX ROWID| ehgeoconstru      |       |
       |       |
    
    |*  3 |    INDEX RANGE SCAN          | ehgeoconstru_VSN  |       |
       |       |
    
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE" IS
     NULL AND "EC"."TYPE"='BAR')
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       3 - access("EC"."CONTEXTVERSION"='REALWORLD' AND "EC"."BIRTHDATE"<=TO_DATE('2
    009-10-06
    
                  11:52:12', 'yyyy-mm-dd hh24:mi:ss'))
           filter("EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy-mm-dd hh24:
    mi:ss'))
    
    
    Note: rule based optimization
    The TKPROF output for this slow statement is:
    TKPROF: Release 9.2.0.7.0 - Production on Tue Nov 17 14:46:32 2009
    
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    
    Trace file: gen_ora_3120.trc
    Sort options: prsela  exeela  fchela  
    ********************************************************************************
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing 
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    ********************************************************************************
    
    SELECT count(1)
    from ehgeoconstru  ec
    where ec.TYPE='BAR'
    and  ( (ec.contextVersion = 'REALWORLD')
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )
    and deathdate is null
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.00     538.12     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          1  SORT AGGREGATE 
      27747   TABLE ACCESS BY INDEX ROWID OBJ#(73959) 
    2134955    INDEX RANGE SCAN OBJ#(73962) (object id 73962)
    
    ********************************************************************************
    
    alter session set sql_trace=true
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.02          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        1      0.00       0.02          0          0          0           0
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    
    
    ********************************************************************************
    
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.02          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        5      0.00     538.15     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    
    
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        0      0.00       0.00          0          0          0           0
    
    Misses in library cache during parse: 0
    
        2  user  SQL statements in session.
        0  internal SQL statements in session.
        2  SQL statements in session.
    ********************************************************************************
    Trace file: gen_ora_3120.trc
    Trace file compatibility: 9.02.00
    Sort options: prsela  exeela  fchela  
           2  sessions in tracefile.
           2  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           2  SQL statements in trace file.
           2  unique SQL statements in trace file.
          94  lines in trace file.
    Published by: PauloSMO on November 17, 2009 04:21

    Published by: PauloSMO on November 17, 2009 07:07

    Published by: PauloSMO on November 17, 2009 07:38 - title changed to be more correct.

    Although your optimizer_mode is choosing, it seems that there are no statistics collected on ehgeoconstru. The absence of estimated costs and estimated row counts of each of the stages of the plan and the "Note: optimization based on rules" at the end of these two plans would tend to confirm this.

    Optimizer_mode choose means that if statistics are collected then it will use the CBO, but if no statistic is present in any of the tables in the query, the optimizer to rule will be used. The RBO tends to be happy in the best of the index case. I guess the index ehgeoconstru_VSN contextversion as the main column and also includes the date of birth.

    You can either gather statistics on the table (if all other tables have statistics) using dbms_stats.gather_table_stats, or suggest the query to use a full scan instead of index. Another solution would be to apply a function or an operation against the contextversion to prevent the use of the index. something like this:

    SELECT COUNT(*)
    FROM ehgeoconstru  ec
    WHERE ec.type='BAR' and
          ec.contextVersion||'' = 'REALWORLD'
          ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') and
          deathdate is null and
          SUBSTR(ec.strgfd, 1, LENGTH('[CIMText')) <> '[CIMText'
    

    or maybe UPPER (ec.contextVersion) so that would not change the rows returned.

    John

Maybe you are looking for

  • ICloud email is unusably slow on all devices, including IOS

    Hello In the last few weeks, I noticed that icloud is ridiculously slow to deal with requests for access by email.  This is true on my iPhone 6, my old iPad, my Mac and my PC using Outlook as a front end. Moving or deleting an email takes more than 2

  • Uninstall Office 2007 trial version

    My Satellite A200 came with a trial version of Office 2007 which I don't want. It seems not even have installed correctly when Word is open it comes up with an error of installation. Word works after the error message has been closed. I installed my

  • Is the ban for the compatible with the X 220 X 230?

    Hello! I was wondering if the ban for the X 230 (type 4338) is compatible with the X 220. Thank you!

  • HP pavilion 500 - 101l driver

    I'll find driver win7 64 bit for pavilion hp 500 - 101lHelp me pleaseThank you

  • Envy 15 t-j100 card reader does not

    I have a HP ENVY 15 t-j100 Quad Edition running Windows 7. His card reader does not work. When I insert an SD card, I get a message that the device is not installed correctly. Windows prompts you to update me the driver, so I let him, but he can't fi