Running 8.1.7 on Solaris 2.8. Assuming I've created a new database with a new tablespace called data which is 100M. None of the blocks in this tablespace has been ever used by Oracle. The question is :-
1. If backing up the datafile using rman online and level 0 (full) , what will be the size of the backup ? I ask this coz RMAN will only copy the used blocks.
2. If I do a restore of this datafile, what will be the size ? Again if oracle copies only the used blocks, then my backup will contain only the used blocks and in my case only the header will be copied.
Does it get the info from the controlfile for restore ?
This is solved on raw devices where you need to have the partitions created before you attempt a restore.
It would depend on your block size. The RMAN compression works by grouping data blocks in a datafile into buffers. When RMAN comes across a used block it writes it to the backupset. When it comes across 4 contiguous empty blocks it writes a compression block equal to your DB_BLOCK_SIZE.
DB_FILE_DIRECT_IO_COUNT sets the size of the buffer - if its set to 128K say - one compression block is written per 512K of empty, contiguous blocks.
Also be careful about assuming that unused blocks aren't written - its blocks that have NEVER been used. If blocks have been de-allocated, by an index rebuild for example, these are seen by RMAN as used blocks.
Also, image copies of a datafile always contain all blocks
Hope that helps some
yep - it depends on the value of DB_FILE_DIRECT_IO_COUNT. Ours is set to 64 so the way I understand it is that RMAN will write one compression block (DB_BLOCK_SIZE) to the backup set for every 256K of contiguous unused space in the datafile.