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;
}