#!/bin/sh
export ORACLE_HOME=/app/oracle/product/10.2.0/db_1;
export ORACLE_SID=orcl;
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8";
export F=$(date +%y%m%d%H%M%S); #以日期加时间作为备份文件名
backupdir=/opt/DataBackup #备份文件存储的目录
/app/oracle/product/10.2.0/db_1/bin/exp user/pwd file=$backupdir/${F}.dmp log=$backupdir/backup.log owner=oracle
find $backupdir -type f -mtime +60 -exec rm {} \; > /dev/null 2>&1 #超过60天前的备份文件自动删除