When you import an EXP, you may encounter constraints that prevent you from importing.
You can disable constraints to make the import complete!
When importing, I encountered the following problems:
Column 30 MOS
IMP-00019: row rejected due to ORACLE error 2291
IMP-00003: ORACLE error 2291 encountered
ORA-02291: integrity constraint (CMDB.CI_ELEMENT_LOCATION) violated – parent key not found
The processing steps are as follows:
SQL> create table cmdb.configuration_item_bak as select * from cmdb.configuration_item;
Table created.
SQL> alter table cmdb.configuration_item disable primary key;
alter table cmdb.configuration_item disable primary key
*
ERROR at line 1:
ORA-02297: cannot disable constraint (CMDB.PK_CONFIGURATION_ITEM) –
dependencies exist
SQL> Alter TABLE cmDB. configuration_item disable constraint PK_CONFIGURATION_ITEM;
alter table cmdb.configuration_item disable PK_CONFIGURATION_ITEM
*
ERROR at line 1:
ora-02297: cannot disable constraint (CMDB.PK_CONFIGURATION_ITEM) –
dependencies exist
SQL> Alter TABLE CMDB. Configuration_item disable constraint PK_CONFIGURATION_ITEM cascade;
Table altered.
SQL> alter table cmdb.configuration_item disable primary key;
Table altered.
SQL> Alter TABLE cmDB. configuration_item disable constraint PK_CONFIGURATION_ITEM;
Table altered.
I thought the import should be ok 🙂
imp/file=cmdb.dmp fromuser=cmdb touser=cmdb ignore=y
But the question remains?
Why is that?The original constraint error here was a violation of the constraint to import data in the file, regardless of whether the constraint on the table was disabled or not.
Just because the table already has the same data as the file, a constraint in the file was violated when importing it.
So you can complete the import by clearing the table data.
truncate table cmdb.configuration_item ;
You can disable constraints to make the import complete!
When importing, I encountered the following problems:
Column 30 MOS
IMP-00019: row rejected due to ORACLE error 2291
IMP-00003: ORACLE error 2291 encountered
ORA-02291: integrity constraint (CMDB.CI_ELEMENT_LOCATION) violated – parent key not found
The processing steps are as follows:
SQL> create table cmdb.configuration_item_bak as select * from cmdb.configuration_item;
Table created.
SQL> alter table cmdb.configuration_item disable primary key;
alter table cmdb.configuration_item disable primary key
*
ERROR at line 1:
ORA-02297: cannot disable constraint (CMDB.PK_CONFIGURATION_ITEM) –
dependencies exist
SQL> Alter TABLE cmDB. configuration_item disable constraint PK_CONFIGURATION_ITEM;
alter table cmdb.configuration_item disable PK_CONFIGURATION_ITEM
*
ERROR at line 1:
ora-02297: cannot disable constraint (CMDB.PK_CONFIGURATION_ITEM) –
dependencies exist
SQL> Alter TABLE CMDB. Configuration_item disable constraint PK_CONFIGURATION_ITEM cascade;
Table altered.
SQL> alter table cmdb.configuration_item disable primary key;
Table altered.
SQL> Alter TABLE cmDB. configuration_item disable constraint PK_CONFIGURATION_ITEM;
Table altered.
I thought the import should be ok 🙂
imp/file=cmdb.dmp fromuser=cmdb touser=cmdb ignore=y
But the question remains?
Why is that?The original constraint error here was a violation of the constraint to import data in the file, regardless of whether the constraint on the table was disabled or not.
Just because the table already has the same data as the file, a constraint in the file was violated when importing it.
So you can complete the import by clearing the table data.
truncate table cmdb.configuration_item ;
then import:
-bask-3.00 $imp/file= CMdb.dmp Fromuser = CMDB Touser = CMDB ignore=y
Import: Release 11.2.0.2.0 – Production on Wed Aug 17 03:27:17 2011
Copyright (C) 1982, 2009, Oracle and/or its Affiliates. All rights Reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0-64bit Production
With the Partitioning option
Export file created by Export :V11.02.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
import server USES AL32UTF8 character set (possible charset)
export client USES US7ASCII character set (possible charset conversion)
. It is important to import CMDB’s objects into CMDB
imported
Read More:
- Syntax error, insert “;” to complete Statement, insert “}” to complete Block
- How to make eclipse after the program is modified, click run to automatically save it.
- Failed to dlsym make_device: undefined symbol: make_device
- How to import Python from relative path
- numpy.core.umath How to solve the problem of failed to import
- When Linux installs redis, it executes make install and reports an error: Make: * * [server. O] error 1 (solved)
- How to solve the import failure by prompting beautifulsoup under pychar
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- Import error, failed to import the debug version of PYD
- Syntax error, insert “}” to complete ClassBody
- How to solve “import cv2 failed ImportError: DLL load fail: Cannot find the specified module” in Anaconda environment
- excel VBA: Could not complete due to error 800a0011
- sqoop-import ERROR tool.ImportTool: Import failed: No primary key could be found for table user_info
- Altium designer 18: activeroute failed to complete any routing
- Centos7 solves the problem of unable to use tab to complete automatically
- Syntax error, insert “VariableDeclarators” to complete LocalVariableDeclaration
- Pychar oserror: [winerror 1455] the page file is too small to complete the operation.
- The most complete collection of solutions to Tortoise SVN Clean up failure
- Visual studio 2012, a complete collection of solutions to flash back windows after running
- Error: importerror: DLL load failed: the page file is too small to complete the operation.