Showing posts with label datapump. Show all posts
Showing posts with label datapump. Show all posts

How to use multiple paths during expdp& impdp

How to use multiple paths during expdp& impdp


If your export size volume is huge than you may need to split export files instead of a single FS. In this case, We need to use the multiple directories feature of EXPDP or IMPDP utility.
By using this feature, We can create multiple dump files in multiple directories and distribute our logical export to different directories on the operating system.
In my case, my DB version in 11.2.0.4 and my os is Linux 6
So here is the demo:

1. Create a related folder on os. Consider two directories named exp1 and exp2
vishal@vishalbh# mkdir -p /u01/exp1

vishal@vishalbh# mkdir -p /u02/exp2
2. Create 2 directories from sqlplus
SQL > create or replace directory EXPDIR1 as '/u01/exp1';
Directory created.
SQL > create or replace directory EXPDIR2 as '/u02/exp2';

Directory created.3. Check the directories
SQL > select * from dba_directories;
OWNER DIRECTORY_NAME                     DIRECTORY_PATH
-------------------------               -------------------    --------------------
SYS                                       EXPDIR1            /u01/exp1
SYS                                       EXPDIR2            /u02/exp2
Now take logical backup using multiple directories.

vishal@vishalbh# expdp \'/ as sysdba\' dumpfile=EXPDIR1:expdp_to_path1_%U.dmp,EXPDIR2:expdp_to_path2_%U.dmp compression=all parallel=2 schema=XXX
Let us check multiple dump files will be created or not.
vishal@vishalbh# pwd
/u01/exp1

vishal@vishalbh# pwdls -ltr
-rw-r----- 1 oracle oinstall 5420000 Oct 03 02:34 expdp_datapump_01.dmp
-rw-r----- 1 oracle oinstall 420000 Oct 03 02:34 expdp_datapump_02.dmp

vishal@vishalbh# pwd
/u02/exp2

bash-3.2$ ls -ltr
-rw-r----- 1 oracle oinstall 7420000 Oct 03 02:34 expdp_datapump_03.dmp
-rw-r----- 1 oracle oinstall 620000 Oct 03 02:34 expdp_datapump_04.dmp

Here are some important points:
1. The parallel parameter must be used while using multiple directories, otherwise expdp will not fail but it will write to the only first directory.
2. The number of directories used must be equal to the parallel parameter then only all directories will be used for writing.
If you want to use those export on a different server by using multiple paths, then you need to follow below syntax:
$ORACLE_HOME/bin/impdp "'/ as sysdba'" logfile=EXPDIR1:test_imp.LOG dumpfile=EXPDIR1:test_01