Oracle full-volume, incremental backup

Source: Internet
Author: User

With 0221222 incremental backup strategy, 7 days a cycle

That is, Sunday level 0 backup, Week 1 2 4 5 6 with 2-level incremental backup, week 3 with 1-level incremental backup

Open Control File Automatic backup

CONFIGURE Controlfile autobackup on;

Configure control file backup path

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to '/file/backup/rman/controlfile_%f ';

Set the number of days to expire to 7 days

Rman> CONFIGURE RETENTION POLICY to RECOVERY windows of 7 days;

---fully prepared

Vim rman_bak_level0.sh

#! /bin/bash

Export Oracle_base=/u01/oracle

Export Oracle_home= $ORACLE _base/product/11.2.0/db_1

Export path= $ORACLE _home/bin: $PATH

Export Oracle_sid=neal--database Oracle_sid

Export nls_lang= ' American_america. ZHS16GBK '--character set

Rman Target/<<eof run{allocate channel D1 type disk; --Allocation channel D1, type backup to disk

Allocate channel D2 type disk; --Allocation channel D2, type backup to disk

Backup incremental Level 0 database format '/FILE/BACKUP/RMAN/LEVEL0_%D_%S_%P_%U.BKP '; --backup level, output format, path

SQL ' alter system archive log current '; --Archive The current redo log

Backup Archivelog All Delete input format '/FILE/BACKUP/RMAN/ARCHIVELOG_%D_%S_%P_%U.BKP '; --Backup archive log and delete

Crosscheck backup; --Check Backup

Delete NoPrompt obsolete; --Silently Delete expired backups

Release channel D1; --Release channel D1

Release channel D2; --Release channel D2}

Eof

---Level 0 backup script

Vim rman_bak_level0.sh

#! /bin/bash

Export Oracle_base=/u01/oracle

Export Oracle_home= $ORACLE _base/product/11.2.0/db_1

Export path= $ORACLE _home/bin: $PATH

Export Oracle_sid=neal

Export nls_lang= ' American_america. ZHS16GBK '

Rman Target/<<eof

run{Allocate channel D1 type disk;

Allocate channel D2 type disk;

Backup incremental Level 0 database format '/FILE/BACKUP/RMAN/LEVEL0_%D_%S_%P_%U.BKP ';

SQL ' alter system archive log current '; Backup Archivelog All Delete input format '/FILE/BACKUP/RMAN/ARCHIVELOG_%D_%S_%P_%U.BKP ';

Crosscheck backup;

Delete NoPrompt obsolete;

Release channel D1;

Release channel D2; }

Eof

--1 level Backup Script

Vim rman_bak_level1.sh

#! /bin/bash

Export Oracle_base=/u01/oracle

Export Oracle_home= $ORACLE _base/product/11.2.0/db_1

Export path= $ORACLE _home/bin: $PATH

Export Oracle_sid=neal

Export nls_lang= ' American_america. ZHS16GBK '

Rman Target/<<eof

run{Allocate channel D1 type disk;

Allocate channel D2 type disk;

Backup incremental Level 1 database format '/FILE/BACKUP/RMAN/LEVEL1_%D_%S_%P_%U.BKP ';

SQL ' alter system archive log current '; Backup Archivelog All Delete input format '/FILE/BACKUP/RMAN/ARCHIVELOG_%D_%S_%P_%U.BKP ';

Crosscheck backup;

Delete NoPrompt obsolete;

Release channel D1;

Release channel D2; }

Eof

--2 level Backup Script

Vim rman_bak_level2.sh

#! /bin/bash Export Oracle_sid=neal

Export nls_lang= ' American_america. ZHS16GBK '

/u01/oracle/product/11.2.0/db_1/bin/rman Target/<<eof

run{Allocate channel D1 type disk;

Allocate channel D2 type disk; Backup incremental Level 2 database format '/FILE/BACKUP/RMAN/LEVEL2_%D_%S_%P_%U.BKP ';

SQL ' alter system archive log current ';

Backup Archivelog All Delete input format '/FILE/BACKUP/RMAN/ARCHIVELOG_%D_%S_%P_%U.BKP ';

Crosscheck backup;

Delete NoPrompt obsolete;

Release channel D1;

Release channel D2; }

Eof

--Add to Crontab

Crontab-e

#周日0级备份 * * 0/server/scripts/rman_bak_level0.sh

Incremental backup of #周一, second, four or five, and 62 levels * * 1,2,4,5,6/server/scripts/rman_bak_level2.sh

#周三1级增量备份 * * 3/server/scripts/rman_bak_level1.sh

Oracle full-volume, incremental backup

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.