匯入一個有lob型別欄位的表且存在與匯入表同名的同義詞會報ora-01403錯誤
如果你一表包含一個lob型別的列如果存在一個與這個表同名的同義詞那麼在匯入這個表的資料時會報ora-01403錯:
在oracle10g中的測試情況如下:
1.建立兩個使用者test和cs
idle> conn sys/zzh_2046@jy_1 as sysdba 已連線。 sys@JINGYONG> grant dba to test identified by test; 授權成功。 sys@JINGYONG> grant dba to cs identified by cs; 授權成功。
2.在使用者test中建立一個有clob型別的列的表emp並向表中插入幾行記錄
sys@JINGYONG> conn test/test@jy_1 已連線。 test@JINGYONG> create table emp (col_a number, col_b varchar2(3), c_lob clob); 表已建立。 test@JINGYONG> test@JINGYONG> INSERT INTO EMP VALUES (180, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (181, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (182, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (183, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (184, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (185, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> commit; 提交完成。
連線到使用者cs並建立一個同義詞叫EMP
1.建立同義詞EMP是使用test.emp表來建立(也可以用任意表來建立同義詞EMP,只要保證同義詞的名字與要匯入表的名字相同就行)
test@JINGYONG> conn cs/cs@jy_1 已連線。 cs@JINGYONG> create synonym EMP for test.EMP; 同義詞已建立。 cs@JINGYONG> commit; 提交完成。 cs@JINGYONG> C:\Documents and Settings\Administrator>exp test/test@jy_1 file=f:\emp.dmp table s=EMP Export: Release 10.2.0.1.0 - Production on 星期四 12月 19 22:00:15 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集 即將匯出指定的表透過常規路徑... . . 正在匯出表 EMP匯出了 6 行 成功終止匯出, 沒有出現警告。 C:\Documents and Settings\Administrator>imp cs/cs@jy_1 file=f:\emp.dmp tables=EM P ignore=y Import: Release 10.2.0.1.0 - Production on 星期四 12月 19 22:01:48 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案 警告: 這些物件由 TEST 匯出, 而不是當前使用者 已經完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的匯入 . 正在將 TEST 的物件匯入到 CS . 正在將 TEST 的物件匯入到 CS . . 正在匯入表 "EMP" IMP-00058: 遇到 ORACLE 錯誤 1403 ORA-01403: no data found匯入了 6 行 成功終止匯入, 但出現警告。
2.使用表t1來建立同義詞EMP
cs@JINGYONG> create synonym EMP for sys.t1; 同義詞已建立。 cs@JINGYONG> drop table emp; drop table emp * 第 1 行出現錯誤: ORA-00942: 表或檢視不存在 C:\Documents and Settings\Administrator>imp cs/cs@jy_201 file=f:\emp.dmp tables= EMP ignore=y Import: Release 10.2.0.1.0 - Production on 星期五 12月 20 08:13:07 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案 警告: 這些物件由 TEST 匯出, 而不是當前使用者 已經完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的匯入 . 正在將 TEST 的物件匯入到 CS . 正在將 TEST 的物件匯入到 CS . . 正在匯入表 "EMP" IMP-00058: 遇到 ORACLE 錯誤 1403 ORA-01403: 未找到任何資料 IMP-00058: 遇到 ORACLE 錯誤 904 ORA-00904: "C_LOB": 識別符號無效 成功終止匯入, 但出現警告。
11g的測試
1.建立兩個使用者test和cs
idle> conn sys/zzh_2046@jy_201 as sysdba 已連線。 sys@JINGYONG> grant dba to test identified by test; 授權成功。 sys@JINGYONG> grant dba to cs identified by cs;
2.在使用者test中建立一個有clob型別的列的表emp並向表中插入幾行記錄
sys@JINGYONG> conn test/test@jy_201 已連線。 test@JINGYONG> create table emp (col_a number, col_b varchar2(3), c_lob clob); 表已建立。 test@JINGYONG> test@JINGYONG> INSERT INTO EMP VALUES (180, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (181, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (182, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (183, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (184, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> INSERT INTO EMP VALUES (185, 'a', '01010101010101'); 已建立 1 行。 test@JINGYONG> commit; 提交完成。
連線到使用者cs並建立一個同義詞叫EMP
1.建立同義詞EMP是使用test.emp表來建立(也可以用任意表來建立同義詞EMP,只要保證同義詞的名字與要匯入表的名字相同就行)
test@JINGYONG> conn cs/cs@jy_201 已連線。 cs@JINGYONG> create synonym EMP for test.EMP; 同義詞已建立。 cs@JINGYONG> commit; 提交完成。 cs@JINGYONG>
使用10g的客戶端連線到11g的資料庫進行匯出操作
C:\Documents and Settings\Administrator>exp test/test@jy_201 file=f:\emp.dmp tab les=EMP Export: Release 10.2.0.1.0 - Production on 星期四 12月 19 22:10:28 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集 即將匯出指定的表透過常規路徑... . . 正在匯出表 EMP匯出了 6 行 成功終止匯出, 沒有出現警告。
使用10g的客戶端連線到11g的資料庫進行匯入操作也會報ora-01403錯誤
C:\Documents and Settings\Administrator>imp cs/cs@jy_201 file=f:\emp.dmp tables= EMP ignore=y Import: Release 10.2.0.1.0 - Production on 星期四 12月 19 22:11:27 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案 警告: 這些物件由 TEST 匯出, 而不是當前使用者 已經完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的匯入 . 正在將 TEST 的物件匯入到 CS . 正在將 TEST 的物件匯入到 CS . . 正在匯入表 "EMP" IMP-00058: 遇到 ORACLE 錯誤 1403 ORA-01403: 未找到任何資料匯入了 6 行 成功終止匯入, 但出現警告。
使用11g的客戶端連線到11g的資料庫進行匯出操作
[oracle@jingyong ~]$ exp test/test file=/home/oracle/emp.dmp tables=EMP Export: Release 11.2.0.1.0 - Production on Sat Dec 7 01:41:44 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set About to export specified tables via Conventional Path ... . . exporting table EMP 12 rows exported Export terminated successfully without warnings.
使用11g的客戶端連線到11g的資料庫進行匯出操作在有與匯入表同名的同義詞的情況下不會報ora-01403錯誤.
[oracle@jingyong ~]$ imp cs/cs file=/home/oracle/emp.dmp tables=EMP ignore=y Import: Release 11.2.0.1.0 - Production on Sat Dec 7 01:42:20 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 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 TEST, not by you import done in ZHS16GBK character set and AL16UTF16 NCHAR character set . importing TEST's objects into CS . importing TEST's objects into CS . . importing table "EMP" 12 rows imported Import terminated successfully without warnings. [oracle@jingyong ~]$
下面刪除與表同名的同義詞而且使用10g的客戶端連線11g資料庫進行匯入操作也是不會報ora-01403錯誤的
C:\Documents and Settings\Administrator>sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 12月 20 07:51:34 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. idle> conn cs/cs@jy_1 已連線。 cs@JINGYONG> drop synonym EMP; 同義詞已刪除。 C:\Documents and Settings\Administrator>imp cs/cs@jy_201 file=f:\emp.dmp tables= EMP ignore=y Import: Release 10.2.0.1.0 - Production on 星期五 12月 20 09:02:40 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連線到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案 警告: 這些物件由 TEST 匯出, 而不是當前使用者 已經完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的匯入 . 正在將 TEST 的物件匯入到 CS . 正在將 TEST 的物件匯入到 CS . . 正在匯入表 "EMP"匯入了 6 行 成功終止匯入, 沒有出現警告。
出現這個問題的原因:
是因為bug 7422758 IMPORTING A TABLE WITH A BLOB OR CLOB USING A SYNONYM CAUSES ORA-1403, fixed with 11.2.
解決方法:
1. 升級到11.2.
2. 打7422758補釘
注意:
在oracle11gr2版本中如果在對某個使用者匯入某個表時,而這個表有一個lob型別的列且這個使用者存一個與要匯入表同名的同義詞,在這種情況下使用oracle11gr2版本的客戶端進行匯出再匯入是不會報ora-01403錯誤.如果使用oracle11gr2版本以下的客戶端進行匯出和匯入也是會報ora-01403錯誤的.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-1063849/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- impdp匯入包含xmltype型別欄位空表報錯問題XML型別
- 匯入sql時報日期型別錯誤SQL型別
- DB2表的匯入與匯出DB2
- 帶有LOB欄位的表遷移
- 移動一個帶有lob欄位的表到另外一個表空間的語法
- MySQL表資料匯入與匯出MySql
- 使用datapump 匯出匯入同義詞(export and import synonym using datapump)ExportImport
- Progress資料表的匯入匯出
- 修改表的欄位型別型別
- SQL Server中text型別匯入oracle clob欄位時的設定SQLServer型別Oracle
- oracle排除表匯入匯出Oracle
- 匯出Oracle中的同義詞Oracle
- 【ORACLE 匯入匯出】exp 錯誤Oracle
- Oracle如何把一個表匯出匯入到另一個伺服器上的另一個表裡Oracle伺服器
- 分享:一個基於NPOI的excel匯入匯出元件(強型別)Excel元件型別
- sqlserver查詢一個庫所有表的欄位名及欄位型別SQLServer型別
- mysqlimport匯入報錯的排查MySqlImport
- impdp匯入XMLTYPE欄位型別的資料出現亂碼的問題XML型別
- mysqldump匯入匯出表資料MySql
- 資料泵匯出匯入表
- [Mysql]——備份、還原、表的匯入匯出MySql
- 匯出oracle公有同義詞Oracle
- 【原創】匯出所有物件(表、索引、檢視、同義詞)的建立指令碼物件索引指令碼
- 使用工具類 使用poi匯入匯出excel報表Excel
- DB2資料庫匯出表結構與匯入、匯出表資料DB2資料庫
- Oracle 帶LOB欄位的表的遷移Oracle
- 華表Cell檔案匯入匯出
- 表存在Clob、Blob欄位,dblink報錯的解決辦法
- ThinkPHP5.1 Excel 表的匯入匯出操作 (PHPExcel)PHPExcel
- Excel 表匯入資料Excel
- postgresql怎麼匯入表SQL
- excel 表匯入到mysqlExcelMySql
- OracleDatabase——資料庫表空間dmp匯出與匯入OracleDatabase資料庫
- 【ORA-01555】Oracle LOB欄位匯出 報錯 ORA-01555Oracle
- 使用sqlldr匯入日期格式欄位的問題SQL
- IMPDP 多個表空間物件匯入到一個表空間中物件
- 資料泵匯入分割槽表統計資訊報錯(七)
- 資料泵匯入分割槽表統計資訊報錯(二)