HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How do I import data into oracle 11g r2 using a `.dmp` file and a `.par` file?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
11gfileintoparusingdmphowandoracledata

Problem

How do I import data into a new installation of oracle 11g r2 using a .dmp file and a .par file?

Here is what I have done so far, on a Windows 8.1 devbox:

1.) Open command line as administrator
2.) C:\WINDOWS\system32>sqlplus / as sysdba
This will reveal the SQL prompt as follows:  
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 25 14:20:46 2016
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CREATE DIRECTORY DMPDIR AS 'C:\path\to\DumpDir\';
    SQL> exit;
3.) Then back in windows command prompt:  
C:\WINDOWS\system32>impdp parfile=C:\path\to\DumpDir\impdp.par;


Then I read this other posting which contains the following answer code:

impdp user/pass schemas=schema1 directory=dumpdir \
  remap_schema=schema1:schema2 \
  dumpfile=schema1.dmp \
  logfile=impdp_schema2.log


Since my question is slightly different, I guessed at the following, which I have not typed yet:

impdp schemas=schema1 directory=dumpdir \
  dumpfile=schema1.dmp \
  logfile=impdp_logfile.log


What is the correct syntax to use? And what other steps should I take to do this properly?

Solution

The PAR file is a parameter file, which contains parameters for data pump that you don't need to enter on the command line. Without knowing what those are, we can't advise what you need to use in any detail.

Generally speaking, if you have a parameter file, you just put that on the command line:

impdp user/pass parfile=/path/to/parfile


However, there may be other parameters required.

Assuming you have a parameter file, you need the command line to contain at minimum:

Username
Parfile


To perform an import, you need at minimum these parameters defined between the command line and parameter file:

Username
Directory
Dumpfile
Full OR Schemas OR Tables
(and for good practice, Logfile)


For a basic import, those four parameters between the command line and the parameter file will import data. Without knowing what you're trying to achieve, anything else is guesswork.

Code Snippets

impdp user/pass parfile=/path/to/parfile
Username
Parfile
Username
Directory
Dumpfile
Full OR Schemas OR Tables
(and for good practice, Logfile)

Context

StackExchange Database Administrators Q#130515, answer score: 3

Revisions (0)

No revisions yet.