11.09.2009

Working Example:

I will export dump from Estern's (db server) prod (db user) and will import this dump in juptr's (db server) nahar (db user).

I have to pass following steps-
Directory Creation -> Export the dump file to that directory of Estern -> Copy the dump file to another machine -> Make a directory to that location where I create the dump -> Impdp .dmp file to that directory of juptr


Step-1: I am searching where the space available to export?

oracle@Estern:~$ df -h

I need to make a physical directory-

oracle@Estern:~$ cd /dump
oracle@Estern:/dump$ mkdir dumps_nahar_20091015

Step-2: Create Directory

oracle@Estern:~$ sqlplus
Enter user-name: s as sysdba

SQL> Create or replace directory
dumps_nahar As '/dump/dumps_nahar_20091015';

Testing the view is really created or not-
SQL> select OWNER,DIRECTORY_NAME,DIRECTORY_PATH from DBA_DIRECTORIES where DIRECTORY_NAME like '%NAHAR%';

SQL> grant read,write on directory dumps_nahar to prod;

Step-3: Taking the Dump or Export the Dump

expdp prod/password DIRECTORY=dumps_nahar SCHEMAS=prd7 DUMPFILE=nahar_from_Estern_20091015_%U.dmp

Step-4: copy dump from Estern to Jupiter

Now I am coping the dump file from Estern to Juptr's /backup1/dumps_nahar_20091015 location.

bash-3.00$ scp nahar_from_Estern_20091015_01.dmp oracle@juptr:/backup1/dumps_nahar_20091015

--Export from Estern and Copy the dump in juptr done.
--Now I will Import the dump in Juptr's nahar user.

oracle@juptr:~$ sqlplus s as sysdba
Step-5: Want to import the dump at nahar user

If nahar does not exists-
SQL> create user nahar identified by nahar
default tablespace users quota unlimited on users;

SQL> grant dba to nahar;

Step-6: Create Directory where the dump I copied

SQL> Create or replace directory
dumps_nahar As '/backup1/dumps_nahar_20091015';

Testing the view is really created or not-
SQL> select OWNER,DIRECTORY_NAME,DIRECTORY_PATH from DBA_DIRECTORIES where DIRECTORY_NAME like '%NAHAR%';

SQL> grant read,write on directory dumps_nahar to nahar;

Step-7: Import the dump

impdp system/password DIRECTORY=dumps_nahar SCHEMAS=prd7 DUMPFILE=nahar_from_Estern_20091015_01.dmp REMAP_SCHEMA=prd7:nahar PARALLEL=3