Step 1: create a file named "scheduled backup. Bat". The file content is as follows:
Set tempvalue = databasename _ % Date :~ 0, 10%
Set directory_temp = D:/backup/% tempvalue %
Set file_dmp = % directory_temp %/% tempvalue %. dmp
Set file_log = % directory_temp %/% tempvalue %. Log
Set winrarpath = "C:/program files/WinRAR/winrar.exe"
Set file_rar=%directory_temp0000.rar
MD % directory_temp %
Exp username/password @ servername file = % file_dmp % log = % file_log % owner = user1, user2, user3
% Winrarpath % A % file_rar % directory_temp %
Rmdir/S/Q % directory_temp %
AboveCodeBrief description:
1. Set Name = value: set the current environment variable
2.% Date :~ 0, 10%: Get the current system date, for example, "2009-10-21"
3. winrarpath: the installation path of WinRAR on your computer
4. exp username/password @ servername file = % file_dmp % log = % file_log % owner = user1, user2, user3: This is the Oracle Export command, if you do not understand the reference: http://blog.csdn.net/hemingwang0902/archive/2009/10/21/4710725.aspx
(Explanation of exp and IMP commands in Oracle
)
Step 2: Create a scheduled task as follows:
1. Start => AllProgram=> Attachment => system tools => task plan => Add a task plan
2. Follow the prompts in the "task plan wizard" to create a scheduled BAT file (Scheduled backup. BAT ).
Here is a small supplement: the scheduled task will be executed only when the "Task Scheduler" service is started.