The parameters EXCLUDE and INCLUDE cannot be specified in the same import job. You can use one of the following methods achieve that tables and indexes, but no triggers, constraints or referential constraints are imported. If you don't want indexes, too, you can exclude them from import in a similar way.
Method 1: You include tables in your import and use further INCLUDE directives to exclude triggers, constraints and referential constraints from import. One specifies the following:
INCLUDE=TABLE
INCLUDE=TRIGGER:"=''"
INCLUDE=CONSTRAINT:"=''"
INCLUDE=REF_CONSTRAINT:"=''"
There is not trigger that satisfies the given clause which means, that the trigger name is an empty string. The same holds for the constraint and referentali constraints
Methode 2: You do not use the INCLUDE directive to specify that only tables should be imported but use a different method. Than you can use EXCLUDE to avoid the import of triggers, constraints and referential constraints.
You can specify the list of tables you wand to import in a table import
TABLES=owner1.table1, owner2.table2, ...
EXCLUDE=TRIGGER, CONSTRAINT, REF_CONSTRAINT
If the list of tables is large than this method is not very useful.
Another way to specify tables only is to use a tablespace import. The number of tablespaces used by the tables in the dump file is usually much smaller than the numbers of tables
TABLESPACES=tablespace1, tablespace2, ...
EXCLUDE=TRIGGER, CONSTRAINT, REF_CONSTRAINT
Examples
I use Oracle Database 11.2.0.4 Enterprise Edition for these examples.
I created a schema SCOTT with some tables, triggers, procedures, constraints and referential constraints. Then I did a schema export with the following parameters
directory=SCOTT
schemas=SCOTT
dumpfile=schema.dmp
logfile=exp_schema.log
Here are the relevant parts of the logfile of this export
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** parfile=exp_schema.par
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
. . exported "SCOTT"."SALGRADE" 5.859 KB 5 rows
. . exported "SCOTT"."BONUS" 0 KB 0 rows
. . exported "SCOTT"."JOB_HISTORY" 0 KB 0 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
So user, grants, procedures, constaints, referential constraints, trigger and the five tables DEPT,EMP,SALGRADE; BONUS, JOB_HISTORY of user SCOTT are exported.
Now I will not import this dump in a database but I will only create an SQL-file with the statements that will be executed by the import. This can be achieved by the parameter SQLFILE in the import paramter file.
First I do a full import of the dumpfile. This will import everything form the dump file
directory=SCOTT
full=y
dumpfile=schema.dmp
logfile=imp_full.log
sqlfile=full.sql
This result in the following
Master table "SYSTEM"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_SQL_FILE_FULL_01": system/******** parfile=imp_full.par
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Job "SYSTEM"."SYS_SQL_FILE_FULL_01" successfully completed
If one does a schema output using
directory=SCOTT
schemas=SCOTT
dumpfile=schema.dmp
logfile=imp_schema.log
sqlfile=schema.sql
a similar logfile is created.
Now we include only the tables
directory=SCOTT
full=y
dumpfile=schema.dmp
logfile=imp_schema_inc.log
sqlfile=schema_inc.sql
include=table
This results in the following log file:
Starting "SYSTEM"."SYS_SQL_FILE_FULL_01": system/******** parfile=imp_schema_inc.par
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Job "SYSTEM"."SYS_SQL_FILE_FULL_01" successfully completed
The tables an the dependent objects are created. Now we use further INCLUDE directives to avoid the import of the unwanted objects:
directory=SCOTT
full=y
dumpfile=schema.dmp
logfile=imp_schema_inc_inc.log
sqlfile=schema_inc_inc.sql
include= table
include=trigger:"=''"
include=constraint:"=''"
include=ref_constraint:"=''"
This results in exactly what we want:
Starting "SYSTEM"."SYS_SQL_FILE_FULL_01": system/******** parfile=imp_schema_inc_inc.par
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Job "SYSTEM"."SYS_SQL_FILE_FULL_01" successfully completed
If we use a table import and specify these 5 tables and exclude the unwanted objects , we get a similar log file
directory=SCOTT
tables=SCOTT.DEPT,SCOTT.EMP,SCOTT.SALGRADE,SCOTT.BONUS,SCOTT.JOB_HISTORY
dumpfile=schema.dmp
logfile=imp_tables.log
sqlfile=tables.sql
exclude=trigger, constraint,ref_constraint
We also get such a logfile if we use a tablespace import. All objects of user SCOTT are in the tablespace USERS.
directory=SCOTT
dumpfile=schema.dmp
logfile=imp_tablespaces.log
sqlfile=tablespaces.sql
tablespaces=users
exclude=trigger, constraint, ref_constraint