To restore spfile, the auto backup of your control file should be enabled and have already taken a backup after enabling the controlfile auto backup feature of RMAN.
RMAN> configure controlfile autobackup on;
We can restore the spfile either using a recovery catalog or RMAN autobackup from default location(FRA).
- Using Recovery Catalog:
$ rman target / catalog rcat/rcat@rcatdb RMAN> startup nomount; RMAN> restore spfile; RMAN> startup force;
- RMAN Auto Backup in Default Location:
$ rman target / RMAN> startup force nomount; RMAN> set dbid 1436686810; RMAN> restore spfile from autobackup; RMAN> startup force;
We can also restore spfile from a non-default location of RMAN controlfile autobackup:
$ rman target / RMAN> set dbid 768943403; RMAN> startup force nomount; RMAN> restore spfile from '+FRA/autobackup/2022_09_25/o2_mf_s_443335437_31fbttrl_.bkp'; RMAN> startup force;
meda Changed status to publish 25/09/2022