Windows, Oracle database backup and purge timer

1, edit the bat file, such as backup.bat, reads as follows:

set CURDATE=%date:~0,4%%date:~5,2%%date:~8,2%
expdp scott/tiger@127.0.0.1/orcl DIRECTORY=IRS_DATA_BAK_DIR DUMPFILE=%CURDATE%.dmp LOGFILE=%CURDATE%.log
forfiles /p "D:\backup" /d -3 /c "cmd /c echo deleting @file ... && del /f @path"

Note:

scott- user; tiger- password; orcl- database;

DIRECTORY = IRS_DATA_BAK_DIR position in the computer that is "D: \ backup", can be performed by a user with dba privileges select * from dba_data_files to query;

forfiles:

 

2, add regular tasks

 

  

Guess you like

Origin www.cnblogs.com/yangxuyang/p/12519005.html