@echo off color 0b & cls echo echo 设置备份文件存放文件夹... echo set "tbuf=C:\OracleBackup" if not exist %tbuf% mkdir %tbuf% echo echo 设置备份文件名(以星期几命名,即备份文件只保存最近一周)... echo set name=%date% set name=%name:~-3% set name=ORCL_backup_%name% echo echo 是否存在同名文件,若存在则删除同名文件... if exist %tbuf%\%name%.dmp del %tbuf%\%name%.dmp if exist %tbuf%\%name%.log del %tbuf%\%name%.log echo echo 开始备份(备份整个数据库)..... exp system/system full=y file=‘%tbuf%\%name%.dmp‘ log=‘%tbuf%\%name%.log‘ echo echo 备份完毕! pause
原文:https://www.cnblogs.com/oumi/p/10165815.html