ORA-00904 with bitmap indexes

Hi,
I'm running the following query:
SELECT
FLOW.PRODUCT_CODE,
FLOW.CUSTOMER_SK,
FLOW.BRAND_SK,
26,
FLOW.MPR_SK
FROM     
RSB_FACT_FLOW_SD          FLOW,
RSB_DIM_FLOW               DIM
WHERE     
FLOW.FLOW_SK     = DIM.FLOW_SK
AND     DIM.FLOW_ID                = 'CFRD'
AND     FLOW.PRODUCT_CODE          = 'G'
AND     FLOW.FLOW_DATE                >= '01 JAN 2006'
AND     FLOW.FLOW_DATE                <= '31 JAN 2006'
AND     EXISTS
     (     SELECT     1
          FROM     RSB_FACT_FLOW_SD          A,
               RSB_DIM_FLOW          B
          WHERE     
          A.MPR_SK     = FLOW.MPR_SK
     AND A.RECEIVED_DATE >= FLOW.RECEIVED_DATE
          AND     B.FLOW_SK= A.FLOW_SK
          AND     B.FLOW_ID= 'WAO2'
          AND      A.REASON= '02CRO'
I get ORA-00904: "FLOW"."RECEIVED_DATE": invalid identifier
This is the defintion of the table:
CREATE TABLE RSB_FACT_FLOW_SD
PRODUCT_CODE CHAR(1) NOT NULL,
WEEK_END_DATE DATE NOT NULL,
CUSTOMER_SK NUMBER(10) NOT NULL,
CUSTOMER_ATTRIBUTE_SK NUMBER(10) NOT NULL,
MPR_SK NUMBER(10) NOT NULL,
MPR_PROFILE_SK NUMBER(10) NOT NULL,
SPECCOND_PROFILE_SK NUMBER(10) NOT NULL,
BRAND_SK NUMBER(10) NOT NULL,
FLOW_SK NUMBER(10) NOT NULL,
FLOW_DATE DATE,
RECEIVED_DATE DATE,
VALIDATION_STATUS CHAR(1),
FLOW_TYPE CHAR(1),
RECEIVED_FROM_SENT_TO VARCHAR2(4),
REASON VARCHAR2(255),
FLOW_SEQUENCE NUMBER,
CUSTOMER_SEGMENT_SK NUMBER(10),
BRAND_PARTNER_SK NUMBER
TABLESPACE DW_DATA
PCTUSED 90
PCTFREE 0
PARALLEL
LOGGING;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX01 ON RSB_FACT_FLOW_SD
(PRODUCT_CODE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX02 ON RSB_FACT_FLOW_SD
(WEEK_END_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX03 ON RSB_FACT_FLOW_SD
(CUSTOMER_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX04 ON RSB_FACT_FLOW_SD
(CUSTOMER_ATTRIBUTE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX05 ON RSB_FACT_FLOW_SD
(MPR_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX06 ON RSB_FACT_FLOW_SD
(MPR_PROFILE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX07 ON RSB_FACT_FLOW_SD
(SPECCOND_PROFILE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX08 ON RSB_FACT_FLOW_SD
(BRAND_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX09 ON RSB_FACT_FLOW_SD
(FLOW_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX10 ON RSB_FACT_FLOW_SD
(RECEIVED_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX11 ON RSB_FACT_FLOW_SD
(FLOW_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX12 ON RSB_FACT_FLOW_SD
(CUSTOMER_SEGMENT_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX13 ON RSB_FACT_FLOW_SD
(BRAND_PARTNER_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
If I drop the indexes on the table then the error goes away.
Any ideas??
Sheena

( SELECT 1
FROM RSB_FACT_FLOW_SD A,
RSB_DIM_FLOW B
WHERE
A.MPR_SK = FLOW.MPR_SK
AND A.RECEIVED_DATE >= FLOW.RECEIVED_DATE =====>>>>
AND B.FLOW_SK= A.FLOW_SK
AND B.FLOW_ID= 'WAO2'
AND A.REASON= '02CRO'
Your sub query has the problem.
You didn't list flow table in the subquery, therefore, you subquery, dont understand about the column.
specify flow table in the subquery.
Your outquery tables doesn't recognized in the sub query.
Jaffar

Similar Messages

  • Select count from large fact tables with bitmap indexes on them

    Hi..
    I have several large fact tables with bitmap indexes on them, and when I do a select count from these tables, I get a different result than when I do a select count, column one from the table, group by column one. I don't have any null values in these columns. Is there a patch or a one-off that can rectify this.
    Thx

    You may have corruption in the index if the queries ...
    Select /*+ full(t) */ count(*) from my_table t
    ... and ...
    Select /*+ index_combine(t my_index) */ count(*) from my_table t;
    ... give different results.
    Look at metalink for patches, and in the meantime drop-and-recreate the indexes or make them unusable then rebuild them.

  • How does OWB deal with bitmap indexes when inserting?

    How does OWB 9.2 deal with bitmap indexes on a fact table when records are inserted from a staging table? It seems to me that they are left on the table, while in the 9i Server manuals it says that one should not perform heavy DML in this case, because this slows down the inserts considerably and the indexes can get bloated. Should one define a premapping and postmapping process for removal and recreation of the bitmap indexes?
    How handles OWB bitmap indexes in case of PEL and what action should one take then?
    Jaap.

    Hai Japp,
    It depends on the volume of the data.
    The best way is drop index in pre mapping process and recreate it in post mapping process.
    You need to use EXECUTE IMMEDIATE command in the procedure to create or drop indexes.
    e.g:
    EXECUTE IMMEDIATE 'CREATE BITMAP INDEX INDX_BI_TABLE ON TABLE_NAME(COL_NAME)'
    Regards,
    Malli

  • Nested table update gets ORA-00904 with ExecuteSQL, error-free in TOAD

    I'm trying to run an UPDATE query through the ExecuteSQL method
    of the oraDatabase object. The catch seems to be that this one
    affects a nested table (field to be updated is a table itself).
    This SQL runs perfectly in T.O.A.D. ...
    UPDATE B457.AIRLINE a SET
    a.rental_cust_code=B457.RENTCUSTCODELIST(rentcustcodes
    ('45645'),rentcustcodes('1234'),rentcustcodes('234234')) WHERE
    a.AIRLINE_CODE='RCR'
    ...but, it produces the "SQL execution error, ORA-00904: invalid
    column name" when run using ExecuteSQL.
    Do I need to use a different syntax?

    and the complete example
    SQL> create or replace TYPE t_indirizzo AS OBJECT (
      2  via VARCHAR(45),
      3  numero NUMBER,
      4  cap INTEGER(5),
      5  citta VARCHAR(30),
      6  provincia VARCHAR(30),
      7  regione VARCHAR(30)
      8  );
      9  /
    Type created.
    SQL>
    SQL>
    SQL> create or replace TYPE t_telefono AS OBJECT (
      2  num_tel NUMBER(15)
      3  );
      4  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_listaTelefono AS TABLE OF t_telefono
      2  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_cliente AS OBJECT (
      2  cod_cliente NUMBER(8),
      3  indirizzo t_indirizzo,
      4  email VARCHAR(30),
      5  telefono t_listaTelefono
      6  ) NOT FINAL;
      7  /
    Type created.
    SQL>
    SQL> CREATE TABLE cliente OF t_cliente(
      2  cod_cliente NOT NULL,
      3  indirizzo NOT NULL,
      4  email NOT NULL,
      5  PRIMARY KEY (cod_cliente)
      6  ) nested table telefono store as numTelCli_tab
      7  return as value
      8  /
    Table created.
    SQL>

  • Bitmap indexes and group by

    I'm trying to understand why Oracle 8.1.6 sometimes uses bitmap indexes sometimes not.
    Of course I have all the statistics, my bitmap indexes are valid and so on.
    The problem is this:
    - I have a customer table very very large
    - I have many columns with bitmap indexes
    - I run this statement:
    select education_key, count(*)
    from customer
    group by education_key
    and obtain a correct execution plan:
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=235 Card=5 Bytes=10)
    1 0 SORT (GROUP BY NOSORT) (Cost=235 Card=5 Bytes=10)
    2 1 BITMAP CONVERSION (COUNT)
    3 2 BITMAP INDEX (FULL SCAN) OF 'CL_EDU'
    with the use of the bitmap indexes (only five different values)
    - now I want to put a condition on a column
    which has a bitmap index.
    The new statement is:
    select education_key, count(*)
    from customer
    where age_key = 30
    group by education_key
    No join, only a scan of a sort of
    fact table. In this case Oracle
    doesn't use the bitmap index on
    education_key:
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3458 Card=5 Bytes=20
    1 0 SORT (GROUP BY) (Cost=3458 Card=5 Bytes=20)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'CUSTOMER' (Cost=3395 C
    ard=18296 Bytes=73184)
    3 2 BITMAP CONVERSION (TO ROWIDS)
    4 3 BITMAP INDEX (SINGLE VALUE) OF 'CL_AGE'
    With this execution plan Oracle has to
    read some blocks from the table when I
    think that using both the bitmap indexes
    the query is faster.
    Someone knows why Oracle has this
    behaviour? I'm trying to change
    many things (also altering statistics
    value), but it seems that with a
    condition Oracle doesn'use the bitmap
    index on the group by column.
    null

    Hi Michael, what is the address for the lasagne? ....
    In init.ora.parms I had 32Mb for bitmap index merge, I suppose it's enough, hovewer I have tried to increase it and nothing changes.
    I already use STAR_TRASFORMATION_ENABLED=TRUE.
    I have tried with different level of statistics (estimate, compute, also with very precise histograms), always the same
    behaviour. I have also tried to change, in a manual way, the statistics in order to change the Oracle behaviour but nothing ...
    For this particular statement even if I use the INDEX_COMBINE hint, I mantain the same execution plan.
    I use CHOOSE, FIRST_ROWS, ALL_ROWS: always the same behaviour.
    I think that Oracle is not able to use a bitmap index on a column involved in a group by when there is another condition in the select.
    Hovewer with bitmap indexes, I have many other problems (to read 1% of the table Oracle decides to make a full table scan even if there are the correct bitmap indexes ...).
    Many of them are solved using BITMAP_INDEX, but it's difficult to use it in a query tool like Discover or Business Objects because I have to fix the use of INDEX_COMBINE also in situation in which this use is not correct from a performance point of view.
    The life with the query optimizer is very hard!
    Thank you for your guesses

  • Bitmap index Vs B-Tree index

    Hi All,
    Could some one please let me know how Bitmap indexes are useful compared to B-Tree indexes on low-cardinality columns ?.
    Thanks,
    -Kumar.

    >>
    As Re: why oracle db 9i optimizer can't choose to use the bitmap index? there are a number of issues with bitmap indexes. Your best bet is to read these three articles by Jonathan Lewis.
    It does pay us to understand how the optimizer works with bitmap indexes. I posted some Re: Cost-based optimizer behavior to show how indexes on even very low valued columns can be useful in certain circumstances.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Which index  I should create  Btree or Bitmap  index?

    I have table with columns c1,c2,c3
    I want to create index on column c1
    which index I should create Btree or Bitmap index
    the column contain 50% unique values and 50% duplicate values
    If Btree why?
    If Bitmap Why?
    I know that
    Btree is used when there more unique values (high cardinality)
    Bitmap is used when there less unique values (low cardinality)

    read this -
    Deadlocks with Bitmap Indexes
    Bitmap indexes were designed to be used solely within data warehouses, i.e. where the vast majority of the database activity is reading data,
    and there's very little (or no) data modification, except for batch processes which occasionally re-populate the warehouse.
    Each "row" in the bitmap index contains references to potentially many different rowids, in contrast to a B*-tree index which references a single rowid.
    It should be obvious, therefore, that, since the transactional mechanism is the same for all database operations, that any DML on a table which impacts the bitmap index may end up locking (or attempting to lock) many different "rows" within the index.
    This is the key concept with deadlocks in bitmap indexes, you're not being deadlocked on the underlying table, but on the index blocks. Courtesy - http://www.oratechinfo.co.uk/deadlocks.html
    hope u got it now...

  • Bitmap index column goes for full table scan

    Hi all,
    Database : 10g R2
    OS : Windows xp
    my select query is :
    SELECT tran_id, city_id, valid_records
    FROM transaction_details
    WHERE type_id=101;
    And the Explain Plan is :
    Plan
    SELECT STATEMENT ALL_ROWSCost: 29 Bytes: 8,876 Cardinality: 634
    1 TABLE ACCESS FULL TABLE TRANSACTION_DETAILS** Cost: 29 Bytes: 8,876 Cardinality: 634
    total number of rows in the table = 1800 ;
    distinct value of type_ids are 101,102,103
    so i created a bit map index on it.
    CREATE BITMAP INDEX btmp_typeid ON transaction_details
    (type_id)
    LOGGING
    NOPARALLEL;
    after creating the index, the explain plan shows the same. why it goes for full table scan?.
    Kindly share ur idea on this.
    Edited by: 887268 on Apr 3, 2013 11:01 PM
    Edited by: 887268 on Apr 3, 2013 11:02 PM

    >
    I am sorry for being ignorant, can you please cite any scenario of locking due to bitmap indices? A link can be useful as well.
    >
    See my full reply in this thread
    Bitmap index for FKs on Fact tables
    >
    ETL is affected because DML operations (INSERT/UPDATE/DELETE) on tables with bitmapped indexes can have serious performance issues due to the serialization involved. Updating a single bit-mapped column value (e.g. from 'M' to 'F' for gender) requires both bitmapped index blocks to be locked until the update is complete. A bitmap index stored ROWID ranges (min rowid - max rowid) than can span many, many records. The entire 'range' of rowids is locked in order to change just one value.
    To change from 'M' the 'M' rowid range for that one row is locked and the ROWID must be removed from the range byt clearing the bit. To change to 'F' the 'F' rowid id range needs to be found, locked and the bit set that corresponds to that rowid. No other rows with rowids in the range can be changed since this is a serial operation. If the range includes 1000 rows and they all need changed it takes 1000 serial operations.

  • Bitmap indexes to track extents in locally managed tablespaces

    does any body have any idea that how oracle tracks free and used extents with bitmap indexes in locally managed tablespaces ?
    please reply

    There are no bitmap indexes, there is a 64k tablespace header block containing the bitmap of occupied and free extents.
    Sybrand Bakker
    Senior Oracle DBA

  • Internal SYS_OP_ATG function generates "ORA-00904: : invalid identifier"

    After gathering system statistics a MERGE statement within a PLSQL block now always raises "ORA-00904: : invalid identifier". Investigation points to internal SQL executed by the CBO using the SYS_OP_ATG function to be the culprit. What is this function and why does it raise "ORA-00904: : invalid identifier"? As a temporary solution deleting system statistics has made the problem disappear. My concern is that it will reappear.
    Merge statement is within a procedure within a package. Nothing had been re-compiled. System statistics were gathered then the following statement errors every time. There is an exception handler around it which raises the "ORA-00904: : invalid identifier". Delete system stats and it all works fine again:
    MERGE INTO lp_data lp
    USING (
    SELECT
    f.ubimsg_id ubimsg_id,
    f.endpoint_id endpoint_id,
    f.msg_created_date msg_created_date,
    t.end_time end_time,
    DECODE(t.units_used,255,0, t.units_used) units_used,
    DECODE(t.units_used,255,'N', 'Y') reading_received
    FROM TABLE (CAST (tab_lp_values AS load_profiles)) t,
    (SELECT ubirec.ubimsg_id ubimsg_id ,ubirec.endpoint_id endpoint_id, ubirec.msg_created_date msg_created_date FROM dual) f
    ) lp_rec
    on (lp.endpoint_id = lp_rec.endpoint_id
    and lp.end_time = lp_rec.end_time)
    when matched then
    update set lp.entry_date = lp_rec.msg_created_date,
    lp.ubimsg_id = lp_rec.ubimsg_id,
    lp.units_used = lp_rec.units_used / 10,
    lp.reading_received = lp_rec.reading_received
    when not matched then
    insert (lp.endpoint_id,
    lp.end_time,
    lp.entry_date,
    lp.ubimsg_id,
    lp.units_used,
    lp.reading_received)
    values (lp_rec.endpoint_id,
    lp_rec.end_time,
    lp_rec.msg_created_date,
    lp_rec.ubimsg_id,
    lp_rec.units_used / 10,
    lp_rec.reading_received );
    The line FROM TABLE (CAST (tab_lp_values AS load_profiles)) t casts a plsql object collection. An SQL trace showed the following SQL which must be internal SQL generated for the MERGE statement.
    SELECT distinct TBL$OR$IDX$PART$NUM("LP_DATA", 0, 1, 0, "END_TIME") FROM
    (SELECT "LP_REC"."END_TIME" "END_TIME" FROM (SELECT :B1 "UBIMSG_ID",:B2 "ENDPOINT_ID",:B3 "MSG_CREATED_DATE",
    SYS_OP_ATG(VALUE(KOKBF$),1,2,2) "END_TIME",
    DECODE(SYS_OP_ATG(VALUE(KOKBF$),2,3,2),255,0,SYS_OP_ATG(VALUE(KOKBF$),2,3,2)) "UNITS_USED",
    DECODE(SYS_OP_ATG(VALUE(KOKBF$),2,3,2),255,'N','Y') "READING_RECEIVED"
    FROM TABLE(CAST(:B4 AS "LOAD_PROFILES") ) "KOKBF$","SYS"."DUAL" "DUAL") "LP_REC") ORDER BY 1
    Without system statistics the trace did not have this statement in it, and the explain plan for the MERGE differed.
    Oracle 11.1.0.7.0 Windows 32-BIT.
    select * from v$version;
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL> show parameter compatible
    compatible string 11.1.0.0.0
    Any help to explain / resolve this issue would be much appreciated.

    Duplicate thread: CBO on 11G generates ORA-00904 with SYS_OP_ATG

  • ORA-00604 ORA-00904 When query partitioned table with partitioned indexes

    Got ORA-00604 ORA-00904 When query partitioned table with partitioned indexes in the data warehouse environment.
    Query runs fine when query the partitioned table without partitioned indexes.
    Here is the query.
    SELECT al2.vdc_name, al7.model_series_name, COUNT (DISTINCT (al1.vin)),
    al27.accessory_code
    FROM vlc.veh_vdc_accessorization_fact al1,
    vlc.vdc_dim al2,
    vlc.model_attribute_dim al7,
    vlc.ppo_list_dim al18,
    vlc.ppo_list_indiv_type_dim al23,
    vlc.accy_type_dim al27
    WHERE ( al2.vdc_id = al1.vdc_location_id
    AND al7.model_attribute_id = al1.model_attribute_id
    AND al18.mydppolist_id = al1.ppo_list_id
    AND al23.mydppolist_id = al18.mydppolist_id
    AND al23.mydaccytyp_id = al27.mydaccytyp_id
    AND ( al7.model_series_name IN ('SCION TC', 'SCION XA', 'SCION XB')
    AND al2.vdc_name IN
    ('PORT OF BALTIMORE',
    'PORT OF JACKSONVILLE - LEXUS',
    'PORT OF LONG BEACH',
    'PORT OF NEWARK',
    'PORT OF PORTLAND'
    AND al27.accessory_code IN ('42', '43', '44', '45')
    GROUP BY al2.vdc_name, al7.model_series_name, al27.accessory_code

    I would recommend that you post this at the following OTN forum:
    Database - General
    General Database Discussions
    and perhaps at:
    Oracle Warehouse Builder
    Warehouse Builder
    The Oracle OLAP forum typically does not cover general data warehousing topics.

  • BITMAP indexes ignored with large IN(...)

    I have a fact table with 20 million records joined to a few dimension tables using 10g BITMAP INDEXes but if I add more than two or three items to my SELECT query the optimizer does not choose to use the bitmaps. For example, the first query
    SELECT p.period_date, po.agent_id, count(*), SUM(ah.charge_amt)
    FROM Travel_History ah, Period p, Agent po
    WHERE ah.primary_agent_key = po.agent_key
    AND ah.period_key = p.period_key
    AND po.agent_id IN( 'DGF ', '001MG ' )
    AND p.period_date =
    TO_DATE( '20010701', 'YYYYMMDD' )
    AND p.period_date =
    TO_DATE( '20010801', 'YYYYMMDD' )
    GROUP BY po.agent_id, p.period_date
    definitely uses my BITMAPs as I see that in my EXECUTION PLAN (i.e. I have set autotrace on):
    | 0 | SELECT STATEMENT | | 1 | 32
    | 1 | HASH GROUP BY | | 1 | 32
    |* 2 | FILTER | | |
    | 3 | NESTED LOOPS | | 1 | 32
    |* 4 | HASH JOIN | | 1 | 19
    |* 5 | TABLE ACCESS FULL | PERIOD | 1 | 10
    | 6 | TABLE ACCESS BY INDEX ROWID | TRAVEL_HISTORY | 4000K| 34
    | 7 | BITMAP CONVERSION TO ROWIDS | | |
    | 8 | BITMAP AND | | |
    | 9 | BITMAP OR | | |
    |* 10 | BITMAP INDEX SINGLE VALUE| XIF4TRAVEL_HISTORY | |
    |* 11 | BITMAP INDEX SINGLE VALUE| XIF4TRAVEL_HISTORY | |
    | 12 | BITMAP MERGE | | |
    |* 13 | BITMAP INDEX RANGE SCAN | TRVLHIST_MULTI3_BMIX | |
    |* 14 | BITMAP INDEX SINGLE VALUE | XIF1TRAVEL_HISTORY | |
    |* 15 | TABLE ACCESS BY INDEX ROWID | AGENT | 1 | 13
    |* 16 | INDEX UNIQUE SCAN | XPKAGENT | 1 |
    There are only a few hundred records for those two dates, and the above query returns in
    less than a second.
    However, if I replace the two "period_date =" with IN(...) as:
    SELECT /*+ INDEX_COMBINE( Travel_history
    AcctHist_MULTI3_bmix
    XIF4TRAVEL_HISTORY
    XIF1TRAVEL_HISTORY )
    p.period_date, po.agent_id, count(*), SUM(ah.charge_amt)
    FROM Travel_History ah, Period p, Agent po
    WHERE ah.primary_agent_key = po.agent_key
    AND ah.period_key = p.period_key
    AND po.agent_id IN( 'DGF ', '001MG ' )
    AND p.period_date IN (
    TO_DATE( '20010701', 'YYYYMMDD' ),
    TO_DATE( '20010801', 'YYYYMMDD' ) )
    GROUP BY po.agent_id, p.period_date
    the execution plan goes back to
    | 0 | SELECT STATEMENT | | 747 | 23904 | 45760 (7)|
    | 1 | HASH GROUP BY | | 747 | 23904 | 45760 (7)|
    |* 2 | FILTER | | | | |
    |* 3 | HASH JOIN | | 5000K| 152M| 44897 (5)|
    | 4 | MERGE JOIN CARTESIAN| | 860 | 19780 | 26 (0)|
    |* 5 | TABLE ACCESS FULL | PERIOD | 4 | 40 | 6 (0)|
    | 6 | BUFFER SORT | | 215 | 2795 | 20 (0)|
    | 7 | TABLE ACCESS FULL | AGENT | 215 | 2795 | 5 (0)|
    | 8 | TABLE ACCESS FULL | TRAVEL_HISTORY | 20M| 171M| 44527 (4)|
    If I do a UNION with two SELECTs each with a unique period then the BITMAPs get used. I don't get it.
    Is there any reason this would be happening???

    There are no bitmap indexes, there is a 64k tablespace header block containing the bitmap of occupied and free extents.
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-00904 on CREATE TABLE with virtual column based on XMLTYPE content

    Hello,
    this is another one for the syntax gurus...
    Trying the following, fails with ORA-00904: "MESSAGE"."GETROOTELEMENT": invalid identifier
    CREATE TABLE XML_TEST_VIRT
       MSG_TYPE         GENERATED ALWAYS AS (MESSAGE.GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /while this one succeeds
    CREATE TABLE XML_TEST_VIRT
       MSG_TYPE         GENERATED ALWAYS AS (EXTRACT(MESSAGE, '/*').GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /The GETROOTELEMENT member function of SYS.XMLTYPE is declared as "DETERMINISTIC PARALLEL_ENABLE" so the method getting called is not the problem as the 2nd case proves.
    Using the column MESSAGE which is of type XMLTYPE directly seems to be the problem. But the question is "why". The EXTRACT function result is of type XMLTYPE and calling its member works, the column is also of type XMLTYPE yet calling its member fails...
    Thanks in advance for any insights on this.
    Best Regards
    Philip

    Hmmmm ... I don't know if I should smile or frown with the implication that I am an OO guy :D :D
    Most of my colleagues when I started working as a software engineer, treated me as too low-level because of my C background (started doing C in 1985).
    In my last job, my colleagues hated my guts because I was asking them to squeeze every bit of performance out of C++ by using STL which is definitely not OO (although C++ is).
    My current colleagues treat me as a DB guru (which I most definitely am not) and they overlook/forget the fact that most of them use Java libraries in their projects, that I wrote for them !
    I am inclined to believe that I do not fall into any category in the end...
    The only thing I am for sure - and I am proud of it - is inquisitive. I want to know everything there is about the tools I use, and so I end up spending hours and hours investigating... (Microsoft found that out the hard way when I filed 16 bug reports in 8 days when Visual C++ 6 came out ! Not that it hurt them though...)
    This is where my confession ends (and my working on the XML validator starts...)
    Καληνύχτα Marco
    Philip (Φίλιππος in Greek)
    PS: I did not follow the last solution anyway. I just wanted to verify its operability ;)

  • EA3 Why does unit test end with ORA-00904

    Database version
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL Developer version
    Oracle IDE 4.0.0.12.27
    Java(TM) Platform 1.7.0_25
    Error message:
    An error was encountered performing the requested operation:
    ORA-00904: : ugyldig identifikator
    00904. 00000 -  "%s: invalid identifier"
    *Cause:   
    *Action:
    Vendor code 904
    Whenever I go into the "Unit Test" modules, create a "Suite," and then click on that Suite, I get the error message.
    I get that same error when pulling up a unit test. I am able to run the unit test, it completes successfully, but I also get that same error mentioned above.
    The test is calling a simple pl/sql function (returning Hello World). The finction is in the same schema as the user running the test.
    Is  this is a known bug?
    Message was edited by: dori The following message appears in the console: Exception while performing action Run Test java.lang.NullPointerException         at oracle.dbtools.unit_test.locking.LockManager.lock(LockManager.java:64)         at oracle.dbtools.unit_test.editor.UtEditor.obtainEditLock(UtEditor.java:429)         at oracle.dbtools.unit_test.editor.UtTestEditor.updateContent(UtTestEditor.java:135)         at oracle.dbtools.unit_test.navigator.UtNavigatorContextMenu.showEditor(UtNavigatorContextMenu.java:2711)         at oracle.dbtools.unit_test.navigator.UtNavigatorContextMenu.openElement(UtNavigatorContextMenu.java:2638)         at oracle.dbtools.unit_test.navigator.UtNavigatorContextMenu.run(UtNavigatorContextMenu.java:616)         at oracle.dbtools.unit_test.navigator.UtNavigatorContextMenu.runTest(UtNavigatorContextMenu.java:577)         at oracle.dbtools.unit_test.navigator.UtNavigatorContextMenu.handleEvent(UtNavigatorContextMenu.java:2374)         at oracle.ideimpl.controller.MetaClassController.handleEvent(MetaClassController.java:53)         at oracle.ide.controller.IdeAction$ControllerDelegatingController.handleEvent(IdeAction.java:1482)         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:663)         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:1153)         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:618)         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)         at javax.swing.AbstractButton.doClick(AbstractButton.java:376)         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)         at java.awt.Component.processMouseEvent(Component.java:6505)         at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)         at java.awt.Component.processEvent(Component.java:6270)         at java.awt.Container.processEvent(Container.java:2229)         at java.awt.Component.dispatchEventImpl(Component.java:4861)         at java.awt.Container.dispatchEventImpl(Container.java:2287)         at java.awt.Component.dispatchEvent(Component.java:4687)         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)         at java.awt.Container.dispatchEventImpl(Container.java:2273)         at java.awt.Window.dispatchEventImpl(Window.java:2719)         at java.awt.Component.dispatchEvent(Component.java:4687)         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)         at java.awt.EventQueue.access$200(EventQueue.java:103)         at java.awt.EventQueue$3.run(EventQueue.java:694)         at java.awt.EventQueue$3.run(EventQueue.java:692)         at java.security.AccessController.doPrivileged(Native Method)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)         at java.awt.EventQueue$4.run(EventQueue.java:708)         at java.awt.EventQueue$4.run(EventQueue.java:706)         at java.security.AccessController.doPrivileged(Native Method)         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)         at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)         at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)         at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)         at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

    I'm experiencing the same problem. I've called AppleCare repeatedly for a solutiuon, but I haven't gotten an answer yet and like you above I removed just about anything I could think of. I'd like to start considering third party apps we might have installed that maybe to blame.
    Why? Because I installed a fresh copy of Lion onto a Class 10 SD card and then later I turned on full disk encryption there. I no longer experienced the problem after I booted from that card.
    I also experienced a problem with full disk encryption with my 2010 MacBook Air sitting doing nothing at the encryption login screen. It spontaneously restarted three times before I turned it off. Later I moved to a 2011 model and did not see the spontaneously restarts again.
    Now I'm stuck with this annoying double login.

  • 2 problem with BITMAP JOIN INDEX and access plan

    On my schema ("LSA") I have 3 tables:
    AAB_VENDUTO (~4.200.000 record)
    AAB_ARTICOLO (~8.200 record)
    AAB_CLIENTE (~15.000 record)
    AAB_ARTICOLO.MARCA has 1079 distinct values
    AAB_CLIENTE.TITOLO_STUDIO has 22 distinct values
    I create 2 different bitmap join index:
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_ARTICOLO aa WHERE vv.articolo_id=aa.articolo_id;
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;(star_trasformation_enabled is TRUE)
    I run (on SQL Developer 1.5.5) these similar queries:
    SELECT DISTINCT VV.cliente_id FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_ARTICOLO AA on VV.articolo_id=AA.articolo_id
    WHERE (MARCA='ALGIDA' OR MARCA='SAMMONTANTA');
    SELECT DISTINCT VV.cliente_id FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_CLIENTE CC  on VV.cliente_id=CC.cliente_id  
    WHERE (titolo_studio='LAUREA BREVE' OR titolo_studio='MAGISTRALE');The first one use correctly the bitmap join index, this is the access plan:
    !http://bitlgs.altervista.org/_altervista_ht/marca.png!
    but the second query...
    !http://bitlgs.altervista.org/_altervista_ht/titolo_studio.png!
    why the second query doesn't use the bitmap index?
    problem #2:
    I create another bitmap index:
    CREATE BITMAP INDEX LSA.AAB_V_CLIENTE_SESSO_IDX ON LSA.AAB_VENDUTO(SESSO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;and I run this query:
    SELECT VV.cliente_id, COUNT(*) FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_CLIENTE CC on VV.cliente_id=CC.cliente_id
    WHERE sesso='Donna' and (titolo_studio='LAUREA BREVE' or titolo_studio='MAGISTRALE') GROUP BY VV.cliente_id;this is the access plan:
    !http://bitlgs.altervista.org/_altervista_ht/terzo.png!
    In my opinion, the part that I have marked as 'A' is superfluous...
    why it make a join with AAB_CLIENTE table? Why it filter again the titolo_studio and sesso field?
    Edited by: Nirpol on 4-set-2009 13.25

    Nirpol wrote:
    I create 2 different bitmap join index:
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_ARTICOLO aa WHERE vv.articolo_id=aa.articolo_id;
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;
    What happens if you just create two plain bitmap indexes without the join?
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA);
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO) ;You can also go with normal indexes on the FK rows (cliente_id) and the optimizer can do a bitmap conversion from normal index to bitmap index if needed. Are the column values evenly distributed? If not you might need to go for some column histogram. but I don't have the impression that this is really useful in your case.

Maybe you are looking for

  • SAP and Database Encrption on SQL Server 2005 or 2008

    Hi.  I searched as best I could for any existing threads on this topic, and could not find any, so I hope it's OK to raise a new one. We're running SAP ECC 6.0 on a SQL 2005 database.  Database size is around 3.3 TB, with Trans Log of about 550GB, st

  • How do I find the age of my macbook pro?

    I want to update from snow leopard 10.6.8 but the app store won't let me purchase mountain lion.  I'm not sure how old my macbook pro is, how do I find out?  Would there be any other reason why the app store is telling me my computer is not compatibl

  • Want to upgrade to CS6, but issue with AVCHD scrubbing might stop me

    I've been using the Adobe Creative Suite for years and really love it. The last version I stuck to was CS5. Premiere Pro CS5 had no problems scrubbing my AVCHD footage (mts wrapper from GH2 cameras) and I wanted to upgrade to CS5.5 when this became a

  • How to reference a field statically in a program?

    Hi Everyone, Can any one explain me how to reference a field statically. As the error on Extended program check is as follows: Field FLAG is not referenced statically in the program    where as the particular field has been defined as below in the pr

  • Place Queue label on phoneset instead of ANI for specific call types - how is this down in IPIVR?

    I am very new at IPIVR scripting so bare with me. We have a priority Queue that bascally allows specific ANI's call (validate by 'if" function) and they proceed into the call centre by-passing up front messages and placed in a higher priority. This V