0

I am using the imp command for importing a database but after one time, we are executing the imp command again so that data is inserted a 2nd time. We want to remove the old data and insert fresh data.

This is what I tried...

Please help me and suggest for specific parameter which is help solved that type of problem..

thanks and sorry for my English..

Patrick Bacon
  • 4,490
  • 1
  • 26
  • 33
PRASHANT
  • 1
  • 1
  • 2

1 Answers1

-2

IMPDP has the parameter: TABLE_EXISTS_ACTION = {SKIP | APPEND | TRUNCATE | REPLACE}

table_exists_action=skip: This says to ignore the data in the import file and leave the existing table untouched. This is the default and it is not a valid argument if you set content=data_only.

table_exists_action=append: This says to append the export data onto the existing table, leaving the existing rows and adding the new rows from the dmp file. Of course, the number and types of the data columns must match to use the append option. Just like the append hint, Oracle will not re-user any space on the freelists and the high-water mark for the table will be raised to accommodate the incoming rows.

table_exists_action=truncate: This says to truncate the existing table rows, leaving the table definition and replacing the rows from the expdp dmp file being imported. To use this option you must not have any referential integrity (constraints) on the target table. You use the table_exists_action=truncate when the existing table columns match the import table columns. The truncate option cannot be used over a db link or with a cluster table.

table_exists_action=replace: This says to delete the whole table and replace both the table definition and rows from the import dmp file. To use this option you must not have any referential integrity (constraints) on the target table. You use the table_exists_action=replace when the existing table columns do not match the import table columns.

Rene
  • 10,391
  • 5
  • 33
  • 46
  • What I do is first run a script that drops all tables and then run the import. – Rene Mar 25 '15 at 12:15
  • The imp and impdp tool are not part of the same tool suite. In some light environment (like CI), only imp is available and impdp is not an option. – Jidehem May 25 '18 at 12:48
  • Oracle, imp and impdp are tagged by OP. So I don't see the problem. – Rene May 26 '18 at 13:29