Correlation between restore time and used space in a datafile
Recently during restore of a large database (over 10 TB) we monitored the alert log looking for messages like «Full restore complete of datafile 42 to datafile copy … Elapsed time: 0:39:32» We saw that the time to restore a 32GB file varied a lot, from around 20 minutes to around 75 minutes. This made me wonder why. We noticed that some of the files belonging to the UNDO tablespace took usually little time, and then I found a couple of more data files that took little time to restore. Then I thought that maybe the UNDO tablespace at the time of the backup had many unused blocks (because there weren’t many active transactions at the time). So I checked the other two files that did not take long time to restore and found out they had lots of free space in them too. ...