Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Need to Exclude Set of Tables from Data Pump Export

user7204947Jan 8 2025

I'm trying to run a datapump export that excludes a set of tables. Here is an example of the tables that I have in the schema…

    ACCOUNT
    ADDRESS
    ARRAY
    CALENDAR
    DOCUMENT

Each of these tables has a corresponding table that starts with "A_"...

    A_ACCOUNT
    A_ADDRESS
    A_ARRAY
    A_CALENDAR
    A_DOCUMENT

I would like to exclude all of the "A_" tables from the export. My first thought was to create a parfile with the following…

    SCHEMAS=xxxxxxx
    EXCLUDE=TABLE:"'NOT IN(select * from user_tables where table_name like 'A_%')'"

I knew this would not work because of the underscore (which is a wildcard in a LIKE clause) in the table name. It excludes all of the tables that start with the letter A.

I included an escape in the SELECT statement…

    SCHEMAS=xxxxxxx
    EXCLUDE=TABLE:"'NOT IN(select * from user_tables where table_name like 'A\_%' escape '\')'"

This select statement works fine when running it in SQL Plus. However, when running the export I get the following error…

    Export: Release 19.0.0.0.0 - Production on Wed Jan 8 17:16:46 2025
    Version 19.25.0.0.0
    
    Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
    
    Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    ORA-39001: invalid argument value
    ORA-39071: Value for EXCLUDE is badly formed.
    ORA-00920: invalid relational operator

Anyone have thoughts on how to exclude the "A_" tables without excluding the tables that start with "A"??

Comments
Post Details
Added on Jan 8 2025
5 comments
42 views