windows下oracle11g数据泵自动备份脚本含删除过期备份和使用方法 1、先建备份用的路径对象:(注:此处认为用来做备份的用户backupuser已经建好了,且已经有连接数据库的相应权限) sqlplus / as sysdba CREATE OR REPLACE DIRECTORY TS_DB as 'D:\backup'; grant read,write on directory TS_DB to backupuser; grant exp_full_database,imp_f
一、创建backup.sh脚本文件
#!/bin/sh
SOURCE_FOLDER=/data
DB_FOLDER=/data/db
BACKUP_FOLDER=/data/backup
TM=`date +%Y%m%d%H%M%S`
echo start to dump mysql database and backup files at $TM
# delete old sql backup files
cd $DB_FOLDER
rm -rf $DB_FOLDER/*.sql
#dump