Day-8 : Indexing and Constraints(Primary/unique/Foreign keys)

Error while creating Foreign key on table:
ALTER TABLE USER1.table1 ADD CONSTRAINT sringra_FK FOREIGN KEY (CUST_ID) REFERENCES USER2.table2 (TAB1_ID) ENABLE ;
but i am getting
ORA-01031: insufficient privileges

Solution:
grant references on user2.table2 to user1;
now issue the command
ALTER TABLE USER1.table1 ADD CONSTRAINT sringra_FK FOREIGN KEY (CUST_ID) REFERENCES USER2.table2 (TAB1_ID) ENABLE ;
--------------------------------------------------------------------------------------------------------------------------
How to rebuild an index?
ALTER INDEX <index_name> REBUILD;
ALTER INDEX <index_name> REBUILD ONLINE; ---> to rebuild an index online.
--------------------------------------------------------------------------------------------------------------------------
Can you disable and enable Primary key?
yes.we have to disable reference keys on child tables.
--------------------------------------------------------------------------------------------------------------------------

No comments:

ORA-600 [kwqitnmphe:ltbagi], [1], [0] reported in the alert log file.

ORA-00600 [kwqitnmphe:ltbagi] Cause: This issue arises in 12.1.0.2. The error occurs because there are still Historical Messages without...