impdp的TABLE_EXISTS_ACTION参数选项

impdp有一个参数选项TABLE_EXISTS_ACTION,help=y的解释为:

APPEND选项:
impdp user_exp/user_exp TABLE_EXISTS_ACTION=append dumpfile=user_exp.dmp directory=expdp_dir
ORA-39152: Table "USER_EXP"."TEST" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append
SQL> select * from test;
        ID
----------
        1
        2
        1
虽然报错,但仍插入了test记录,报错提示了数据会append附加至已存在表中,但若有依赖关系的元数据,则会忽略。
 
TRUNCATE选项:
impdp user_exp/user_exp TABLE_EXISTS_ACTION=truncate dumpfile=user_exp.dmp directory=expdp_dir
ORA-39153: Table "USER_EXP"."TEST" exists and has been truncated. Data will be loaded but all dependent metadata will be skipped due to table_exists_action of truncate
SQL> select * from test;
        ID
----------
        1
报错提示对象已被truncate,但若有依赖关系的元数据,会被忽略。

猜你喜欢

转载自www.linuxidc.com/Linux/2016-05/131838.htm