Linux环境下oracle数据库Rman备份如何实现异机恢复
admin
2023-04-23 05:22:01
0

备份的数据库和要恢复的数据库OS和数据库的版本均一致,恢复的目录也均一致!
备份数据库:
RMAN> backup format ‘/home/oracle/scripts/full_prod.%U’ database plus archivelog;
备份控制文件:
RMAN> backup current CONTROLFILE format '/home/oracle/scripts/control.%U';
确认所有文件夹路径,备库最好要创建和源库一样的路径,否则需要指定路径。
SYS@PROD> select name from v$datafile;
SYS@PROD> select member from v$logfile;
SYS@PROD> select name from v$controlfile;
传输spfile到要恢复的服务器
[oracle@wangxx1 dbs]$ scp spfilePROD.ora 172.16.12.117:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
SYS@PROD> create pfile from spfile;
根据pfile文件位置创建相应的目录
[oracle@wangxx2 ~]$ mkdir -p /u01/app/oracle/oradata/PROD/
[oracle@wangxx2 dbs]$ mkdir -p /u01/app/oracle/admin/PROD/adump
传输备份文件到相同位置
[oracle@wangxx1 scripts]$ scp full 172.16.12.117:/home/oracle/scripts
[oracle@wangxx1 scripts]$ scp control
172.16.12.117:/home/oracle/scripts
从指定备份集恢复控制文件
[oracle@wangxx2 scripts]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 8 10:14:24 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: PROD (not mounted)
RMAN> set DBID=358601116
RMAN> restore CONTROLFILE  from '/home/oracle/scripts/control.07so5c0l_1_1';
Starting restore at 08-JAN-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/PROD/control01.ctl
output file name=/u01/app/oracle/oradata/PROD/control02.ctl
Finished restore at 08-JAN-18
RMAN> restore database;
RMAN> recover  database;
Starting recover at 08-JAN-18
using channel ORA_DISK_1
using channel ORA_DISK_2

starting media recovery

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/08/2018 11:23:34
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 49 and starting SCN of 2002997 found to restore
报错属于正常,因为联机日志没有拷贝过来!
RMAN> alter database open resetlogs;
database opened
SYS@PROD> select status from v$instance;

STATUS

OPEN

相关内容

热门资讯

专家:伊朗局势或引发难民危机和... 据凤凰卫视报道,在伊朗持续的反政府示威也引发土耳其各界高度关注。有土耳其专家分析,伊朗动乱不但有引发...
华为发布2026智能光伏十大趋... 全场景构网 激发AI潜能 铸就高质量 加速光风储成为主力电源 1月12日,数字能源以“全场景构网...
特朗普会对伊朗动武吗?专家:存... 新华社北京1月13日电 题:美国会对伊朗动武吗?新华社记者蔺妍 胡冠 阚静文美国政府近期多次针对伊朗...
大型撞击造成月幔“蒸发”?嫦娥... 月球正面与背面的演化差异,是长期悬而未决的科学谜题。 我国科研人员通过对嫦娥六号月球背面样品的高精度...
医疗器械企业一般纳税人核定所得... 在医疗器械行业,二三类器械企业作为市场主力,不仅要面对严苛的行业监管、高昂的研发投入和激烈的市场竞争...
中山企业家担任国际标准化组织要... 近日,国际标准化组织(ISO)官网公布,位于中山火炬高新区的广东欧亚包装有限公司董事长连运增担任国际...
全球首台20兆瓦风机成功过吊装 来源:滚动播报 (来源:千龙网) 1月13日,记者从三峡集团获悉,全球首台20兆瓦海上风电机组在福建...
格陵兰岛,俄方是在说西方人没听... 俄高级官员声称,如果特朗普不尽快采取行动,格陵兰岛可能会投票加入俄罗斯。俄罗斯的战略诱骗在发力。格陵...
闲鱼平台惊现“代坐”服务:二手... 来源:GPLPCN 近日,有网友反映,在闲鱼平台上出现了提供上海地铁“代坐”服务的帖子,标价1.9...
报告:工厂智能化呈现“东高、中... 转自:中国新闻网 报告:工厂智能化呈现“东高、中快、西广”区域格局 中新网北京1月13日电 (记者 ...