RMAN异机恢复
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
二、设置init和sid
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;
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341