sqloracle-databaseimpdp

Get first X rows from table in Oracle IMPDP


I would like to get only first X rows from a specified tables. I do import data pump via .par file, where I have my instructions inserted.

I tried many combination but none is working.

As far as I searched in docs I should do something like:

INCLUDE=TABLE:"IN ('TABLE1', 'TABLE2', 'TABLE3') FETCH FIRST 10 ROWS ONLY"

But I got error saying that value for INCLUDE is badly formed:

ORA-39001: invalid argument value
ORA-39071: Value for INCLUDE is badly formed.
ORA-00933: SQL command not properly ended

Version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production


Solution

  • I think you have to combine QUERY=TABLE1:"WHERE rownum <= X" to your parameter file. Bear in mind FETCH is a 12c feature not available in 11g.

    So it would look something like this:

    INCLUDE=TABLE:"IN ('TABLE1', 'TABLE2', 'TABLE3')"
    QUERY=TABLE1:"WHERE rownum <= 100"
    QUERY=TABLE2:"WHERE rownum <= 100"
    QUERY=TABLE3:"WHERE rownum <= 100"