Oracle exp/imp Parfile: Direct Path Schema Migration
Oracle exp/imp Parameter File: Direct Path User-to-User Data Migration
Moving two schemas from one database to another with the original exp and imp tools means typing a long list of options twice, once per tool. A parameter file (parfile) keeps those options in one place, so the same run can be repeated and checked later. The file below mixes OS authentication, direct path export, and schema remapping, and it carries one trap: some of its options belong only to exp and some only to imp.
The Parameter File
The original parameter file:
1userid=/
2file=/u03/scr9/oradata/expimp/exppipe
3log=/u03/scr9/oradata/expimp/imp_scr9.log
4rows=y
5constraints=n
6ignore=y
7indexes=n
8grants=n
9full=n
10feedback=10000
11direct=y
12fromuser=andy,user2
13touser=andy,user2
Split it into an export file and an import file
As written, neither tool can run this file. DIRECT is an Export parameter and is not in the Import parameter list. FROMUSER and TOUSER are Import parameters and are not in the Export parameter list. On the export side, the schemas are named with OWNER=. Split the options into two files:
export.par:
1userid=/
2file=/u03/scr9/oradata/expimp/exppipe
3log=/u03/scr9/oradata/expimp/exp_scr9.log
4owner=andy,user2
5rows=y
6direct=y
7feedback=10000
import.par:
1userid=/
2file=/u03/scr9/oradata/expimp/exppipe
3log=/u03/scr9/oradata/expimp/imp_scr9.log
4fromuser=andy,user2
5touser=andy,user2
6rows=y
7ignore=y
8constraints=n
9indexes=n
10grants=n
11feedback=10000
Run each file with its own tool:
1exp parfile=export.par
2imp parfile=import.par
Release note: the Oracle 19c utilities guide still documents exp, but says original Export is desupported for general use as of Oracle Database 11g. The Release 26 Data Pump documentation states that exp can no longer be used. imp is still needed to load a dump file that exp created.
What This File Does
The original file was meant to export the data rows of two schemas (andy and user2) with a direct path read, then import them into the same schema names in the target database, with user-created indexes, constraints, and object grants left out. The split files above do that job: export.par selects the schemas with owner=, and import.par maps them with fromuser/touser.
Line-by-Line Breakdown
userid=/
This uses OS authentication: no username or password is stored in the file. The forward slash (/) asks Oracle to log in the current operating system user. Oracle adds the OS_AUTHENT_PREFIX value (default OPS$) to the OS account name and looks for a database user with that name. Because no password sits in the file, the file can be shared or kept in version control without exposing a credential.
file=/u03/scr9/oradata/expimp/exppipe
This is the dump file path: where the export writes data and where the import reads it. The name exppipe suggests it points at a Unix named pipe (FIFO) rather than a plain file. The Oracle 19c Export and Import guides do not describe named pipes, so test any pipe-based setup on your own platform before you depend on it.
log=/u03/scr9/oradata/expimp/imp_scr9.log
This sets the log file where Oracle writes the full output of the operation. The log is where you check row counts and object errors after the run. The _scr9 in the filename likely refers to the source database name or SID (scr9), so the log shows which database the import came from.
rows=y
Tells Oracle to export and import the actual data rows in the tables. Setting this to n would export only the schema structure (DDL), which is useful for schema-only clones. Here it is y, meaning full row data is transferred.
constraints=n
Skips table constraints in the dump file. Primary key constraints for index-organized tables (IOTs) and object tables are still imported. In a normal import, referential constraints are created only after all tables are loaded, so table order does not cause errors there. The risk comes when rows go into tables that already exist (as with ignore=y below): constraints already on those tables stay enabled and can reject rows. Disable referential constraints on the target tables before the import, and enable them again after the data is loaded.
ignore=y
Tells the import utility to ignore object creation errors — most commonly, "table already exists" errors. Without this, if a target table already exists, the import would stop for that object. With ignore=y, it continues and loads rows even if the table structure is already present. This is standard practice when doing a data refresh into an existing schema.
indexes=n
Postpones user-created indexes until after the import. System-generated indexes, such as LOB indexes, OID indexes, and unique constraint indexes, are re-created by Import whatever this parameter says. With indexes=n you load the rows first and build your own indexes afterward, at a time you choose.
grants=n
Skips object-level grants (privileges given to other users on these objects). This prevents unintentional privilege replication into the target environment — important when migrating between production, test, or development databases where access control must differ.
full=n
This is not a full database export/import. With full=n, the export is scoped to the users named in owner=, and the import to the users named in fromuser/touser. A full export (full=y) requires the EXP_FULL_DATABASE role and exports the entire database, including tablespace definitions. Because full=n is the default, the split files above leave it out.
feedback=10000
Displays a progress dot every 10,000 rows. Both exp and imp accept it, and the value applies to every table in the run. During a long import it shows the process is still moving. For very large tables, a higher number prints fewer dots.
direct=y
This enables direct path export: data is read from disk into the buffer cache and rows are transferred directly to the Export client, bypassing the SQL command-processing layer (the evaluating buffer). It can be much faster than conventional path export (direct=n). It is an Export-only parameter; Import has no DIRECT option. Restrictions in 19c include: QUERY cannot be used with direct=y, BUFFER has no effect (use RECORDLENGTH instead), it cannot be started interactively, and the session's NLS_LANG must equal the database character set or the export stops with a warning.
fromuser=andy,user2
An import parameter: a comma-delimited list of the schemas to import from the dump file (andy and user2). It is relevant only to users with the IMP_FULL_DATABASE role. exp does not use it; on the export side, list the schemas with OWNER=.
touser=andy,user2
Specifies the target schemas to import data into. The mapping is positional — andy maps to andy, and user2 maps to user2. If you wanted to remap schemas (for example, import andy's data into user3), you would write touser=user3,user2. Like fromuser, touser is an imp parameter only.
Key Points and Insights
- One file per tool:
direct=ybelongs toexp;fromuser,touser, andignore=ybelong toimp. Keep an export parfile and an import parfile. - Load order:
direct=yspeeds up the export side. On the import side,indexes=nandconstraints=nlet you load rows first and add user-created indexes and constraints afterward. - Selective migration:
owner=on export andfromuser/touseron import move only the named schemas, not the whole database. - Modern alternative: For Oracle Database 10g release 1 and later, Oracle recommends Data Pump (
expdp/impdp) in most cases, citing greatly enhanced performance. Data Pump Export has aPARALLELparameter and its ownPARFILEparameter. - Legacy compatibility: Oracle Data Pump includes a legacy mode that recognizes
exp/imp-style parameters, so existing scripts using this pattern can often run without changes. - Parameter file naming: the parfile name follows the operating system's file-naming rules. Oracle requires no particular extension;
.paris a convention that makes the files easy to find. - Command-line parameters: Parameters can also be given on the command line together with
parfile=<file>; test which value wins on your release before relying on it.
References
- Oracle 19c Original Export Utility Documentation — Official Oracle 19c reference for the legacy
exputility, including all supported parameters andPARFILEusage. - Oracle 19c Original Import Utility Documentation — Official Oracle 19c reference for the legacy
imputility coveringFROMUSER,TOUSER,IGNORE, and all import parameters. - Oracle Data Pump Legacy Mode Use Cases — Release 26 page on how Data Pump handles legacy
exp/impparameters, and the note thatexpcan no longer be used. - Oracle 19c Data Pump Export Utility — The
expdpparameter list, includingPARFILEandPARALLEL. - OS_AUTHENT_PREFIX — Oracle 19c Database Reference — The prefix (default
OPS$) Oracle adds to OS account names for OS-authenticated logins such asuserid=/. - Export direct=y — Ask TOM (Oracle) — Ask TOM question thread on
direct=yin theexputility. - Oracle Import/Export FAQ — OraFAQ — Community FAQ covering common
exp/impusage patterns, parameter references, and examples.