Sometimes we want to restore full database except a certain tablespace (data not needed, or a point in time recovery omiting a big tablespace, etc.). That means we need to skip the tablespace(s) for restore operation. This way, the restore operation time can be much quicker.
Remember that the RESTORE DATABASE command restores all the datafiles, except the offline or read-only tablespaces.
Note that RESTORE DATABASE is not the same as BACKUP DATABASE. With command BACKUP DATABASE, RMAN backs up datafiles along with controlfiles and spfile. But with RESTORE COMMAND operation, RMAN only restores datafiles.
To omit a certain tablespace for restore operation use:
RESTORE DATABASE SKIP TABLESPACE tablespace_name.
Suppose I want to omit the restore of indexes tablespace INDX01,INDX02. Then my restore command will be:
RMAN>RESTORE DATABASE SKIP TABLESPACE INDX01,INDX02;
If you specify SKIP FOREVER TABLESPACE, then RMAN specifies the DROP option of ALTER DATABASE DATAFILE ... OFFLINE when taking the datafiles that belong to the tablespace offline before the restore.
The DROP option indicates that RMAN does not intend to recover these files and instead remove their tablespaces from the database's rman operations after the database is opened again. In other words, FOREVER indicates that RMAN never intends to do anything with the skipped tablespaces again.
Suppose you want to skip forever the restore of the tablespaces EXAMPLE, INDX01 and INDX02 then your command will be:
RMAN>RESTORE DATABASE SKIP FOREVER TABLESPACE EXAMPLE, INDX01, INDX02;