oracledba.help
Scripts

runDPScript.sh

<- Scripts

#!/bin/bash
# Purpose: Run a Data Pump script from cron wrapper script.
set -a; # Forces all vars to be exported (required to run from cron).

# User Vars
usrDpExec="expdp";                          # impdp or expdp
usrUnPw="system/MyPW";                      # Username/Password
usrScript="/u01/app/scripts/par/impDB.par"; # Full path to .par file.

# Sys Vars
TERM=xterm
ORACLE_SID="oradb"; # SELECT instance_name FROM v$instance;
ORACLE_HOME="/u01/app/oracle/product/12.1.0.2/dbhome_1";

# Start
clear;printf "$(basename ""$0""): Started $(date "+%Y-%m-%d %H:%M:%S")\n"

# Process
printf "$usrDpExec: $usrScript \n\n"
CMD=$($ORACLE_HOME/bin/$usrDpExec $usrUnPw PARFILE=$usrScript)

# End
printf "\n$(basename ""$0""): Ended $(date "+%Y-%m-%d %H:%M:%S")\n"