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

  1. Run {
  2. Configure retention policyToRecovery windowOf14 days;
  3. Configure controlfile autobackupOn;
  4. Configure controlfile autobackup formatForDevice type diskTo '/U01/app/oracle/backup/% F';
  5. Allocate channel c1 device type disk format'/U01/app/oracle/backup/bak _ % U';
  6. BackupDatabaseSkip inaccessible plus archivelog filesperset 20Delete AllInput;
  7. Release channel c1;
  8. }
  9. Crosscheck backupset;
  10. DeleteNoprompt 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

  1. SetORACLE_SID = orcl
  2. Rman 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:

  1. ORACLE_HOME =/u01/app/oracle/product/10.2.0/db_1
  2. ORACLE_BASE =/u01/app/oracle
  3. ORACLE_SID = orcl
  4. * ***/U01/app/oracle/product/10.2.0/db_1/bin/rman target/partition file = '/home/oracle/rmanbackupusers. rcv'

For the use of crontab, see: Linux cron Learning System

Related Article

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.