Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import specific tables from oracle dump file?

I have a dump of a huge oracle database so it is impossible to import it all. I want to import a specific table called X. The problem is that X has foreign keys. If I import just X, I will get the following error:

imp user/pass@dbName tables=X  rows=y ignore=Y
ORA-02291: integrity constraint violated - parent key not found

I already have the whole db locally (but without data), I want to import all tables that are associated to X. How can I achieve that? I have plsql installed. I also need to know the order of these tables to know which to import at first.

like image 537
Wael Avatar asked Aug 06 '12 08:08

Wael


1 Answers

You dan disable all DB constraints before the import, and re-enable them afterwards. See:

  • disable-all-table-constraints-in-oracle or
  • oracle_disable_constraints
like image 55
Jens Hoffmann Avatar answered Oct 13 '22 22:10

Jens Hoffmann