大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
小编给大家分享一下Linux环境下oracle数据库Rman备份如何实现异机恢复,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
公司主营业务:网站设计制作、做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出琼结免费做网站回馈大家。
备份的数据库和要恢复的数据库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;
OPEN
以上是“Linux环境下oracle数据库Rman备份如何实现异机恢复”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!