温馨提示×

温馨提示×

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

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

RMAN异机恢复

发布时间:2020-08-06 19:59:55 来源:ITPUB博客 阅读:184 作者:九十一万里 栏目:关系型数据库

rman 异机恢复

一、创建恢复需要的目录

   mkdir -p /u01/app/oracle/admin/hk/{adump,bdump,cdump,dpdump,udump,pfile}

   mkdir -p /u01/app/oracle/oradata/hk

   mkdir -p /u01/app/oracle/fast_recovery_area/hk

二、设置initsid

  echo 'db_name=hk' > $ORACLE_HOME/dbs/inithk.ora

  more $ORACLE_HOME/dbs/inithk.ora

  export ORACLE_SID=hk

  rman target /

  set dbid 3515046639      --原始数据库dbid

三、开始恢复

  startup nomount; --启动到nomount

-----恢复spfile文件

  restore spfile from '/u01/app/oracle/oradata/hk/hk_spfile_81t2a2gm_1_1.bak';

  startup nomount force;-----重启实例到nomount状态


查看spfile文件中控制文件路径,并创建或者如下

restore controlfile from '/u01/app/oracle/oradata/hk/hk_Controlfile_c-3278571708-20180506-01';

ORA-19870: error while restoring backup piece /u01/app/oracle/oradata/hk/hk_Controlfile_c-3278571708-20180506-01

ORA-19504: failed to create file "/oradata/hk/control01.ctl"

ORA-27040: file create error, unable to create file

Linux-x86_64 Error: 2: No such file or directory


mkdir -p /oradata/hk

restore controlfile from '/u01/app/oracle/oradata/hk/hk_Controlfile_c-3278571708-20180506-01';


alter database mount;启动实例到mount状态


restore database; //还原数据文件

channel ORA_DISK_1: ORA-19870: error while restoring backup piece /backup/database/hk_full_6mt1jcvt_1_1

ORA-19505: failed to identify file "/backup/database/hk_full_6mt1jcvt_1_1"

ORA-27037: unable to obtain file status


-------检查/backup/database权限和路径,

restore database;


recover database;


archived log thread=1 sequence=1735

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 05/07/2018 01:02:08

RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1735 and starting SCN of 34275591


recover database until scn 34275591;

alter database open resetlogs;------至此恢复完毕

RMAN> quit

验证:

sqlplus / as sysdba

select name,OPEN_MODE from v$database;

向AI问一下细节

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

AI