Theterm key refers only to the columns defined in the integrity
constraint. Because the database enforces a unique constraint
byimplicitly creating or reusing an
index on the key columns, the term uniquekey is sometimes
incorrectly used as a synonym for unique key constraint orunique
index. --數(shù)據(jù)庫在創(chuàng)建unique
constraint的同時(shí),,強(qiáng)制創(chuàng)建或者重用列上的索引。如果之前列上沒有索引,,那么強(qiáng)制創(chuàng)建的索引是unique
index,,如果列上已經(jīng)存在索引,就重用之前的索引,。 Oracle 自動(dòng)創(chuàng)建了索引并關(guān)聯(lián)到約束, 索引名和約束名是相同的,。 不能刪除unique/primary key 上的索引。在這種情況下,,我們只有先刪除約束,。 再次drop 索引時(shí),提示索引已經(jīng)不存在,,說明已經(jīng)在刪除約束的同時(shí),,把索引刪掉了。 當(dāng)約束列上沒有索引時(shí),在創(chuàng)建unique constraint 時(shí),,oracle 會自動(dòng)創(chuàng)建unique index,,并且該索引不能刪除,當(dāng)刪除unique constraint 時(shí),,unique index 會自動(dòng)刪除,。 |
|