1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
 
source ./oracle_env.sh
 
echo "=================================================="
echo "create tablespace or not  Y|N"
echo "=================================================="
read tbFlag
if [[ "$tbFlag" == "Y" ]];then
 
 ./create_tablespace.sh
 
fi
 
echo "=================================================="
echo "create user or not  Y|N"
echo "=================================================="
read userFlag
 
if [[ "$userFlag" == "Y" ]];then
 
 ./create_user.sh
 
fi
 
 
echo "==========================================="
echo "please enter expdp information"
echo "==========================================="
echo "input oracle user"
read oracle_user
 
echo "input password"
read oracle_password
 
echo "input directory name"
read oracle_dir
 
echo "input  dump file name"
read oracle_dumpfile
 
echo "input remap schemas.example:sourceUser1:targetUser1 or sourceUser1:targetUser1,sourceUser2:targetUser2"
read remap_schema
 
echo "input remap tablespaces.example:sourceTB1:targetTB1 or sourceTB1:targetTB1,sourceTB2:targetTB2"
read remap_tablespace
 
echo "execute Y|N"
read flag
 
 
if [[ $flag == "N" ]];then
 
  echo "exit "
  exit;
 
fi
 
impdp $oracle_user/$oracle_password directory=$oracle_dir dumpfile=$oracle_dumpfile remap_schema=$remap_schema remap_tablespace=$remap_tablespace