Automatic RMAN backup on Windows and Linux platforms

Source: Internet
Author: User

Regardless of the platform, we must first clarify our goals:

1) execute at every night

2) Full backup of the database, backup control files and archive log files at the same time, and save the backup files to the/u01/APP/Oracle/backup/directory. After archiving the log files, automatically delete archived logs that have been backed up

3) The backup is retained for 14 days and automatically deleted upon expiration.

4) Retain RMAN operation logs

First, implement it on the window Platform

Compile the RMAN batch file

Run {configure retention policy to recovery window of 14 days; configure controlfile autobackup on; configure controlfile autobackup format for device type disk to '/u01/APP/Oracle/backup/% F '; allocate channel C1 device type disk format'/u01/APP/Oracle/backup/bak _ % U'; backup database skip inaccessible plus archivelog filesperset 20 delete all input; release channel C1 ;} crosscheck backupset; Delete noprompt obsolete;

Save to D: \ oracle \ Script \ backup \ db_fullbak_think.rman

Note: Skip inaccessible: Skip unreadable files

Skip offline: Skip offline files

Skip readonly: Skips read-only data files.

Filesperset: specifies the maximum number of files that can be contained in each type of backup set. In this example, filesperset appears in the backup archiving clause. Therefore, it is used to limit that each archive backup set can contain up to 20 archive files.

Write commands to execute RMAN batch processing files

 
Set oracle_sid = orclrman target/log D: \ oracle \ Script \ backup \ logs \ Bak _ % Date :~ 0, 10%. Log partition file = D: \ oracle \ Script \ backup \ db_fullbak_think.rman

Save the preceding content to D: \ oracle \ Script \ backup \ db_fullbak_think.bat.

Set execution plan

Open Control Panel ---> Task Scheduler --> Add Task Scheduler

* ****************************** The Linux platform is as follows ****** ***************************

In fact, there is little difference between Windows and Linux's automatic RMAN backup, and there is no need to change the RMAN batch processing script much. The only difference is that crontab is used for automatic backup in Linux.

In crontab:

 
ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1oracle_base =/u01/APP/oracle_sid = orcl *****/u01/APP/Oracle/product/10.2.0/db_1 /bin/RMAN target/partition file = '/home/Oracle/rmanbackupusers. RCV'

For the use of crontab, see: http://blog.csdn.net/linwaterbin/article/details/7661552

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.