Oracle Database sets a task to back up backup records for one week

Source: Internet
Author: User

Oracle Database Backup:

-- Keep the backup record of the last week;
==== Body:
===== Start ======================
Copy codeThe Code is as follows:
Echo sets the backup file storage folder...
Set "tbuf = E: \ Cway \ backup"

Echo sets the backup file name (named in the day of the week, that is, the backup file is only saved for the last week )...
Set name = % date %
Set name = % name :~ -3%
Set name = ORCL_backup _ % name %

Whether a file with the same name exists in echo. If yes, delete the file with the same name...
If exist % tbuf % \ % name %. dmp del % tbuf % \ % name %. dmp
If exist % tbuf % \ % name %. log del % tbuf % \ % name %. log

Echo starts backing up the Oracle database of XX Project .....

Exp User1/PassWord1 @ Orcl file = % tbuf % \ % name %. dmp log = '% tbuf % \ % name %. Log'

Echo backup complete!

==== End ========

= Copy the content between "start" and "end" to the txt file and modify the corresponding parameters such as path and database name;

Save it as bat format, create a task plan, and set daily running to implement database backup.

Note:

(1) User: User Name for data backup;
(2) PassWord: PassWord;
(3) Orcl: Database Name;

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.