ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop Table Klaida
Sometimes when dropping a table in Oracle database by executing DROP TABLE SQL statement, Oracle may return the error ORA-02449 as below: Kartais lašinamojo lentelėje Oracle vykdydama DROP TABLE SQL, Oracle, gali grąžinti klaida ORA-02449, kaip nurodyta toliau:
ORA-02449: unique/primary keys in table referenced by foreign keys ORA-02449: unikalus / pirminių raktų lentelėje nurodyti pagal išorinius raktus
The Oracle error is caused by the attempt to drop a table with unique or primary keys referenced by foreign keys in another table, or in other word, the table that is referenced as a parent table by a foreign key constraint in a parent-child relationship that established between two tables through a foreign key. Oracle klaidos sukelia bandymas išskleidžiamajame lentelė su unikaliu arba pirminės raktus, nurodyti pagal išorinius raktus kitoje lentelėje, arba, kitaip tariant, lentelės, kuri yra paminėta kaip patronuojanti stalo užsienio pagrindinius apribojimus, tėvų ir vaikų santykiai kad tarp dviejų lentelių per užsienio klavišą. Oracle does not allow to drop tables referenced by foreign keys of other tables without specifying the CASCADE CONSTRAINTS option in the DROP TABLE statement, or to drop the parent table without first removing the foreign key. Oracle neleidžia išskleidžiamajame lenteles, nurodyti pagal išorinius raktus kitų lenteles nenurodant Kaskados APRIBOJIMUS variantą, DROP TABLE pareiškimas, ar palikti tėvų stalo, išimdami užsienio klavišą.
The solution and workaround for the error when you want to drop tables referenced by child tables, is to use the CASCADE CONSTRAINTS option in the DROP TABLE statement. Tirpalo ir apeiti šią klaidą, kai norite sumažinti lentelėse nurodyti vaikų stalai, yra naudoti Kaskados APRIBOJIMUS variantą, DROP TABLE pareiškimą. For example: Pavyzdžiui:
DROP TABLE table_name CASCADE CONSTRAINTS; DROP TABLE table_name Kaskados APRIBOJIMUS;
The CASCADE CONSTRAINTS option in the DROP TABLE SQL statement will drop the FOREIGN KEY constraints of the child tables referenced. Kaskados APRIBOJIMUS variantą, DROP TABLE SQL bus upuść UŽSIENIO Raktiniai apribojimus vaikas lentelių apibrėžimas.
Alternatively, you can manually drop and remove the foreign key key constraints in other tables before performing the DROP TABLE operations on the parent table, drop the foreign key constraints in other tables. Taip pat galite rankiniu būdu sumažinti ir pašalinti užsienio raktas raktas suvaržymus kitose lentelėse prieš atlikdami DROP TABLE operacijas patronuojančios stalo, išskleidžiamajame užsienio pagrindinius suvaržymus kitose lentelėse. To check what constraints are referencing a table in Oracle, use the following command: Norėdami patikrinti, kokie apribojimai yra nurodyti, lentelėje "Oracle", naudokite šią komandą:
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = “ table_name “; SELECT * FROM USER_CONSTRAINTS KUR TABLE_NAME = "table_name";
To drop and delete the user constraints in Oracle use the following command in SQL*Plus, Toad or other SQL tools: Siekiant sumažinti ir pašalinti vartotoją apribojimų Oracle naudokite šią komandą, SQL * Plus, rupūžė ar kitų SQL įrankiai:
ALTER TABLE table_name DROP CONSTRAINT constraint_name ; ALTER TABLE table_name DROP constraint constraint_name;
IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Mašininio vertimo, gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.
Related Articles Susiję straipsniai
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 lentelė ar vaizdas nėra Oracle Klaida
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Ištrinti, pašalinti ar upuść Oracle Saugojamų Paketai su upuść paketo
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Lengvai zduplikowane, Kopijuoti arba atsarginę lentelės Oracle, PostgreSQL, DB2 ir SQLite su Sukurkite lentelę Kadangi SQL
- Oracle ORA-14074 Create or Add New Partition Fails Error "Oracle" ORA-14074 Sukurkite arba Pridėti naują Pasiskirstymo fails Klaida
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error Naujas, Pridėti arba Splitu Oracle Pasiskirstymo fails su ORA-14080 Klaida
- Oracle EXP-00091 Error When Export Database "Oracle" Tinka iki-00091 Klaida Eksporto duomenų bazė
- How to Remove and Drop Datafiles from Tablespace in Oracle Database Kaip pašalinti ir upuść Datafiles iš Tablespace į duomenų bazę Oracle
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile Kaip upuść Tablespace ir Atkurti duomenų bazę Oracle Kai atsitiktinai Ištrinti Datafile
- Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Sukurti naują lentelę, pasirinkdami duomenys Kita lentelėse su CREATE TABLE AS
- Oracle Database Import Error 3113/3114 Oracle Importo Klaida 3113/3114










































April 7th, 2009 18:56 Balandis 7, 2009 18:56
If you need to recreate a table you do not have to drop constraints. Jei norite atkurti lentelėje jūs neturite kritimas apribojimų. As an alternative you can disable constraints and then enable them back again. Kaip alternatyvą galite išjungti apribojimus ir leisti juos atgal.
The correct select statement to see which foreign keys reference the primary key of the parent table is as follows: Teisingai pasirinkti pareiškimas, kad pamatytumėte, kurie išorinius raktus nuoroda pagrindinis raktas į patronuojančios lentelę taip:
SELECT TABLE_NAME, CONSTRAINT_NAME PASIRINKITE TABLE_NAME, CONSTRAINT_NAME
FROM USER_CONSTRAINTS IŠ USER_CONSTRAINTS
WHERE CONSTRAINT_TYPE = 'R' KUR CONSTRAINT_TYPE = "R"
AND R_CONSTRAINT_NAME = parent_table_primary_key; IR R_CONSTRAINT_NAME = parent_table_primary_key;
You can use EXECUTE IMMEDIATE to disable constraints without necessarily dropping them. Galite naudoti EXECUTE VIDINIŲ išjungti apribojimai nebūtinai lašinamojo jiems.
July 24th, 2008 13:21 24 liepa 2008 13:21
Great! Puikus! The information provided is very helpful. Pateikta informacija yra labai naudinga. It seems to be simple but really halps an lot. Jis yra paprastas, bet tikrai halps yra daug. Thanks again. Thanks again.
July 3rd, 2008 06:30 3 liepa 2008 06:30
Constrangimentos? Constrangimentos? Orra, meu revisa essa tradução aí e testa antes de postar!!! Orra, meu revisa essa tradução aí e testa antes de postar! Se não seja honesto e indica o link de onde pegou!!! Se não seja honesto e indica o nuorodą de onde pegou!
February 8th, 2007 18:51 8 Vas 2007 18:51
what if after dropping the table using the query blow you want again all those constraints. ką daryti, jei po lašinamojo lentelėje naudojant užklausą smūgis norite vėl visi tie apribojimai.
DROP TABLE table_name CASCADE CONSTRAINTS; DROP TABLE table_name Kaskados APRIBOJIMUS;
please tell the query if u knows. pasakykite užklausą jei ir žino.