Rman backup script and Rman incremental backup script sharing _oracle

Source: Internet
Author: User

One, separate backup
1. Classic backup of the whole library: backup as compressed backupset database include current controlfile plus archivelog Delete all input;
2, tablespace:backup tablespace name;
3, Data files: Backup datafile N; (N: Specific data file number select File_name,file_id,tablespace_name from Dba_data_files;)
4, Control files: Backup current controlfile, or backup database include current controlfile;
5. log files: backup archivelog all; or database plus archivelog;
6, Parameter file: Backup SPFile;
7, the whole library backup script:

Copy Code code as follows:

run{
Allocate channel C1 type disk;
Backup full tag ' dbfull ' format '/backup/full%u_%s_%p ' database
Include current controlfile;
SQL ' alter system archive log current '; #在数据库进行全备份完成之后, you need to perform this command to archive the current log, which should include the last generated archive when backing up the archive log
Backup filesperset 3 format '/backup/arch%u_%s_%p ' #filesperset 3 sets the file in each backup set to no more than 3
Archivelog all delete input; #备份归档可选, you can back up the individual backups regularly
Release channel C1;
}

Second, incremental backup

1, 0 level incremental backup

Copy Code code as follows:

run{
Allocate channel C1 type disk;
Backup incremental Level 0 tag ' db0 ' format '/backup/db0%u_%s_%p ' database
Include current controlfile; ;
SQL ' alter system archive log current '; #在数据库进行全备份完成之后, you need to perform this command to archive the active log, which should include the last generated archive when backing up the archive log
Backup filesperset 3 format '/backup/arch%u_%s_%p ' #filesperset 3 sets the file in each backup set to no more than 3
Archivelog all delete input; #备份归档可选, you can back up the individual backups regularly
Release channel C1;
}

2, Level 1 backup script

Copy Code code as follows:

run{
Allocate channel C1 type disk;
Backup incremental Level 1 tag ' db1 ' format '/backup/db1%u_%s_%p '
Database Skip readonly include current controlfile;
Backup filesperset 3 format '/backup/arch%u_%s_%p ' #filesperset设定每个备份集里文件不超过3个
Archivelog all delete input; #备份归档可选, you can back up the individual backups regularly
Release channel C1;
}

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.