1. Create a batch file
@echo off rem ########################################################### rem # Windows Server 2008 Oracle Database Automatic backup batch script REM ###########################################################Setcurdate=%date:~0,4%%date:~5,2%%date:~8,2%Sethour=%time:~,2%if "%time:~,1%"==" " SetHour=0%time:~1,1%Setcurtime=%hour%%time:~3,2%%time:~6,2%REM Setting the database name, user name, and passwordSetOwner=ORCLSetUser=FlzdSetpassword=Flzdrem Create a backup directory with a directory structure of Oraclebak/yyyymmdd/ifNot exist"Oraclebak"mkdir oraclebakcd OraclebakifNot exist"%curdate%"mkdir%curdate%SetFilename=%curdate%/%owner%_%curdate%%curtime%. DMPSetExplog=%curdate%/%owner%_%curdate%%curtime%_log.log REM calls Oracle's EXP command to export user data exp%user%/%password%@%owner% file=%filename% log=%explog% owner=%user% grants=N Exit
2. Create a Windows Scheduled task
2.1 Control Panel Administrative Tools Task Scheduler Create tasks
Note:
1 Create a new text file, copy and paste the contents, and modify the file name extension. bat
2 The number of hours in a batch file does not automatically fill 0 when there is only one digit
3 Windows Create Task Schedule add operation need to fill in the starting with this optional parameter (otherwise, may error when exporting) the path where the script executes
Windows Scheduled tasks + batch files for scheduled backups of Oracle databases