一、恢复初始化参数文件:
1、自动备份还原
1)关闭数据库并启动到nomount阶段
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 939495424 bytes
Fixed Size 2258840 bytes
Variable Size 599787624 bytes
Database Buffers 331350016 bytes
Redo Buffers 6098944 bytes
2)指定DBID
RMAN> set dbid=4033362200;
executing command: SET DBID
3)在数据库是使用spfile启动时,使用如下语句会报错,必须使用to来指定另外一个路径(使用pfile启动可解决如下错误)
RMAN> restore spfile from autobackup;
Starting restore at 09-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/09/2016 19:34:28
RMAN-06564: must use the TO clause when the instance is started with SPFILE
4)使用to关键词来指定恢复spfile路径
RMAN> restore spfile to '/u01/spfileneal.ora' from autobackup;
Starting restore at 09-MAR-16
using channel ORA_DISK_1
recovery area destination: /u01/oracle/fast_recovery_area
database name (or database unique name) used for search: NEAL
channel ORA_DISK_1: AUTOBACKUP /u01/oracle/fast_recovery_area/NEAL/autobackup/2016_03_09/o1_mf_s_906041673_cfzht9tn_.bkp found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160309
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/oracle/fast_recovery_area/NEAL/autobackup/2016_03_09/o1_mf_s_906041673_cfzht9tn_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 09-MAR-16
5)发现还原成功
[oracle@cancer u01]$ ll
-rw-r----- 1 oracle oinstall 3584 Mar 9 19:39 spfileneal.ora
2、手动还原
1)数据库启动到mount阶段
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
2)列出含有spfile的备份集
RMAN> list backup o