Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing selective data using impdp

I have an entire DB to be imported as a dump into my own. I want to exclude data out of certain tables(mostly because they are huge in size and not useful). I cannot entirely exclude those tables since I need the table object per se(minus the data) and will have to re create them in my schema if I do so. Also in the absence of those table objects , various other foreign constraints defined on other tables will also fail to be imported and will need to be redefined.So I need to exclude just the data from certain tables.I want data from all other tables though.

Is there a set of parameters for impdp that can help me do so?

like image 760
atlantis Avatar asked Mar 26 '09 15:03

atlantis


2 Answers

I would make two runs at it: The first I would import metadata only:

impdp ... CONTENT=METADATA_ONLY

The second would include the data only for the tables I was interested in:

impdp ... CONTENT=DATA_ONLY TABLES=table1,table2...

like image 173
DCookie Avatar answered Sep 30 '22 03:09

DCookie


Definitely make 2 runs. One to create all the table objects, but instead of using tables in the second impdp run, use the exclude

impdp ... Content=data_only exclude=TABLE:"IN ('table1', 'table2')"

The other way works, but this way you only have to list the tables you don't want versus all that you want.

like image 23
MichaelN Avatar answered Sep 30 '22 03:09

MichaelN