Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-25954 when creating BJI

ahb72Apr 9 2010 — edited Apr 16 2010
Hi all,

How can I resolve the ORA-25954 error below

Oracle 11g R1
Windows 2003 SP2
SQL> CONN SH
Enter password:
Connected.
SQL>
SQL> ED
Wrote file afiedt.buf
  1  DECLARE
  2   N NUMBER := 1;
  3  BEGIN
  4   FOR R IN ( SELECT ROWID FROM SALES ) LOOP
  5    UPDATE SALES SET ID=N WHERE SALES.ROWID = R.ROWID;
  6    N := N + 1;
  7   END LOOP;
  8* END;
SQL> /

PL/SQL procedure successfully completed.


SQL> ALTER TABLE SALES ADD CONSTRAINT SALES_PK PRIMARY KEY(ID) ;

Table altered.

SQL> CREATE BITMAP INDEX sale_cus_gdr_bjix
  2  ON sales(customers.cust_gender)
  3  FROM sales, customers
  4  WHERE sales.cust_id = customers.cust_id
  5  LOCAL NOLOGGING COMPUTE STATISTICS
  6  /
FROM sales, customers
            *
ERROR at line 3:
ORA-25954: missing primary key or unique constraint on dimension


SQL> SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME IN ('SALES','CUSTOMERS')
  2  AND CONSTRAINT_TYPE='P';

CONSTRAINT_NAME
------------------------------
CUSTOMERS_PK
SALES_PK
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2010
Added on Apr 9 2010
6 comments
2,653 views