Oracle backup policy customization is related to the running of oracle databases. The correct oracle backup policy not only ensures the 24x7 High Performance of database servers, it also ensures the speed and reliability of backup and recovery.
Multi-level backup is used to reduce the time required for daily backup and ensure that the system has a good recovery. There must be a balance between the recovery time and the backup time. For example, you only need to perform a full backup of a database, and then only backup and archive can ensure that the database can be restored to the latest state, but such a recovery time will be intolerable. Multi-level backup is also designed to solve this problem. The following is an example of multi-level backup:
Every six months, a full database backup includes all the data and read-only tablespaces)
A zero-level backup every month does not contain read-only tablespace)
Perform a level-1 backup every week
Perform secondary backup once a day
Changes to any database must be synchronized to the CATALOG directory again and backed up again, such as adding data files) or backed up again. If you change the tablespace to read-only, you can back up archived logs or regularly back up archived logs after each backup. If possible, you can back up the data directly to the tape. Database full backup script
- Run {
- Allocate channel c1 type disk;
- Allocate channel c2 type disk;
- Allocate channel c3 type disk;
- Backup full tag 'dbfull' format'/u01/oradata/backup/full % u _ % s _ % P' database
- Include current controlfile;
- SQL 'alter system archive log current ';
- Backup fileaperset 3 format'/u01/oradata/backup/arch % u _ % s _ % P'
- Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
- Release channel c1;
- Release channel c2;
- Release channel c3;
- }
Zero-level backup script
- Run {
- Allocate channel c1 type disk;
- Allocate channel c2 type disk;
- Allocate channel c3 type disk;
- Backup incremental level 0 tag 'db0' format'/u01/oradata/backup/db0 % u _ % s _ % P'
- Database skip readonly;
- SQL 'alter system archive log current ';
- Backup fileaperset 3 format'/u01/oradata/backup/arch % u _ % s _ % P'
- Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
- Release channel c1;
- Release channel c2;
- Release channel c3;
- }
Likewise, we can get scripts for level 1 backup and level 2 backup, such as Level 1 backup.
- Run {
- Allocate channel c1 type disk;
- Allocate channel c2 type disk;
- Allocate channel c3 type disk;
- Backup incremental level 1 tag 'db1' format'/u01/oradata/backup/db1 % u _ % s _ % P'
- Database skip readonly;
- SQL 'alter system archive log current ';
- Backup fileaperset 3 format'/u01/oradata/backup/arch % u _ % s _ % P'
- Archivelog all delete input; # backup archiving is optional and can be backed up regularly separately
- Release channel c1;
- Release channel c2;
- Release channel c3;
- }
If you follow the preceding oracle backup policy, the amount of data to be backed up on a daily basis is only changed in one day. During restoration, a zero-level backup for the current month, three primary backups, six secondary backups, and archive files for the current day can be recovered at most. If this recovery time cannot be accepted, the interval between zero-level backups can be reduced.
After each backup, archive logs before the backup point can be deleted in principle, but for further security and future use of LOGMNR to find the required information ), if conditions are met, archive logs are saved for one year and stored on inexpensive access devices such as tapes.
Learn about Oracle OS backup
Importance of Oracle Database Backup
How to Implement ORACLE backup
Oracle backup command to use instances
Oracle single row date functions