温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

rman怎么恢复spfile

发布时间:2021-11-12 14:26:58 来源:亿速云 阅读:158 作者:柒染 栏目:关系型数据库

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';

看完上述内容,你们掌握rman怎么恢复spfile的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI