Oracle automatic backup (Windows)

Source: Internet
Author: User

The bat script is as follows:
Set yr = % date :~ 0, 4%
Set mo = % date :~ 5, 2%
Set dy = % date :~ 8, 2%
Set dmpName = % yr % mo % dy %
Exp username/password @ dbname file = d: \ % dmpName %. dmp owner = username log = d: \ log _ % dmpName %. log
The execution process is to obtain the year, month, and date, and concatenate a string to name the backup file. Then, call the Oracle export tool exp to back up data by specifying the user name, password, database name, backup file name, and log name.
 
After the script is edited, you need to add a scheduled task to ensure that the script is periodically executed. Open attachment-System Tools-Task Scheduler creation.
 
Note: Many online scripts apply to % date :~ Incorrect Use of X, Y %. The meaning of the first parameter X should be the starting position of the string without objection. The second parameter Y should be the truncation length, not the cutoff position.
For example, in the doscommand line date command, print "2011/08/30 Tuesday". If you want to get 20110830, use % date: ~ In the bat script :~ 2011 for, % date :~ 5, 2%, get 08, and so on.
 
Author "why"

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.