2019-08-23 08:47:19 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-11-04 19:47:19 -08:00
|
|
|
USERNAME="$1"
|
|
|
|
DP_FILE="${2}.dump"
|
|
|
|
DP_DIR="DPDATA"
|
2019-08-23 08:47:19 -07:00
|
|
|
|
2019-11-04 19:47:19 -08:00
|
|
|
# Import the data
|
|
|
|
impdp 'userid="/ as sysdba"' \
|
|
|
|
schemas=$USERNAME \
|
|
|
|
dumpfile=$DP_FILE \
|
|
|
|
DIRECTORY=$DP_DIR
|
2019-08-23 08:47:19 -07:00
|
|
|
|
2019-11-04 19:47:19 -08:00
|
|
|
# Restart the database
|
|
|
|
sqlplus / as sysdba <<EOF
|
2019-08-23 08:47:19 -07:00
|
|
|
shutdown immediate
|
|
|
|
startup
|
|
|
|
quit
|
|
|
|
EOF
|
|
|
|
|