Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

In Oracle 8, TOYS failed to drop a primary key when the supporting (unique) index was owned by another schema, why?

0
0 Posted

In Oracle 8, TOYS failed to drop a primary key when the supporting (unique) index was owned by another schema, why?

0
0

In early versions of Oracle there was a bug which meant that if a unique index was created in one schema and later used as a supporting index for a primary key in another schema you could not drop the primary key. You had to actually drop the table. Oracle [sort of] fixed this. In 9i if you do this the schema owning the primary key also needs the system privilege DROP ANY INDEX to drop (or disable) its own primary key. Not exactly intuitive! One could argue that this is no different to granting INDEX on a table to another schema and if that schema creates an index on your table you cannot drop that index you have to drop the table [assuming of course that you do not have the system privilege DROP ANY INDEX]. From 9i, TOYS gets around this problem by using the KEEP INDEX clause on the DROP [or DISABLE] primary [or unique] key commands. In versions prior Oracle 9i, if you grant anyone index privileges on your tables you had better have the system privilege DROP ANY INDEX.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123