ottertune/client/driver/oracleScripts/restoreOracle.sh

20 lines
268 B
Bash
Raw Normal View History

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