Creating constraints and Indexes in Bitmap_Join_Indexes: When creating Bitmap Join Indexes, an ORA-25954 error occurs: a dimension primary key or a unique constraint condition is missing.
Cause: it is affected by constraints and indexes.
The test procedure is as follows:
Create table sales
As select * from sh. sales;
Create table MERS
As
Select * from sh. customers;
Create unique index CUST_ID_un on MERS (CUST_ID );
Create:
Bitmap Join Indexes
Create bitmap index sales_cust_gender_bjix
On sales (customers. cust_gender)
From sales, MERS
Where sales. cust_id = customers. cust_id;
The following error is reported:
Row 3 has an error:
ORA-25954: missing primary key or unique constraint for a dimension
Case study: Although the unique index of table MERS is defined here, this index does not have a unique constraint on table customers, that is, it does not mean that the table is unique; however, if the uniqueness constraint is added, no error is reported. The example is as follows:
SQL> ALTER TABLE MERS
2 MODIFY (cust_id CONSTRAINT customers_un unique );
The table has been changed.
SQL> create bitmap index sales_cust_gender_bjix
2 on sales (customers. cust_gender)
3 from sales, MERS
4 where sales. cust_id = customers. cust_id;
The index has been created.
Conclusion:
As long as the uniqueness constraint is added, no error is reported when you create BJI.