rman 恢复spfile

实验准备
OGG (DBID=3068169019)
spfile:/u01/app/oracle/fast_recovery_area/OGG/backupset/2018_03_26/o1_mf_ncsnf_TAG20180326T162759_fckd47yp_.bkp
       
我们分两种情况
1.不知道DBID,知道备份路径
2.知道DBID

(1).模拟删除spfile
[oracle@ogg-80 dbs]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs

[oracle@ogg-80 dbs]$ mv spfileogg.ora spfileogg.ora.bak

(2).启动数据库报错
SYS@ogg> startup force;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initogg.ora'

针对第一种情况
1.不知道DBID,知道备份路径
[oracle@ogg-80 ~]$ rman target /

RMAN> startup nomount;  ------启动到mount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initogg.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes

RMAN> restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileogg.ora' from '/u01/app/oracle/fast_recovery_area/OGG/backupset/2018_03_26/o1_mf_ncsnf_TAG20180326T162759_fckd47yp_.bkp';
Starting restore at 26-MAR-18
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/fast_recovery_area/OGG/backupset/2018_03_26/o1_mf_ncsnf_TAG20180326T162759_fckd47yp_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 26-MAR-18


针对第二种情况
2.知道DBID
[oracle@ogg-80 ~]$ rman target /

RMAN> set dbid=3068169019
executing command: SET DBID

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initogg.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes


方法一:利用自动备份
RMAN> restore  spfile from autobackup;
自动备份这里会报错,因为我们没有设置自动备份

方法二:利用手动备份
RMAN> restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileogg.ora' from '/u01/app/oracle/fast_recovery_area/OGG/backupset/2018_03_26/o1_mf_ncsnf_TAG20180326T162759_fckd47yp_.bkp';




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31485142/viewspace-2152239/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31485142/viewspace-2152239/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值