Oracle RMAN完全恢复案例(二)
案例2:
--部分数据文件丢失,恢复数据文件(mount 或 open)
1)测试环境
07:30:40 SQL> create table test (id int) tablespace test;
Table created.
07:30:52 SQL> conn /as sysdba
Connected.
07:30:57 SQL>
07:30:57 SQL> insert into scott.test values (1);
1 row created.
07:31:02 SQL> commit;
Commit complete.
07:31:04 SQL> alter system archive log current;
System altered.
07:31:10 SQL> insert into scott.test values (2);
1 row created.
07:31:13 SQL> commit;
Commit complete.
07:31:15 SQL> alter system archive log current;
System altered.
07:31:16 SQL> insert into scott.test values (3);
1 row created.
07:31:19 SQL> commit;
Commit complete.
07:31:20 SQL> alter system archive log current;
System altered.
07:31:24 SQL> insert into scott.test values (4);
1 row created.
07:31:26 SQL> insert into scott.test values (5);
1 row created.
07:31:28 SQL> commit;
Commit complete.
07:31:30 SQL> select * from scott.test;
ID
----------
1
2
3
4
5
07:31:34 SQL>
07:31:34 SQL> shutdown abort
ORACLE instance shut down.
07:33:23 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@work ~]$ rm /u01/app/oracle/oradata/prod/test0*.dbf
2)启动database
07:34:07 SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 79693200 bytes
Database Buffers 230686720 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/prod/test01.dbf'
07:34:15 SQL> select file#,error from v$recover_file;
FILE# ERROR
---------- -----------------------------------------------------------------
6 FILE NOT FOUND
8 FILE NOT FOUND
3)利用rman 恢复datafile
RMAN> run {
2> startup force mount;
3> sql 'alter database datafile 6,8 offline';
4> alter database open;
5> restore datafile 6,8;
6> recover datafile 6,8;
7> sql 'alter database datafile 6,8 online';
8> }
Oracle instance started
database mounted
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 79693200 bytes
Database Buffers 230686720 bytes
Redo Buffers 2973696 bytes
using target database control file instead of recovery catalog
sql statement: alter database datafile 6,8 offline
database opened
Starting restore at 18-AUG-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to /u01/app/oracle/oradata/prod/test01.dbf
restoring datafile 00008 to /u01/app/oracle/oradata/prod/test02.dbf
channel ORA_DISK_1: reading from backup piece /disk1/rman/prod/PROD_31.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/disk1/rman/prod/PROD_31.bak tag=TAG20110818T071905
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 18-AUG-11
Starting recover at 18-AUG-11
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 8 is already on disk as file /disk1/arch/prod/arch_8_1_759396736.log
archive log thread 1 sequence 9 is already on disk as file /disk1/arch/prod/arch_9_1_759396736.log
archive log thread 1 sequence 10 is already on disk as file /disk1/arch/prod/arch_10_1_759396736.log
archive log thread 1 sequence 11 is already on disk as file /disk1/arch/prod/arch_11_1_759396736.log
archive log thread 1 sequence 12 is already on disk as file /disk1/arch/prod/arch_12_1_759396736.log
archive log thread 1 sequence 13 is already on disk as file /disk1/arch/prod/arch_13_1_759396736.log
archive log filename=/disk1/arch/prod/arch_8_1_759396736.log thread=1 sequence=8
archive log filename=/disk1/arch/prod/arch_9_1_759396736.log thread=1 sequence=9
archive log filename=/disk1/arch/prod/arch_10_1_759396736.log thread=1 sequence=10
archive log filename=/disk1/arch/prod/arch_11_1_759396736.log thread=1 sequence=11
media recovery complete, elapsed time: 00:00:03
Finished recover at 18-AUG-11
sql statement: alter database datafile 6,8 online
RMAN>
4)验证:
[oracle@work ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 18 07:37:17 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
07:37:18 SQL>
07:37:18 SQL> select * from scott.test;
ID
----------
1
2
3
4
5
07:37:23 SQL>
oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html
转载于:https://blog.51cto.com/19880614/1219406
Oracle RMAN完全恢复案例(二)相关推荐
- Oracle RMAN 维护(二)--恢复目录的维护
使用恢复目录时会涉及到其他一些维护活动,比如在数据库升级或迁移期间升级恢复目录,手工配置数据库对应物以及在某些数据库操作后在同步恢复目录. 1.在RMAN中取消注册数据库 在Oracle 10g 之前 ...
- Oracle RMAN不完全恢复遇到的RMAN-06556
RMAN-06556: datafile 1 must be restored from backup older than SCN 1350000 这个问题在不完全恢复时经常出现,最近整理以前文档发 ...
- linux oraclerman自动备份,Linux平台下的Oracle自动备份案例(使用RMAN)
有个童鞋问rman的自动备份脚本程序,我之前有写过exp备份指定方案自动备份案例(Linux平台下的Oracle自动备份案例(使用exp工具) http://www.linuxidc.com/Lin ...
- Oracle RMAN Recover中使用BBED 跳过缺失的归档 继续 Recover 的测试
一.背景说明 Oracle RMAN 备份的恢复分2个步骤:RESTRE 和 RECOVER. 在这个过程中,Recover 是依赖与归档文件的. 假设一种情况:周一对数据库做了全备,然后保留归档.周 ...
- RMAN完全恢复与不完全恢复测试
RMAN完全恢复与不完全恢复测试 一.完全恢复 二.不完全恢复 2.1 基于时间点 2.2 基于日志序列号 2.3 基于SCN 恢复 2.4 通过INCARNATION不完全恢复 2.5 基于表空间时 ...
- oracle rman本地备份,【学习笔记】Oracle RMAN 备份集存储到远程其它服务器实现方法...
天萃荷净 应运维DBA要求,将服务器本地Oracle数据库的RMAN备份集备份存储到远程其它服务器中,结合案例详细讲解实现步骤 在linux中,要使用rman备份后传输到远程服务器上,可以选择ftp, ...
- oracle rman异机恢复
Oracle源主机 Oracle目标主机 主机平台 CentOS6.2(final) CentOs6.2(FInal) 主机名 vick rman IP地址 192.168.1.11 192.16 ...
- RMAN 系列(二) ---- RMAN 设置和配置
一. 配置数据库以ARCHIVELOG 模式运行 在ORACLE 10g 之前,在将数据库置入Archivelog 模式后,需要启动arch进程. 设置参数LOG_ARCHIVE_START 为tru ...
- Redis简单案例(二) 网站最近的访问用户
原文:Redis简单案例(二) 网站最近的访问用户 我们有时会在网站中看到最后的访问用户.最近的活跃用户等等诸如此类的一些信息.本文就以最后的访问用户为例, 用Redis来实现这个小功能.在这之前,我 ...
- oracle 运维案例,运维注意事项及案例讲解(个人心得)
应客户要求,需要写一篇<数据库运维注意事项和案例讲解>,正好自己也可以把近来这段时间中碰到的运维问题总结一下.同时也分享给大家.记之 ---------------------- 1.数据 ...
最新文章
- C++中的 istringstream
- windows10下,from skimage import morphology 报错的解决办法
- 后生可畏!中国军团称霸阅读理解竞赛RACE:微信AI称王,高中生力压腾讯康奈尔联队(附资料)...
- ABAP data extract 数据抽取总结
- 使用PHP-GTK编写一个windows桌面应用程序
- solr mysql数据注入_(solr系列:四)将mysql数据库中的数据导入到solr中
- 1.7 单层卷积网络
- 引物设计软件primer_常用生物学软件的安装与应用(三)—Primer6
- MATLAB 入门之旅【官方基础教程】
- C语言 结构体定义方法
- matlab随机函数
- 网站域名综合查询-批量免费网站域名综合查询工具
- win10下pyg离线安装
- 【初学python】用python做一个简单的超市收银台付款系统
- 自己开发基于Web的打印控件,真正免费不是共享
- 为何沃比帕克模式无法复制?
- h3c.服务器 装系统,h3c服务器u盘安装linux系统安装
- 小程序视频不显示进度条,且不能滑屏快进
- html a text decoration,你未必知道的CSS小知识:text-decoration属性变成了属性简写
- 数据结构 - 图的遍历