oracle 数据库导出脚本

 1.ynyd_backup_ftp.sh
#!/bin/sh
FILENAME=`date +%Y-%m-%d.dmp`
scriptdir=/home/oracle
exp_dir=$scriptdir
name="$exp_dir/YNYD_zx_export_$FILENAME"
user=`id -nu`
if [ "$user" = "root" ]
then
su - oracle
fi
echo
/home/oracle/product/9.2.0.4/bin/exp userid=back/backpass full=y direct=y file=$name log=$exp_dir/YNYD_zx_export.log
if [ -f $name ]; then
echo " export successfully "
echo "starting gzip ..."
gzip $name
echo "end gzip"
else
echo " export error file." >$exp_dir/YNYD_zx_export_error.log
fi

你可能感兴趣的:(oracle,数据库,Date,脚本,File,user)