i want to create a bitmap index,but getting the error shown below..i created primary key on column dname of dept and unique constraint on empno of emp.
SQL> create bitmap index bindx on dept d(d.dname) from emp e,dept d where e.deptno=d.deptno;
create bitmap index bindx on dept d(d.dname) from emp e,dept d where e.deptno=d.deptno
*
ERROR at line 1:
ORA-25954: missing primary key or unique constraint on dimension
I was running a test on a huge table with a bitmap index on one of the columns. But bitmap index is not getting used. Below are the test details.
create table test (col1 number, col2 number);
begin for i in 1..1000000 loop if mod(i,2) = 0 then insert into test values(i, 'Y'); else insert into test values(i, 'N'); end if; end loop; end; COMMIT;
The intention here is to have only two distinct values in the entire table. Based on these values I will not build BITMAP index on col2.
CREATE BITMAP INDEX BITMAP_TEST on TEST(col2) COMPUTE STATISTICS;
Now when I run the below query, it doesn't uses BITMAP index. Instead the explain plan shows a full table scan.
select * from test where col2 = 'Y';
Now when I force ORACLE to use index through hint, the cost is too high while using the bitmap index(probably why the ORACLE chose not to use the index at the first stage).
I have read somewhere, that BITMAP index is useful when we have more than 1 or 2 bitmap indexes on other columns of the same table as well And the query should be like
select * from table where col1 = 'Y' and sex = 'F';
In this case oracle will use BITMAP but not in the case where there is only one column that has BITMAP index.
Considering all the factors stated above, is there any way I can fine tune my original query?
I was executing following query and it was taking about 20 sec's to execute before i decided to create B-Tree(Normal) index on column DeliVery.
Select DeliVery,Code,Sum(Units),Sum(Loads),Count(units), Count(Loads) Where
[code]...
After creating B-Tree index on Column Delivery the execution time has been reduced to one second ,thats what i wanted. But If i create Bitmap index on the same column then execution time is not getting reduced and is still same around 20 sec.I think theoratically "Delivery" column is the right candidate for Bitmap index? whether should i create bitmap index or stick with B-Tree index?
oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production PL/SQL Release 11.1.0.6.0 - Production "CORE 11.1.0.6.0 Production"
I have a procedure that is run weekly to load the data, for which it calls another procedure. This weekly procedure, disables the index, load the data, and rebuilds the index. During rebuilding of index, its giving ORA-00054: resource busy and acquire with NOWAIT error. I dont have privileges to look for session id, and kill the session. How to avoid this error.
create or replace PROCEDURE "WCL_WEEKLY_UPLOAD" ( p_event_id IN NUMBER ) [code]....
As you can see, after the procedure wc_upload, COMMIT is issued, and then the rebuilding of the index is starting. So dont know what is causing the table to lock.
gives different result when we exchange the index ksr_valid_until_i on table kreditkarten_sets_rs. For some reasons we changed the index from bitmap to normal and are getting different results. Switching back gives us the same results as before. When we avoid the usage of this index in the statement than we are getting the same results as when we are using the normal index.
is there some performance/access difference between a bitmap index on a number column and char(1) column? Both columns are not null with a default value.My application has a querie like this:
If I create a bitmap index on column "column_char", the access plan is not changed. But changing the column datatype to number(1) and obviously the values, the index is accessed and the cost decreases.This table has 4.000.000 rows. Oracle 11.2.0.2SO
difference between the ways we create Reverse Key Index on the table.The two ways are as below:
1) CREATE INDEX <Index_Name> ON <Table_Name>(<Column_Name) REVERSE ; 2) CREATE INDEX <Index_Name> ON<Table_Name>(REVERSE(<Column_Name>)) ;
Which one is the appropraite one. Are both going to act in the same way.
I created index in both ways one by one on the table.But when I fire the select statement against the same table, The explain plan doesn't show any cost and it shows the full table scan in both ways.The select statement used is as below...I want to compare the column with string RBO(i.e('RBO%') at the start.
SELECT * FROM <Table_Name> WHERE REVERSE (<Column_Name>) LIKE '%OBR' ;
The select statement is giving me the correct result. Only the explain plan is showing Full Table Scan.can we use this reverse with IN operator also in the same way by reversing the values.
I use Oracle 10.0.2.0.1.If I create a table with constraint key; after that I create an unique index key, I got an error. Does it mean when I create a table with constraint the unique index are automatically created and I could not create index key as I did as below?
create table test_const(ename varchar2(50) not null, key_num number not null, descr varchar2(100), constraint constraint_test_const unique (ename, key_num)); create unique index test_const_idx on test_const ( "ENAME","KEY_NUM" ) tablespace tmp_data;
Error report: SQL Error: ORA-01408: such column list already indexed 01408. 00000 - "such column list already indexed" added [pre] tags by Sriram
* 35 | ID TABLE ACCESS BY INDEX ROW | S_ORG_EXT | 3064K| 2472M| | 1 (0)| 00:00:01 | | 36 | INDEX FULL SCAN | S_ORG_EXT_U1 | 14 | | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id): --------------------------------------------------- 35 - filter("T2"."ACCNT_FLG"<>'N' AND ("T2"."INT_ORG_FLG"<>'Y' OR "T2"."PRTNR_FLG"<>'N'))
This unselective index scan on step 36 of the explain is returning 14 rows but optimizer is selecting 3064 K rows from the table .
I tried creating combined index on all 3 columns mentioned in the predicates for 35th step , but that is not utilized .
how to index this whole expression ::--
(ACCNT_FLG<>'N' AND (INT_ORG_FLG<>'Y' OR PRTNR_FLG<>'N'))
Something like CREATE INDEX XYZ on table((ACCNT_FLG<>'N' AND (INT_ORG_FLG<>'Y' OR PRTNR_FLG<>'N')) compute statistics ;
Is it a possible to create table using clause below together with index ?
create table the_table as select col1, col2 from table2
I got procedure which create a table in the schema B. The procedure is called from schema A. But when I write into procedure query for create index then I got a error:
ORA-01031: insufficient privileges when ...executing
Therefore I think about to create table together with index.
11.2.0.1...How do I create an index on a view or any workaround that my view won't get duplicates?
SQL> create unique index indx01 on db_backup_details_vw(id); create unique index indx01 on db_backup_details_vw(id) * ERROR at line 1: ORA-01702: a view is not appropriate here
Is there any rule in documentation, when create partition index? For tables, it is said to partition when table is greater than 2GB, but what about index? WHat size it should have to partition?
how I can create an index dynamically? The DBA wants me to put this code below in the beginning of a PL/SQL package. At first, I tried by just putting the below syntax in the code, but I get an 'Alter' is not a valid identifier.
alter index ZZAP_selected_invoices_n1 rebuild online;
I have column containing three values:-N,E,Y.I want to get results with only E and Y values.Is it it possible to create index which would not look for N values.
We are trying to create an index using parallelism. The table contains 24 Million row. But It takes very long time. Also we are unable to see any sessions confirming that the index creation is using parallelism. The creation goes on for more than 3 hours. SQL statement executed :
CREATE INDEX ANT.ANT_OM_TRAN ON APPS.ANT_OM_TRAN_INDX (last_update_date) PARALLEL 4 TABLESPACE APPS_TS_IDX;
I found out the session using the query
select sid,serial#,program,module,osuser,username,machine,inst_id,sql_id from gv$session where type not in ( 'BACKGROUND') and machine='APCUSDE' and osuser='applmgr' and program like 'sqlplus%' order by logon_time ; select * from gv$sqltext where sql_id='akrr2ww1ukq5z';
The given queries were used to check if it was using parallelism, but i was unable to find anything.
SELECT QCSID, SID, INST_ID "Inst", SERVER_GROUP "Group", SERVER_SET "Set", NAME "Stat Name", VALUE FROM GV$PX_SESSTAT A, V$STATNAME B WHERE A.STATISTIC# = B.STATISTIC# AND NAME LIKE 'PHYSICAL READS' AND VALUE > 0 ORDER BY QCSID, QCINST_ID, SERVER_GROUP, SERVER_SET; SELECT * FROM V$PX_PROCESS;
how can i make sure that, it is using parallelism.
Using oracle 10g R2 on sun-solaris 10 (sparc-64) Well in the MIS system we have lot of ad-hoc queries coming up. We have proper indexing. Say an example which runs very slow;
Here GLUPMJ already indexed so the second query returing an index scan but the first query does a FTS naturally.Now even if I plan to create a function based index on 'the bold highlighted' but how.
create index glupmj_idx on f0911(TO_DATE('1 JAN' || (19+substr( GLUPMJ , 1, 1)) || substr( GLUPMJ ,2,2)) + substr( GLUPMJ , 4, 3 ));..Error If I don't use a FBI my query will result in FTS.
1> how to create a FBI here in this case
2> In MIS systems where 'n' no of ad-hoc queries can come up, how to avoid FTS.
When I try to find the ranges matching (intersecting) a certain range (e.g. '21112'-'2111299999'), optimizer does a FULL TABLE SCAN, which is not opimal in my opinion. I use the hint to force the optimizer use the indexes.
select /*+ index_combine(rng2 x_rng2_start, x_rng2_end) */ * from rng2 where rng2.rng_start <= '2111999999' and rng2.rng_end >= '2111'; Plan SELECT STATEMENT ALL_ROWSCost: 60 Bytes: 17,344 Cardinality: 1,084 7 TABLE ACCESS BY INDEX ROWID TABLE LUMAMIPA.RNG2 Cost: 60 Bytes: 17,344 Cardinality: 1,084 6 BITMAP CONVERSION TO ROWIDS 5 BITMAP AND 2 BITMAP MERGE 1 BITMAP INDEX RANGE SCAN INDEX (BITMAP) LUMAMIPA.X_RNG2_START 4 BITMAP MERGE 3 BITMAP INDEX RANGE SCAN INDEX (BITMAP) LUMAMIPA.X_RNG2_END
However, when I try to join the 2 sets of ranges by matching the intersecting ranges, then the range scan and "BITMAP AND" of the 2 indexes is not done, even though the hint is specified:
select /*+ index_combine(rng2 x_rng2_start, x_rng2_end) */ count(*) cnt from rng1 join rng2 on rng1.rng_start <= rng2.rng_end and rng1.rng_end >= rng2.rng_start; [code]...
How to make the optimizer use the range scan of both indexes? Is there a better way to match the ranges?
I have a few dimension tables with surrogate keys and a fact table with foreign keys on columns referring to the dimension table. I want to create primary keys on the dimension tables and foreign keys on the fact table, but with minimal overhead of constraint validation when loading the data.
Other than bitmap indexes on the FK columns on the fact table, I also want to create a bitmap join index on the fact table joined to the dimension table on a handful of dimension columns.
Which is the best suited constraint definition? Only RELY, or RELY + DISABLE, or RELY + DISABLE + NOVALIDATE, or RELY + NOVALIDATE, or any other?