ORACLE利用STANDBY端RMAN备份进行数据恢复

这里记录一下流程,有我和同事问心进行测试

dataguard主库和物理备库主要是controlfile文件有区别,用restore可以查看含有primary,standby关键字
RMAN> restore ;


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, channel, check, controlfile, database, datafile, device, force, from, high, preview, primary, skip readonly, spfile, standby, tablespace, to restore point, until restore point, until, validate, ("
RMAN-01007: at line 1 column 9 file: standard input




RMAN> restore primary;


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "controlfile"
RMAN-01007: at line 1 column 16 file: standard input






利用物理备库rman备份文件恢复过程:


SQL> startup nomount;
ORACLE instance started.


Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             775947392 bytes
Database Buffers          260046848 bytes
Redo Buffers                5632000 bytes


[oracle@std]$ rman target/


Recovery Manager: Release 11.2.0.4.0 - Production on Mon Sep 26 15:09:14 2016


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: DG (not mounted)


RMAN> restore primary controlfile from '/u01/app/oracle/product/11.2.0/dbhome1/dbs/c-1832575162-20160926-01';


Starting restore at 26-SEP-16
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/dg/control01.ctl
output file name=/u01/app/oracle/oradata/dg/control02.ctl
Finished restore at 26-SEP-16


RMAN> sql 'alter database mount';


sql statement: alter database mount
released channel: ORA_DISK_1


SQL> select open_mode,database_role from v$database;


OPEN_MODE                                                    DATABASE_ROLE
------------------------------------------------------------ ------------------------------------------------
MOUNTED                                                      PRIMARY




RMAN> restore database;


Starting restore at 26-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK


channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/dg/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/dg/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/dg/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dg/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/dg/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/dg/lieb01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1 tag=TAG20160926T145629
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:56
Finished restore at 26-SEP-16




RMAN> recover database;


Starting recover at 26-SEP-16
using channel ORA_DISK_1


starting media recovery


archived log for thread 1 with sequence 0 is already on disk as file /u01/app/oracle/oradata/dg/redo03.log
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1 tag=TAG20160926T145628
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_19_922121441.dbf thread=1 sequence=19
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=20
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1 tag=TAG20160926T145817
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_20_922121441.dbf thread=1 sequence=20
unable to find archived log
archived log thread=1 sequence=21
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/26/2016 15:20:49
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 21 and starting SCN of 1402274








SQL> alter database open resetlogs;


Database altered.


SQL> select open_mode,database_role from v$database;


OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ WRITE           PRIMARY

作者微信:

               

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/290772.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

腾讯急招多名.NET Core,5年30k!

金三银四跳槽季,腾讯急招5年左右.NET Core高级开发岗,基本月薪能到30k,心动吗?这里推荐个.NET跳槽大厂交流群,有技术交流,有面经分享,还有内推通道,据说有一定几率降低学历要求&…

【BZOJ】1679: [Usaco2005 Jan]Moo Volume 牛的呼声(数学)

http://www.lydsy.com/JudgeOnline/problem.php?id1679 水题没啥好说的。。自己用笔画画就懂了 将点排序&#xff0c;然后每一次的点到后边点的声音距离和(n-i)*(a[i1]-a[i])之前同样操作所得的的sum 然后答案就是累加后2 #include <cstdio> #include <cstring> #…

perl学习笔记——目录操作

在目录书中移动 chdir 操作副改变当前的工作目录。它和shell中cd命令类似&#xff1a; chdir ‘/etc’ or die “cannot chdir to /etc:$1”; 注意&#xff1a;工作目录不能更改的&#xff0c;也就是说Perl程序返回后一定会回到所在的工作目录。 如果调用chdir时不加参数&#…

凌动服务器系列,凌动也能造服务器?超微又出怪异新品

【IT168 专稿】上月初举行的英特尔春季IDF上&#xff0c;记者看到超微展示了采用独特设计的2U Twin系列高密度Nehalem服务器&#xff0c;该服务器采用了全冗余设计&#xff0c;包括主板在内的所有部件都有两个互为备份。可以说超微一直以来都以自身独特的设计理念和大胆的实践拓…

C语言——关于数据在内存中存储的练习

大家好&#xff0c;我是残念&#xff0c;希望在你看完之后&#xff0c;能对你有所帮助&#xff0c;有什么不足请指正&#xff01;共同学习交流 本文由&#xff1a;残念ing原创CSDN首发&#xff0c;如需要转载请通知 个人主页&#xff1a;残念ing-CSDN博客&#xff0c;欢迎各位→…

LeetCode之字符串(C++)的切割简单实现

1、问题 C++字符串的切割 2、代码 #include <iostream> #include <string> #include <vector>std::vector<std::string> splite(const std::string &value, const std::string &pattern) {std::vector<std::string> result;if (value …

Avalonia跨平台入门第九篇之控件置顶和置底

在前面分享的几篇中咱已经玩耍了Popup、ListBox多选、Grid动态分、RadioButton模板、控件的拖放效果;今天趁着有时间接着对拖放到Canvas上的控件进行置顶和置底切换的效果,最终实现的效果如下图:关于置顶和置底的实现代码:接下来的文章中我会再来分享在Canvas上控件的锁定效果;…

unity的依赖注入

参考文档 http://www.cnblogs.com/zhangchenliang/archive/2013/01/08/2850970.html http://www.tuicool.com/articles/yiUzQj IUnityContainer container new UnityContainer();#region 1.0 注册类型container.RegisterType<IKiss, Boy>();var boy container.Resolve&…

ios 贝塞尔动画

CGPoint fromPoint self.imageView.center; //路径曲线 UIBezierPath *movePath [UIBezierPath bezierPath]; [movePath moveToPoint:fromPoint]; CGPoint toPoint CGPointMake(300, 460); [movePath addQuadCurveToPoint:toPoint c…

SAP中查询用户操作日志的事务码

事务码&#xff1a;STAD 注意&#xff1a;查询的时间跨度范围不要太大&#xff0c;否则会很慢&#xff01; 事务码&#xff1a;ST03N 工作负载和性能统计转载于:https://www.cnblogs.com/ruingy/p/3955340.html

C/C++之常用字符串比较总结

1、std::string比较 我们一般用str1.compare(str2) 0来实现 2、const char* 的比较 我们一般用strcmp(p1, p2) 0来实现 3、代码 4、结果 str1 str4 str5 is null p1 p3

【C#/.NET】控制台上动态构建中间件管道

如上图所示&#xff1a;我们将会在下面文章上一步一步变形实现出这样的功能。一、傻瓜式执行演示首先建立控制台项目&#xff0c;创建Begin() FirstMiddleware() SecondMiddleware() End() 三个函数1 /// <summary>2 /// 开始执行前3 /// </summ…

SON Web Token设计单点登录系统

2019独角兽企业重金招聘Python工程师标准>>> 上次在《JSON Web Token - 在Web应用间安全地传递信息》中我提到了JSON Web Token可以用来设计单点登录系统。我尝试用八幅漫画先让大家理解如何设计正常的用户认证系统&#xff0c;然后再延伸到单点登录系统。 如果还没…

00001centos6.3安装

使用的环境centos6.3vm9putty or xshell4xshell4 乱码问题http://blog.itpub.net/26230597/viewspace-1146248/后盾网李波老师的PPT非常给力可惜没找到转载于:https://blog.51cto.com/panzhengming/1548791

Android之获取指定目录下的所有特殊文件名字

1、获取指定目录下的所有特殊文件名字 比如我们在sdcard目录下的chenyu这个文件夹里面获取以so文件结尾的所有文件名 2、代码 public ArrayList<String> getFileName(String fileAbsolutePaht, String type) {ArrayList<String> result new ArrayList<String&…

笔记(2015-07-24)

STL方面的笔记 以下为vector queue map set stack的基本用法 可编译结合注释查看 1 #include <vector>2 #include <iostream>3 #include <queue>4 #include <map>5 #include <set>6 #include <stack>7 using namespace std;8 9 #define RE…

Avalonia跨平台入门第十篇之控件的锁定

在前面分享的几篇中咱已经玩耍了Popup、ListBox多选、Grid动态分、RadioButton模板、控件的拖放效果、控件的置顶和置底;今天趁着有时间接着对拖放到Canvas上的控件进行锁定的效果,最终实现的效果如下图:关于控件的锁定实现代码:接下来的文章中我会分享控件在Canvas范围内拖拽和…

开放一些常见功能的工具类代码

public static class CommonUtil{/// <summary>/// 显示表单/// </summary>/// <param name"view"></param>/// <param name"panelKey"></param>/// <returns></returns>public static void ShowForm(thi…

ios之第一个图形化界面

1、创建ios项目 1、create Xcode ->simpleViewApplication -> input Program name 2、在控制器里面加入代码 我们在viewControl.m里面加上UILabel控件&#xff0c;这个控件和Android 里面的TextView类似&#xff0c;具体代码如下// // ViewController.m // SecondHello…

Memcached简介

在Web服务开发中&#xff0c;服务端缓存是服务实现中所常常采用的一种提高服务性能的方法。其通过记录某部分计算结果来尝试避免再次执行得到该结果所需要的复杂计算&#xff0c;从而提高了服务的运行效率。 除了能够提高服务的运行效率之外&#xff0c;服务端缓存还常常用来提…