从oracle 11g备份恢复表时,INCLUDE命令中包含2个以上的条目会返回语法错误。
有效的命令是:
impdp SVC_DEMO/********* SCHEMAS=test REMAP_SCHEMA=test:SVC_DEMO REMAP_TABLESPACE=DATA:SYSTEM DIRECTORY=dmpdir DUMPFILE=devv2db_05102016.dmp TABLE_EXISTS_ACTION=replace INCLUDE = TABLE:"IN('TBLPARTNER')" LOGFILE=impschema1.log
Starting "SVC_DEMO"."SYS_IMPORT_SCHEMA_02": SVC_DEMO/********
SCHEMAS=test REMAP_SCHEMA=test:SVC_DEMO
REMAP_TABLESPACE=DATA:SYSTEM DIRECTORY=dmpdir DUMPFILE=devv2db_05102016.dmp
LOGFILE=impschema1.log
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SVC_DEMO"."TBLPARTNER" 21.46 KB 7 rows
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SVC_DEMO"."SYS_IMPORT_SCHEMA_02" successfully completed at 15:01:38
但是,当我在include命令中添加第二个表时:
impdp SVC_DEMO/********* SCHEMAS=test REMAP_SCHEMA=test:SVC_DEMO REMAP_TABLESPACE=DATA:SYSTEM DIRECTORY=dmpdir DUMPFILE=devv2db_05102016.dmp TABLE_EXISTS_ACTION=replace INCLUDE = TABLE:"IN('TBLPARTNER', 'TBLACCOUNT')" LOGFILE=impschema1.log
我收到以下消息:
impdp SVC_DEMO/****** SCHEMAS=test REMAP_SCHEMA=test:SVC_DEMO
REMAP_TABLESPACE=DATA:SYSTEM DIRECTORY=dmpdir
DUMPFILE=devv2db_05102016.dmp TABLE_EXISTS_ACTION=replace INCLUDE =
TABLE:"IN('TBLPARTNER', 'TBLACCOUNT')" LOGFILE=impschema1.log
LRM-00116: syntax error at ')' following 'TBLACCOUNT'
我已经找到了impdp中的错误但找不到错误。
我做错了吗?
答案 0 :(得分:0)
由于您是在命令行上运行此操作,因此根据您的操作系统,可能需要转义特殊字符。 (使用参数文件也更容易,你不需要转义字符)
include=TABLE:\"IN \(\'TABLE1\', \'TABLE2\'\)\"
使用参数文件,您只需在每行放置一个选项并使用
引用它impdp PARFILE=name.txt