Oracle Scheduled Backup

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.