impdp匯入報ORA-00001 ORA-04088錯誤
1 使用impdp匯入資料,報如下錯誤
ORA-31693: Table data object "USER_A"."SYNC_TABLE_A" failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-00001: unique constraint (USER_A.P_USER_PK) violated
ORA-06512: at "USER_A.SYNC_TABLE_A_INSERT", line 3
ORA-04088: error during execution of trigger 'USER_A.SYNC_TABLE_A_INSERT'
2 在原始庫查詢是否有重複資料,發現沒有冗餘資料
SYS@sourcedb1 >select CN,count(*) from USER_A.SYNC_TABLE_A having count(*) >1 group by CN;
no rows selected
3 檢查觸發器的狀態及內容
SYS@targetdb1 >select OWNER,TRIGGER_NAME,STATUS from dba_triggers where TRIGGER_NAME='SYNC_TABLE_A_INSERT';
OWNER TRIGGER_NAME STATUS
------------------------------ ------------------------------ --------
USER_A SYNC_TABLE_A_INSERT ENABLED
檢視觸發器的內容,發現將此表的資料插入到另一個表中
set linesize 300
set pagesize 999
set long 999999
SELECT DBMS_METADATA.GET_DDL('TRIGGER','SYNC_TABLE_A_INSERT','USER_A') from dual;
CREATE OR REPLACE TRIGGER "USER_A"."SYNC_TABLE_A_INSERT"
after insert or update or delete ON "SYNC_TABLE_A" FOR EACH ROW
BEGIN
if inserting then
INSERT INTO PORTAL_USER_B t
(id,
login_name,
full_name,
.。。。。
4 檢視另一個表是否有資料,發現有
SYS@targetdb1 >select count(*) from USER_A.PORTAL_USER_B;
COUNT(*)
----------
61931
另外就是已經在此表中將資料進行了匯入。
. . imported "USER_A"."PORTAL_USER_B" 4.001 MB 61931 rows
5 解決方法
禁用觸發器。
SYS@targetdb1 > alter trigger USER_A.SYNC_TABLE_A_INSERT disable;
Trigger altered.
SYS@targetdb1 >select OWNER,TRIGGER_NAME,STATUS from dba_triggers where TRIGGER_NAME='SYNC_TABLE_A_INSERT';
OWNER TRIGGER_NAME STATUS
------------------------------ ------------------------------ --------
USER_A SYNC_TABLE_A_INSERT DISABLED
6 禁用後,再次匯入,沒有任何問題。
[oracle@targetdb1 ~]$ impdp \'/ as sysdba\' JOB_NAME=xsc1123 directory=EXPDP dumpfile=SYNC_NOVELL_1123.dmp logfile=SYNC_NOVELL_1123.log TABLE_EXISTS_ACTION=TRUNCATE
Import: Release 11.2.0.4.0 - Production on Tue Nov 23 10:10:39 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Master table "SYS"."XSC1123" successfully loaded/unloaded
Starting "SYS"."XSC1123": "/******** AS SYSDBA" JOB_NAME=xsc1123 directory=EXPDP dumpfile=SYNC_NOVELL_1123.dmp logfile=SYNC_NOVELL_1123.log TABLE_EXISTS_ACTION=TRUNCATE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "USER_A"."SYNC_TABLE_A" 1.702 MB 20444 rows
Job "SYS"."XSC1123" successfully completed at Tue Nov 23 10:10:40 2021 elapsed 0 00:00:01
7 啟用觸發器,避免因為觸發器禁用導致的資料問題
SYS@targetdb1 >alter trigger USER_A.SYNC_TABLE_A_INSERT enable;
Trigger altered.
SYS@targetdb1 >select OWNER,TRIGGER_NAME,STATUS from dba_triggers where TRIGGER_NAME='SYNC_TABLE_A_INSERT';
OWNER TRIGGER_NAME STATUS
------------------------------ ------------------------------ --------
USER_A SYNC_TABLE_A_INSERT ENABLED
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69996316/viewspace-2844228/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【故障處理】如何避免在執行impdp後出現ORA-00001錯誤
- ORACLE 資料泵impdp匯入報錯之ORA-31693 ORA-04098Oracle
- 匯入sql時報日期型別錯誤SQL型別
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- impdp/expdp報錯: ORA-39064: 無法寫入日誌檔案 ORA-29285: 檔案寫入錯誤
- Oracle 12.1.0.2 impdp匯入慢診斷Oracle
- OGG 抽取程序註冊時報OGG-08221 ORA-00001錯誤總結
- Oracle 12c expdp和impdp匯出匯入表Oracle
- Excel匯入null錯誤解決方式ExcelNull
- 然後再全庫匯入排除view資料庫在impdp匯入View資料庫
- vue2匯入專案遇到錯誤Vue
- ORACLE匯入遇到ORACLE錯誤959解決方法Oracle
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- mysql匯入報錯怎麼解決?MySql
- Oracle 19.3資料庫impdp匯入view時hang住Oracle資料庫View
- MyISAM DEFAULT CHARACTER SET utf8 提示匯入錯誤
- C中的匯流排錯誤和段錯誤
- Oracle 11g impdp 先資料後索引匯入方法Oracle索引
- Oracle 28.6資料庫impdp匯入view時hang@11Oracle資料庫View
- 19c資料庫impdp匯入view時hang住資料庫View
- oracle匯入TYPE物件報錯ORA-02304Oracle物件
- vue匯入錯誤 eslintrc.js語法的問題VueEsLintJS
- Python匯入包報錯(沒有這個包)Python
- oracle 匯入報錯:field in data file exceeds maximum lengthOracle
- PPT匯入3D模型匯入出現錯誤或者模型紋理消失的解決方法3D模型
- bootstrap匯入js包和css包時錯誤怎麼解決?bootJSCSS
- mysql匯入sql檔案報錯 ERROR 2013 2006 2002MySqlError
- PyCharm匯入Selenium包時報錯,需要升級pipPyCharm
- oracle10g expdp資料泵的bug,按schema匯出,匯入impdp時無jobOracle
- EXPDP匯出報ORA-31693 ORA-29913 ORA-01861錯誤
- 用VS2015匯入工程時出現error MSB8020錯誤Error
- vs2022匯入optional庫optional還報錯,解決
- 故障分析 | MySQL 使用 load data 匯入資料錯誤的一個場景MySql
- 安裝桌布彈出“自動匯入桌布發生錯誤。。。。”解決方法
- 若依框架匯入阿里OSS報錯問題解決方案框架阿里
- MySQL:客戶端匯入資料Terminal close -- query aborted報錯MySql客戶端
- Mysql資料庫使用Navicat Mysql匯入sql檔案報錯MySql資料庫
- photoshop匯出png發生未知錯誤的解決方案,ps匯出發生未知錯誤怎麼解決