#!/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
|