数据库有多个实例,使用正常实例恢复异常实例的参数文件
RMAN> restore spfile from '/home/oracle/spfilebak.old';
Starting restore at 12-MAR-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=156 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/12/2019 18:05:00
RMAN-06564: must use the TO clause when the instance is started with SPFILE
参数文件恢复时候遇到的问题及注意事项,本案例中没有使用伪实例启动,而是数据库中装了多实例,
使用另外一个正常实例镜像恢复案例
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Mar 12 18:00:48 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 1603411968 bytes
Fixed Size 2228784 bytes
Variable Size 1090522576 bytes
Database Buffers 503316480 bytes
Redo Buffers 7344128 bytes
RMAN> restore spfile from '/home/oracle/spfilebak.old';
Starting restore at 12-MAR-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=156 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/12/2019 18:05:00
RMAN-06564: must use the TO clause when the instance is started with SPFILE
出现如上提示的原因:提示当前实例使用的是spfile的配置启动(因为我用orcl实例启动到了nomount还原rzxerp参数文件,没有使用rzxerp空实例方式),因此resotre的时候需要指定spfile还原的路径,不能还原到默认的路径$ORACLE_HOME/dbs/
RMAN> restore spfile to '/home/oracle/spfile0312.ora' from '/home/oracle/spfilebak.old';
Starting restore at 12-MAR-19
using channel ORA_DISK_1
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /home/oracle/spfilebak.old
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 12-MAR-19
RMAN> shutdown abort;
Oracle instance shut down
--复制参数文件
[oracle@localhost ~]$ mv spfile0312.ora $ORACLE_HOME/dbs/spfilerzxerp.ora
SQL> startup;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2228784 bytes
Variable Size 1090522576 bytes
Database Buffers 503316480 bytes
Redo Buffers 7344128 bytes
Database mounted.
Database opened.