oracle - Enforcement of unique/primary key - drop index -


i trying drop index :

drop index pk_charges 

but error

cannot drop index used enforcement of unique/primary key

why getting error? provide further information if need any.

how solve it?

edit have no primary key in table, found weird index don't remember had added:

index name = sys_c0040476 have same columns

you can query all_constraints performance view see constraint index used by, , table applies to, e.g:

select owner, constraint_name, constraint_type,     table_name, index_owner, index_name all_constraints index_name = 'pk_charges'; 

i expect table name 'charges', constraint name match index name, , constraint type 'p'. since have table in mind, perhaps names aren't following helpful convention. maybe old version of table renamed, leave constraints against new name (e.g. charges_backup or something).


you said click on table, on view. perhaps you're not looking @ table constraint/index on; or perhaps you're looking @ view on top of actual table. mention sys_ index on same columns - can't on same table. have multiple similar tables, or access multiple schemas? shold run above query index too. mentions above, might find old version (or versions) of table.


once you've identified table constraint on, you'll need decide whether should keeping it, , if not can remove dropping constraint alter table command.


Comments