RMAN-06496: must use the TO clause when the database is mounted or open

数据库:oracle 11.2.0.4
系统:AnolisOS 7.9
问题描述:恢复控制文件时报错RMAN-06496: must use the TO clause when the database is mounted or open,如下所示:
RMAN> restore controlfile from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2022_09_09/o1_mf_ncnnf_TAG20220909T205538_kkpfydbd_.bkp';

Starting restore at 10-SEP-22
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/10/2022 17:00:51
RMAN-06496: must use the TO clause when the database is mounted or open
异常原因:此前在mount状态下恢复过控制文件.
处理方案:在nomount阶段恢复控制文件.
操作过程:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1586708480 bytes
Fixed Size 2253624 bytes
Variable Size 989859016 bytes
Database Buffers 587202560 bytes
Redo Buffers 7393280 bytes
RMAN> restore controlfile from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2022_09_09/o1_mf_ncnnf_TAG20220909T205538_kkpfydbd_.bkp';

Starting restore at 10-SEP-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata01/orcl/control01.ctl
Finished restore at 10-SEP-22
结论:在nomount状态下,成功恢复控制文件.