您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關IMP導入遇到IMP-00017 ORA-00942怎么辦,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
導入時遇到IMP-00017,IMP-00003錯誤
[oracle@lzl ~]$ cat parfile_imp.txt
userid="scott/tiger"
file=/home/oracle/exp_lzl.dmp
log=/home/oracle/imp_lzl.log
buffer=102400
tables=emp
fromuser=scott
touser=smith
rows=y
[oracle@lzl ~]$ imp parfile=parfile_imp.txt
Import: Release 11.2.0.3.0 - Production on Tue Jul 11 01:36:33 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
Warning: the objects were exported by SYS, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SMITH
IMP-00015: following statement failed because the object already exists:
"CREATE TABLE "EMP" ("EMPNO" NUMBER(4, 0), "ENAME" VARCHAR2(10), "JOB" VARCH"
"AR2(9), "MGR" NUMBER(4, 0), "HIREDATE" DATE, "SAL" NUMBER(7, 2), "COMM" NUM"
"BER(7, 2), "DEPTNO" NUMBER(2, 0)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRAN"
"S 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 FREELISTS 1 FREELIST "
"GROUPS 1 BUFFER_POOL DEFAULT) LOGGING NOCOMPRESS"
Import terminated successfully with warnings.
對象存在于數據庫中,雖然 terminated successfully但是仍然沒有導入成功,實際上并不是日志中顯示的只有ddl建表語句執行失敗,而是整個導入都失敗了,最應該關注的不是successfully而是導入的行數rows以及警告。
[oracle@lzl ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Jul 11 01:44:29 2017
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop table smith.emp;
Table dropped.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lzl ~]$ imp parfile=parfile_imp.txt
Import: Release 11.2.0.3.0 - Production on Tue Jul 11 01:44:56 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
Warning: the objects were exported by SYS, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SMITH
. . importing table "EMP"
.......
14 rows imported
IMP-00017: following statement failed with ORACLE error 942:
"ALTER TABLE "EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFEREN"
"CES "DEPT" ("DEPTNO") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
About to enable constraints...
IMP-00017: following statement failed with ORACLE error 2430:
"ALTER TABLE "EMP" ENABLE CONSTRAINT "FK_DEPTNO""
Import terminated successfully with warnings.
SQL> select count(*) from smith.emp;
COUNT(*)
----------
14
導入已經成功了,但是有警告。把日志中的語句拿出來單獨執行
SQL> ALTER TABLE "EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "DEPT" ("DEPTNO") ENABLE NOVALIDATE
2
SQL> /
ALTER TABLE "EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "DEPT" ("DEPTNO") ENABLE NOVALIDATE
*
ERROR at line 1:
ORA-00942: table or view does not exist
也就是常見的外鍵失效的問題。因為導入的時候沒有導入外鍵關聯的表,所以外鍵失效,無法正常創建。
關于IMP導入遇到IMP-00017 ORA-00942怎么辦就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。