Theterm key refers only to the columns defined in the integrityconstraint. Because the database enforces a unique constraintbyimplicitly creating or reusing an
index on the key columns, the term uniquekey is sometimesincorrectly used as a synonym for unique key constraint oruniqueindex. --數(shù)據(jù)庫在創(chuàng)建uniqueconstraint的同時(shí),強(qiáng)制創(chuàng)建或者重用列上的索引。如果之前列上沒有索引,那么強(qiáng)制創(chuàng)建的索引是uniqueindex,如果列上已經(jīng)存在索引,就重用之前的索引。
Oracle 自動創(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 會自動創(chuàng)建uniqueindex,并且該索引不能刪除,當(dāng)刪除unique constraint 時(shí),unique index 會自動刪除。
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。