How-to : Import a .dmp file

Introduction

This post gives a very quick reference guide (it is also a good reminder to me) on how to import a .dmp (dump file) on an oracle instance.

Note : I use this command when i needed to built a “test environment” for my school homework. The complete environment is composed by an Oracle server express 10g plus Oracle SQL Developer.

1 Required variables

You need to set different variables, such as :

  • export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
  • export ORACLE_SID=xe
  • export ORACLE_PATH=$PATH:$ORACLE_HOME/bin

 

2 User permission

The user you use to connect to the oracle instance must have the “dba” Role permissions to run the import. This can be done through SQL Developer (check this post to install this piece of software)

 

3 Import the .dmp file

Use the following command to import your .dmp file.

  • /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/imp <user>@<SID> file="path/to/.dmp_file" FULL=Y

     

    • You get an output like
      [pier@CentOSTest Downloads]$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/imp biblio@xe file="/home/pier/Desktop/biblio.dmp" FULL=Y
      
      Import: Release 10.2.0.1.0 - Production on Tue May 8 00:13:27 2012
      
      Copyright (c) 1982, 2005, Oracle.  All rights reserved.
      
      Password:
      
      Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
      
      Export file created by EXPORT:V10.02.01 via conventional path
      import done in US7ASCII character set and AL16UTF16 NCHAR character set
      import server uses WE8MSWIN1252 character set (possible charset conversion)
      export client uses WE8MSWIN1252 character set (possible charset conversion)
      . importing BIBLIO's objects into BIBLIO
      . . importing table                      "AUTEURS"         73 rows imported
      . . importing table                     "CONTIENT"        367 rows imported
      . . importing table                      "ECRITEN"        359 rows imported
      . . importing table                     "ECRITPAR"        364 rows imported
      . . importing table                    "ECRITURES"       2278 rows imported
      . . importing table                     "EDITEURS"         57 rows imported
      . . importing table                  "EMPRUNTEURS"      16809 rows imported
      . . importing table                     "EMPRUNTS"       2283 rows imported
      . . importing table                         "ETAT"          9 rows imported
      . . importing table                  "EXEMPLAIRES"        378 rows imported
      . . importing table                        "GENRE"         22 rows imported
      . . importing table                       "LANGUE"          7 rows imported
      . . importing table                      "OEUVRES"        365 rows imported
      . . importing table                     "OUVRAGES"        233 rows imported
      . . importing table                       "PARUEN"        237 rows imported
      . . importing table                         "PAYS"         13 rows imported
      . . importing table                   "PLAN_TABLE"         34 rows imported
      . . importing table                      "RELIURE"          5 rows imported
      . . importing table                         "TYPE"          7 rows imported
      . . importing table                       "TYPECR"          6 rows imported
      . . importing table                      "VOLUMES"        253 rows imported
      About to enable constraints...
      Import terminated successfully without warnings.

 

You should be done now.

Tagged on: , , ,

2 thoughts on “How-to : Import a .dmp file

Leave a Reply to pier Cancel reply

Your email address will not be published. Required fields are marked *

This site supports SyntaxHighlighter via WP SyntaxHighlighter. It can highlight your code.
How to highlight your code: Paste your code in the comment form, select it and then click the language link button below. This will wrap your code in a <pre> tag and format it when submitted.