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. --數據庫在創(chuàng)建unique
constraint的同時,強制創(chuàng)建或者重用列上的索引。如果之前列上沒有索引,那么強制創(chuàng)建的索引是unique
index,如果列上已經存在索引,就重用之前的索引。 Oracle 自動創(chuàng)建了索引并關聯到約束, 索引名和約束名是相同的。 不能刪除unique/primary key 上的索引。在這種情況下,我們只有先刪除約束。 再次drop 索引時,提示索引已經不存在,說明已經在刪除約束的同時,把索引刪掉了。 當約束列上沒有索引時,在創(chuàng)建unique constraint 時,oracle 會自動創(chuàng)建unique index,并且該索引不能刪除,當刪除unique constraint 時,unique index 會自動刪除。 |
|
來自: Levy_X > 《JAVAWEB學習資料》