In Windows, Oracle backs up data every night through EXP and retains the backup data for ten days.
1. Create the backup script oraclebackup. bat
Contents:
@ Echo off
Echo deletes the backup file and log 10 days ago.
Forfiles/p "E: \ oraclebackup"/dmp/OA *. dmp/d-10/c "cmd/c del @ path"
Forfiles/p "E: \ oraclebackup"/dmp/OA *. log/d-10/c "cmd/c del @ path"
Echo is backing up the Oracle database. Please wait ......
Exp user/password @ orcl file = E:/oraclebackup/dmp/OA _ % date :~ 0, 4% % date :~ 5, 2% % date :~ 8, 2%. dmp log = E:/oraclebackup/log/OA _ % date :~ 0, 4% % date :~ 5, 2% % date :~ 8, 2%. log owner = (jasoa_doc)
Echo task completed!
After that, change the txt extension of the notepad to bat.
Double-click oraclebackup. bat to test whether the backup is normal.
2. Create a scheduled task
Go to the control panel of windows, open the plan and task, create a task, Click Browse, and select the oraclebackup. bat file under the oraclebackup directory of the newly created edisk. Set the automatic execution time to save;