impdp table_exists_action 参数说明

 关于impdp中的table_exits_action参数的含义,官网说明如下
    http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_import.htm
   

TABLE_EXISTS_ACTION

Default: SKIP (Note that if CONTENT=DATA_ONLY is specified, the default is APPEND, not SKIP.)

默认参数为:skip (注意,如果指定了content=data_only,则该参数的默认为append,而不是skip)

Purpose(用途)

Tells Import what to do if the table it is trying to create already exists.

告诉impdp在执行导入操作时尝试创建的表已经存在时,如何处理

Syntax and Description(语法)

TABLE_EXISTS_ACTION={SKIP | APPEND | TRUNCATE | REPLACE}

The possible values have the following effects:

  • SKIP leaves the table as is and moves on to the next object. This is not a valid option if the CONTENT parameter is set to DATA_ONLY.

  • APPEND loads rows from the source and leaves existing rows unchanged.

  • TRUNCATE deletes existing rows and then loads rows from the source.

  • REPLACE drops the existing table and then creates and loads it from the source. This is not a valid option if the CONTENT parameter is set toDATA_ONLY.

    skip :跳过已经存在的这个表,导入下一个对象。当content=data_only时,skip是无效的。
    append:对已经存在的表和行数据进行保留,并导入新的行数据。插入新的数据时,不会使用freelist中的空闲空间,而是直接插入到高水位线(HWM) 以上的空间
    truncate :删除已经存在的行数据,然后将dmp文件中数据导入。
    replace:删除存在的表,然后创建表,将数据导入表。当content=data_only时,replace参数无效。

The following considerations apply when you are using these options:

  • When you use TRUNCATE or REPLACE, make sure that rows in the affected tables are not targets of any referential constraints.

  • When you use SKIP, APPEND, or TRUNCATE, existing table-dependent objects in the source, such as indexes, grants, triggers, and constraints, are ignored. For REPLACE, the dependent objects are dropped and re-created from the source, if they were not explicitly or implicitly excluded (usingEXCLUDE) and they exist in the source dump file or system.

  • When you use APPEND or TRUNCATE, checks are made to ensure that rows from the source are compatible with the existing table prior to performing any action.

    The existing table is loaded using the external tables access method if the existing tables have active constraints and triggers. However, be aware that if any row violates an active constraint, the load fails and no data is loaded.

    If you have data that must be loaded, but may cause constraint violations, consider disabling the constraints, loading the data, and then deleting the problem rows before reenabling the constraints.

  • When you use APPEND, the data is always loaded into new space; existing space, even if available, is not reused. For this reason, you may wish to compress your data after the load.

Restrictions

  • TRUNCATE cannot be used on clustered tables or over network links.
    truncate参数不能用于簇表或者dblink方式

Example

The following is an example of using the TABLE_EXISTS_ACTION parameter. You can create the expfull.dmp dump file used in this example by running the example provided for the Export FULL parameter. See FULL.

> impdp hr/hr TABLES=employees DIRECTORY=dpump_dir1 DUMPFILE=expfull.dmp
TABLE_EXISTS_ACTION=REPLACE


你可能感兴趣的:(oracle)