Many options to use with Oracle expdp: who remembers all of them?

I end to forget and not use many of the options offered by expdp, so I have decided to write a script to help me remind its option displaying simple menus.

One of the things I wanted to test is weather the local directory can be used for the parameter DIRECTORY
 SQL> create directory DIR as './.';

Directory created.
It is allowed ... but the dumpfile and the logfile are created on $ORACLE_HOME/dbs/ , at least in my HP-UNIX environment.



I will add many more options, but it is already very useful.
#!/bin/ksh
#
# A script to help perform datapump exports
#
echo "Type a mnemonic for this expdp (could be steve_prod) \c:"
read mnemonic
mnemonic=$mnemonic"_"`date '+%d%m%Y'`   ## the date is appended to the mnemonic
DUMPFILE="expdp_$mnemonic.dmp"
LOGFILE="expdp_$mnemonic.log"
echo $DUMPFILE
#
# The list of available directories is display if the input is "?".
# If the input is ".", the directory QUI is created, which stores the output of pwd
#
DIR="?"
while [ $DIR = "?" ]
do
  echo "Destination directory [?] "
  read DIR
  if [ $DIR  = "?" ]; then
    sqlplus -s / as sysdba<<EOF_SQL
      column DIRECTORY_PATH format a64
      set line 200
      select * from dba_directories ORDER BY 1;
      exit
EOF_SQL
  fi
done
if [ $DIR = "." ]; then
  WHERE=`pwd`
  sqlplus -s / as sysdba<<EOF_D
  DROP DIRECTORY QUI;
  CREATE DIRECTORY QUI AS '$WHERE';
EOF_D
DIR=QUI
fi
#
# A menu for the existing schemas
#
SCHEMA="?"
while [ $SCHEMA = "?" ]
do
  echo "Schemas to export (separated by comma)[?] "
  read SCHEMA
  if [ $SCHEMA = "?" ]; then
    sqlplus -s / as sysdba <<EOF_S
          set pages 0 heading off
      SELECT username FROM dba_users WHERE username NOT IN ('SYS', 'SYSTEM') ORDER BY 1;
      exit
EOF_S
  fi
done
echo "Grade of parallelism [1] "
read parallel
if [ -z $parallel ]; then
  parallel=1
fi
PAR_FILE=expdb_$mnemonic.par
echo "dumpfile=$DUMPFILE"      > $PAR_FILE
echo "logfile=$LOGFILE"       >> $PAR_FILE
echo "schemas=($SCHEMA)"      >> $PAR_FILE
echo "directory=$DIR"         >> $PAR_FILE
echo "parallel=$parallel"     >> $PAR_FILE
echo "JOB_NAME=JOB_$mnemonic" >> $PAR_FILE
echo "\n\n"
echo "You can now execute expdp parfile=$PAR_FILE"

Rate this note ...
Useless Poor Average Good Very helpful