[Rman, 1] Typical Incremental Backup case and rman Incremental Backup case

Source: Internet
Author: User

[Rman, 1] Typical Incremental Backup case and rman Incremental Backup case
I. Backup policy:
1. sunday evening-level 0 backup completed MED (full backup) 2. monday evening-level 2 backup interval med3. Tuesday evening-level 2 backup interval med4. Wednesday evening-level 1 backup interval med5. Thursday evening-level 2 backup interval med7. Saturday evening-level 2 backup completed MED if it needs to be restored on Tuesday, you only need 1 + 2. If you need to recover on Thursday, you only need 1 + 4. If you need to recover on Friday, you only need 1 + 4 + 5. If you need to recover on Saturday, only 1 + 4 + 5 + 6 is required. automatic Backup: backup script + crontab bakl0 bakl1 bakl2
Ii. executed script:
1. run the Script: rman target/msglog = bakl0.log prepare file = bakl0 (/indicates the target database to be connected, msglog indicates the log file, and audit file indicates the script file) rman target/msglog = bakl1.log partition file = bakl1rman target/msglog = bakl2.log partition file = bakl2 instance: rman target system/oracle @ ora10g (/) msglog =/u01/rmanbak/bakl1.log prepare file =/u01/rmanbak/bakl0
Complete command:/u01/oracle/product/10.2.0/bin/rman target system/oracle @ ora10g (/) msglog =/u01/rmanbak/bakl1.log prepare file =/u01/rmanbak/bakl0
2. Compile the rman backup script: Level 0 backup script:
Put the backup script under the/u01/rmanbak/script directory. The contents of vi bakl0 and bakl0 are run {allocate channel cha1 type disk; backup incremental level 0 format'/home/oracle/rmanbackup/inc0 _ % u _ % t) tag monday_inc0 // tag can start by the way. It doesn't matter if database plus archivelog delete input; release channel cha1;} level 1 backup script: run {allocate channel cha1 type disk; backup incremental level 1 format'/home/oracle/rmanbackup/inc1 _ % u _ % t) tag monday_inc1 // tag can be started by the way, it doesn't matter database plus archivelog delete input; release channel cha1 ;}
Level 2 backup script: run {allocate channel cha1 type disk; backup incremental level 2 format'/home/oracle/rmanbackup/inc2 _ % u _ % t) tag monday_inc2 // tag can be started by the way, it doesn't matter database plus archivelog delete input; release channel cha1 ;}
3. Compile the shell script that calls the rman script:
The shell script rmanbak0.sh for calling 0 backup is :#! /Bin/bashsource/home/oracle /. bash_profile/u01/app/oracle/11.2.0/db_home_1/bin/rman target/nocatalog export file =/home/oracle/script/bakl0 msglog =/home/oracle/bakl0.log
The shell script rmanbak0.sh for calling 1 backup is :#! /Bin/bashsource/home/oracle /. bash_profile/u01/app/oracle/11.2.0/db_home_1/bin/rman target/nocatalog cmdfile =/home/oracle/script/bakl1 msglog =/home/oracle/bakl0.log call 2 backup the shell script rmanbak0.sh is: #! /Bin/bashsource/home/oracle /. bash_profile/u01/app/oracle/11.2.0/db_home_1/bin/rman target/nocatalog export file =/home/oracle/script/bakl2 msglog =/home/oracle/bakl0.log 4. compile a Linux scheduled task to execute automatic backup [root @ gc2 ~] # Crontab-e-u oracle (this command indicates editing the scheduled execution of oracle users (-e, edit-u oracle, oracle users )) week (0 represents Sunday) 45 23 ** 0/home/oracle/script/rmanbak0.sh (commands are executed as oracle users at on Sunday) 45 23 ** 1/home/oracle/script/rmanbak2.sh45 23 ** 2/home/oracle/script/rmanbak2.sh45 23 ** 3/home/oracle/script/rmanbak1.sh45 23 ** 4/home/oracle/script/rmanbak2.sh45 23 ** 5/home/oracle/script/rmanbak2.sh45 23 ** 6/home/oracle/script/rmanbak2.sh

Or (for testing): use an oracle user to add a routine task: crontab-eadd the following content in the new window: 0 24 ***/home/oracle/bin/rmanbak0.sh (*/3 *****/home/oracle/bin/rmanbak0.sh) note, the brackets can be used for testing. A backup is performed every three minutes. For example, a backup is performed every 24 o'clock every day.
# Then start crontab and start the crontab command: [root @ gc2 ~] # Service crond restartStopping crond: [OK] Starting crond: [OK] # monitor whether a scheduled task is executed [root @ gc2 ~] # Tail-f/var/log/cron
Mar 10 21:28:04 gc2 crond [4435]: (CRON) STARTUP (V5.0) Mar 10 21:30:01 gc2 crond [4445]: (root) CMD (/usr/lib/sa/sa1 1) Mar 10 21:39:08 gc2 crond [4486]: (CRON) STARTUP (V5.0)

What is the backup classification in ORACLE rman Incremental backup? For example, level 1 backup and level 2 backup

Incremental backup is divided into two types: Difference and accumulation.
In general, it is to back up the data first, and then back up the changed data later.
Level 0 backup is the basis for full backup and Incremental backup.
The level1 of Incremental backup is changed from 0 to 1, while level2 is incremental from the upload backup to the present.
The level1 of the cumulative backup is the cumulative change from the last 0 to the present, while level2 is the cumulative increase from the upload 0 or 1 to the present, including the period 2 can both

Ask an RMAN Incremental Backup question

Rman backs up data to the file system.
To use an image system, we recommend that you use the DATAGRID to perform real-time backup, which is better than rman.
You can refer to Baidu's "[think twice] Learning DataGuard step by step", which contains specific operations

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.