Multiple choice

Consider the following RMAN script:

RUN{

SET NEWNAME FOR DATAFILE '/disk1/database/db1.dbf' TO '/disk2/database/db1.dbf';

SWITCH DATAFILE ALL;

RESTORE DATABASE;

RECOVER DATABASE;

ALTER DATABASE OPEN;

}

When executed, what result will occur?

  1. RMAN will restore the data file to disk1.

  2. The control file will be updated with the data file's new location, and the recovery will be successful.

  3. All database data files will be moved to the new location and recovered.

  4. The control file will not be updated with the data file's new location because the RENAME DATAFILE command is missing.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The RMAN script sets a new name for the data file, but the RESTORE DATABASE command executes before the SWITCH DATAFILE ALL command. The SWITCH command updates the control file to point to the new location, but since it comes after RESTORE, the restore operation still uses the original location specified in the control file. Therefore, the data file will be restored to disk1 (the original location), not disk2. After SWITCH runs, the control file would point to disk2, but the restore has already completed by then. For this to work as intended, SWITCH should come before RESTORE.