Thursday, September 3, 2009

Import *.dmp file into Oracle 10g XE on Linux (Ubuntu)

Recently I installed Oracle 10g XE on my laptop on Windows Vista and was happy to see the same was available for Linux (Ubuntu). I downloaded the Linux version of Oracle 10g XE and installed it on Ubuntu. Installation is a straight forward process, just double click on the file and make sure you see the details before closing the installation window. You will need to run a command with "root" privileges to complete the Oracle installation. The command is as bellow:

sudo /etc/init.d/oracle-xe configure

You will be asked for Oracle configuration: port numbers and the password for the "system" and "sys" accounts.

After the installation you will want to import the data into Oracle from the .dmp file. Doing so on Windows is easy using Toad. The Linux equivalent for Toad, Tora for some reasons does not wants to connect to Oracle on Ubuntu and does not comes with an option to select the database as Oracle. You may try the other free softwares: SQL Developer from Oracle and Navicat 8 Lite for Oracle.

For importing the .dmp file into Oracle make sure the user with which you have logged in is a member of the "dba" group. Make the appropriate changes using the User and Groups from the Settings. Once this is done you can use the "imp" executable to import the .dmp file. The general syntax is as follows:

imp userid=system file=user_a.dmp log=imp.log fromuser=a touser=b
Click here for a detailed description on importing data into Oracle from a .dmp file.
Example for using the "imp" utility:

./imp userid=a file=/home/abc/dag.DMP log=/home/abc/exp_dag.log fromuser=b touser=a

abc = Linux user
a = Oracle schema (user) into which the data is to be imported
b = Oracle schema(user) from which the backup was taken.

Make sure to change your directory to

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

before you run the "imp" utility. If everything goes right then all the data will be imported into Oracle 10g XE.

0 comments:

Post a Comment