oracle 自动备份*.dmp文件

@echo off
if "%OS%" == "Windows_NT" setlocal
echo =======================oracle自动备份文件=======================

set hh=%time:~0,2%

if "%hh%"==" 0" goto beforeTen
if "%hh%"==" 1" goto beforeTen
if "%hh%"==" 2" goto beforeTen
if "%hh%"==" 3" goto beforeTen
if "%hh%"==" 4" goto beforeTen
if "%hh%"==" 5" goto beforeTen
if "%hh%"==" 6" goto beforeTen
if "%hh%"==" 7" goto beforeTen
if "%hh%"==" 8" goto beforeTen
if "%hh%"==" 9" goto beforeTen
goto afterTen

:beforeTen
set timestr=%date:~0,4%%date:~5,2%%date:~8,2%0%time:~1,1%%time:~3,2%
goto backup_db


:afterTen
set timestr=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%
goto backup_db


:backup_db
echo =============现在时间是:%timestr%,开始备份数据库=============
exp eam_fuwa/[email protected]/orcl file=D:\databack\fuwa_dmp%timestr%.dmp statistics=none


echo =======================备份数据库成功完成=======================


:end

你可能感兴趣的:(ORACLE)