Rman backup script and rman Incremental backup script sharing

Source: Internet
Author: User

1. Separate backup
1. Classic full-database backup: backup as compressed backupset database include current controlfile plus archivelog delete all input;
2. tablespace: name of the backup tablespace;
3. Data File: backup datafile n; (n: Data File No. select file_name, file_id, tablespace_name from dba_data_files ;)
4. Control File: backup current controlfile; or backup database include current controlfile;
5. Log File: backup archivelog all; or database plus archivelog;
6. parameter file: backup spfile;
7. Full-database backup script:
Copy codeThe Code is 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'; # After the database is fully backed up, you need to execute this command to archive the current log. The last generated archive should be included in the backup and archiving logs.
Backup filesperset 3 format'/backup/arch % u _ % s _ % P' # filesperset 3 sets no more than three files in each backup set
Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
Release channel c1;
}

Ii. Incremental Backup

1. Level 0 Incremental Backup
Copy codeThe Code is 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'; # After the database is fully backed up, you need to execute this command to archive the current log. The last generated archive should be included in the backup and archiving logs.
Backup filesperset 3 format'/backup/arch % u _ % s _ % P' # filesperset 3 sets no more than three files in each backup set
Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
Release channel c1;
}

2. Level 1 backup script
Copy codeThe Code is 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 sets no more than three files in each backup set
Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
Release channel c1;
}

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.