RMAN full backup vs. level 0 incremental
Perhaps you've wondered about this. What is the difference between taking an RMAN full backup and a level 0 incremental backup? If you read the documentation the following explanation will be found here: Incremental Backups
The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy. Thus, an incremental level 0 backup is a full backup that happens to be the parent of incremental backups whose level is greater than 0.Logically that is true, but for many folks that is not enough. Are they different physically, and if so exactly how are they different physically? If you google for an explanation you will find a number of ideas, most based on what the documentation says. Here are some examples of what I found:
- The only difference between level 0 and full is that a level 0 is marked in the RMAN catalog as a level 0.
- Level 0 incremental and full backups are physically identical.
- Put the database in mount state so there is no activity in the database.
- Create two RMAN 'full' backups.
- Create two RMAN incremental level 0 backups.
- Open the database and perform some DML and/or DDL.
- Create an incremental level 1 backup.
- Do more DML/DDL activity.
- Create another incremental level 1 backup.
- Test database: Oracle 18.104.22.168 CDB on Linux 6.5.
- RMAN Catalog database: Oracle 22.214.171.124 on Linux 5.5.
Starting at offset 0x2090 00 01 02 03 04 05 06 07 Full 00 00 00 00 04 04 00 00 LVL0 00 00 00 00 05 04 00 00 LVL1 00 00 00 00 05 00 00 00What might these mean? Here's a possible explanation:
0x2094 = 0x04 = FULL 0x2094 = 0x05 = Incremental 0x2095 = 0x04 = level 0 if the previous byte is 0x05 0x2095 = 0x00 = level 1 if the previous byte is 0x05Of course this doesn't explain the purpose of 0x04 at 0x205 if the backup is 'FULL'. To fully understand these flags would require dumping and examining many more backup files, not just of datafiles but of archive logs, controlfiles, etc. One thing is clear from this experiment; there are differences in the metadata contained in the file headers when comparing a full backup to a level 0 incremental backup. It is not simply a matter of the one backup being cataloged differently by RMAN; the backup pieces can be identified as either full or incremental level backups based on the metadata in the file header. So what good is all this effort for a little bit of knowledge? How about the next time you are asked about the difference between a level 0 and full backup? Now you can say something other that quoting the documentation or some article on the internet (one that is lacking anything to backup the assertions made). If the question is posed to you during an interview, this information becomes even more valuable. Now another question comes to mind: Can backup files made with a full backup be modified to work as incremental level 0 backups? That would be an interesting experiment. This is not something one would normally do, but it is not too hard to imagine a scenario where only a full backup, an incremental level 1 backup and the following archive logs were available to recover a database. This would be a desperate measure and a last resort, but sometimes last resorts are necessary. Do you think this can be done? If so please give it a try, but only test it on an expendable test system please. Please be sure to leave a comment if you try this experiment, it would be quite interesting to discuss. Discover more about our expertise in Oracle.