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