說明:
在執行全庫匯入時出現該問題.
ora-39083: object type table:"hr"."wz_menu" failed to create with error:
ora-00922: missing or invalid option
failing sql is:
create table "hr"."wz_menu" ("xtxh" number(2,0) not null enable, "xh" number(10,0) not null enable, "yhdm" varchar2(50 byte), "gnjb" number(1,0), "gndm" varchar2(50 byte), "gnmc" varchar2(100 byte), "menu" varchar2(100 byte), "gnss" varchar2(50 byte), "flxh" number(10,0), "sxh" number(3,0), "bz" varchar2(500 byte), "pic" varchar2(50 byte), "level_jb" number(1,0), "zblx" numbe
將問題sql抓出在我自己環境進行測試
測試如下:
tablespace created.
手動建立:
sql> create table "hr"."wz_menu"
("xtxh" number(2,0) not null enable,
"xh" number(10,0) not null enable,
"yhdm" varchar2(50),
"gnjb" number(1,0),
"gndm" varchar2(50),
"gnmc" varchar2(100),
"menu" varchar2(100),
"gnss" varchar2(50),
"flxh" number(10,0),
"sxh" number(3,0),
"bz" varchar2(500),
"pic" varchar2(50),
"level_jb" number(1,0),
"zblx" number(1,0),
"openwindow" varchar2(50),
"cdss" varchar2(50),
"pic_blob" blob,
constraint "pk_wz_menu" primary key ("xtxh", "xh")
using index pctfree 10 initrans 2 maxtrans 255 compute statistics
storage(initial 262144 next 1048576 minextents 1 maxextents 2147483645
pctincrease 0 freelists 1 freelist groups 1 buffer_pool default)
tablespace "ts_zongwu" enable
)pctfree 10 pctused 40 initrans 1 maxtrans 255 nocompress logging
storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645
pctincrease 0 freelists 1 freelist groups 1 buffer_pool default)
tablespace "ts_zongwu"
lob ("pic_blob") store as "basicfile"(
tablespace "ts_zongwu" enable storage in row chunk 8192 pctversion 10
nocache logging
storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645
pctincrease 0 freelists 1 freelist groups 1 buffer_pool default))
table created.
匯出該錶的建表元資料
[oracle@dgstddb ~]$
expdp "'"/ as sysdba"'" directory=dump_dir dumpfile=wz_menu.dmp logfile=wz_menu.log content=metadata_only tables=hr.wz_menu
刪除:sql> drop table hr.wz_menu;
table dropped.
執行匯入元資料:
[oracle@dgstddb ~]$
impdp \'/ as sysdba\' directory=dump_dir dumpfile=wz_menu.dmp logfile=impdp.log tables=hr.wz_menu;
import: release 11.2.0.4.0 - production on mon dec 14 22:22:21 2020
connected to: oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production
master table "sys"."sys_import_table_01" successfully loaded/unloaded
starting "sys"."sys_import_table_01": "/******** as sysdba" directory=dump_dir dumpfile=wz_menu.dmp logfile=impdp.log tables=hr.wz_menu
processing object type table_export/table/table
ora-39083: object type table:"hr"."wz_menu" failed to create with error:
failing sql is:
create table "hr"."wz_menu" ("xtxh" number(2,0) not null enable, "xh" number(10,0) not null enable, "yhdm" varchar2(50 byte), "gnjb" number(1,0), "gndm" varchar2(50 byte), "gnmc" varchar2(100 byte), "menu" varchar2(100 byte), "gnss" varchar2(50 byte), "flxh" number(10,0), "sxh" number(3,0), "bz" varchar2(500 byte), "pic" varchar2(50 byte), "level_jb" number(1,0), "zblx" number(1,0),
processing object type table_export/table/index/index
ora-39112: dependent object type index:"hr"."pk_wz_menu" skipped, base object type table:"hr"."wz_menu" creation failed
processing object type table_export/table/constraint/constraint
ora-39112: dependent object type constraint:"hr"."pk_wz_menu" skipped, base object type table:"hr"."wz_menu" creation failed
job "sys"."sys_import_table_01" completed with 3 error(s) at mon dec 14 22:22:23 2020 elapsed 0 00:00:02
仍然出現該問題,解決就是執行單錶手動建立,單錶匯入即可.但是出現問題的原因沒有找到。
Oracle資料庫全表匯入匯出
expdp test test123 test dumpfile test0908.dmp資料庫名 資料庫密碼 test dumpfile 匯出檔名.dmp impdp testnew test123 test dumpfile test0908.dmp remap schema testold t...
Oracle 匯入單錶資料
1.測試一下 刪除某一張表,然後 通過 expdp 資料庫幫浦的備份來恢復資料.測試過程 select count 1 from bizlog count 1 151drop table bizlog 2.執行備份語句.impdp lcoe739999 test6530 tables bizlog ...
oracle匯入資料庫表
使用expdp和impdp時應該注重的事項 1 exp和imp是客戶端工具程式,它們既可以在客戶端使用,也可以在服務端使用。2 expdp和impdp是服務端的工具程式,他們只能在oracle服務端使用,不能在客戶端使用。3 imp只適用於exp匯出的檔案,不適用於expdp匯出檔案 impdp只適...