当前位置: 首页 > news >正文

oracle非归档恢复,非归档模式恢复数据库__oracle_ORA_DISK_channel_dbf_PROD__169IT.COM

在非归档模式下,丢失任意的数据文件并恢复数据库。以下是测试的过程:

---查看数据库的归档模式:

PROD>archive log list;

Database log mode              No Archive Mode

Automatic archival            Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence    1

Current log sequence          3

PROD>

---进入rman进行全库备份:

[Oracle@enmo ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Nov 21 23:09:20 2016

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

connected to target database: PROD (DBID=338469376, not open)

RMAN>

---进行全库备份:

RMAN> backup database;

Starting backup at 21-NOV-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/u01/app/oracle/oradata/PROD/system01.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/PROD/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/PROD/example01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/PROD/undotbs01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/myspace_01.dbf

input datafile file number=00006 name=/u01/app/oracle/oradata/PROD/ts_xxf_01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/PROD/users01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/PROD/ts_ctl01.dbf

channel ORA_DISK_1: starting piece 1 at 21-NOV-16

channel ORA_DISK_1: finished piece 1 at 21-NOV-16

piece handle=/u01/app/backup/db_0lrlgn84_1_1.rmn tag=TAG20161121T231100 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:04:50

Finished backup at 21-NOV-16

Starting Control File and SPFILE Autobackup at 21-NOV-16

piece handle=/u01/app/FRA/PROD/autobackup/2016_11_21/o1_mf_s_928537336_d363x905_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 21-NOV-16

---打开数据库:

PROD>alter database open;

Database altered.

---删除所有数据文件:

[oracle@enmo ~]$ cd  /u01/app/oracle/oradata/PROD/

[oracle@enmo PROD]$ ls

control01.ctl  redo01.log  redo03b.log  system01.dbf  temp04.dbf    undotbs01.dbf

example01.dbf  redo02b.log  redo03.log    temp01.dbf    ts_ctl01.dbf  users01.dbf

redo01b.log    redo02.log  sysaux01.dbf  temp03.dbf    ts_xxf_01.dbf

[oracle@enmo PROD]$

[oracle@enmo PROD]$

[oracle@enmo PROD]$ rm *.dbf

[oracle@enmo PROD]$ ls *.dbf

ls: *.dbf: No such file or directory

#已经删除所有数据文件。

---使用rman进行恢复数据库:

[oracle@enmo ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Nov 21 23:23:58 2016

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

connected to target database: PROD (DBID=338469376, not open)

RMAN>

--重载数据库:

RMAN> restore database;

Starting restore at 21-NOV-16

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=17 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/PROD/system01.dbf

channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/PROD/sysaux01.dbf

channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/PROD/undotbs01.dbf

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/PROD/users01.dbf

channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/PROD/example01.dbf

channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/PROD/ts_xxf_01.dbf

channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/PROD/ts_ctl01.dbf

channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/myspace_01.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/backup/db_0lrlgn84_1_1.rmn

channel ORA_DISK_1: piece handle=/u01/app/backup/db_0lrlgn84_1_1.rmn tag=TAG20161121T231100

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:05:14

Finished restore at 21-NOV-16

--通过介质恢复数据库:

RMAN> recover database;

Starting recover at 21-NOV-16

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/oradata/PROD/redo03.log

archived log file name=/u01/app/oracle/oradata/PROD/redo03.log thread=1 sequence=3

media recovery complete, elapsed time: 00:00:02

Finished recover at 21-NOV-16

---尝试打开数据库:

RMAN> alter database open;

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 11/21/2016 23:30:18

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

---以RESETLOGS方式打开数据库:

RMAN> alter database open RESETLOGS;

database opened

---恢复之后查看数据文件:

[oracle@enmo PROD]$ ls *.dbf

example01.dbf  system01.dbf  temp03.dbf  ts_ctl01.dbf  undotbs01.dbf

sysaux01.dbf  temp01.dbf    temp04.dbf  ts_xxf_01.dbf  users01.dbf

[oracle@enmo PROD]$

#所有的数据文件恢复成功。

相关文章:

  • 错误:文件被数字签名策略拒绝(File was rejected by digital signature policy)
  • Oracle数据所属表分区,oracle数据库表分区
  • 推荐两个免费下载Smartphone桌面主题的网站
  • matlab中产生对角阵,关于matlab中的diag函数(矩阵对角元素的提取和创建对角阵)
  • 找回“显示桌面” 图标 显示图标.scf
  • 查询oracle物化视图日志,oracle物化视图日志系列(一)
  • 使用Windows Mobile Test Framework进行Windows Mobile程序的自动化测试 - (2) 小试牛刀
  • linux cc脚本,LINUX:CentOS防CC攻击脚本
  • linux系统实用脚本,常用linux系统命令及简单小脚本
  • 调用JNI的程序 生成JAR包后的部署问题
  • linux网卡信息eno,gentoo linux 网卡eno1677736修改成eth0 的方法
  • 定义自定义的异常
  • linux 没有dll文件,求助 hai.dll文件丢失 在线等
  • System名称空间中常用的异常类
  • linux 网络存储,linux网络存储服务器iscsi详细介绍解读
  • [译]Python中的类属性与实例属性的区别
  • 【347天】每日项目总结系列085(2018.01.18)
  • CentOS7 安装JDK
  • Docker下部署自己的LNMP工作环境
  • go append函数以及写入
  • JS函数式编程 数组部分风格 ES6版
  • js正则,这点儿就够用了
  • 从0到1:PostCSS 插件开发最佳实践
  • 多线程 start 和 run 方法到底有什么区别?
  • 飞驰在Mesos的涡轮引擎上
  • 七牛云假注销小指南
  • 世界编程语言排行榜2008年06月(ActionScript 挺进20强)
  • 一个项目push到多个远程Git仓库
  • 原生 js 实现移动端 Touch 滑动反弹
  • 正则与JS中的正则
  • #if #elif #endif
  • #NOIP 2014# day.1 生活大爆炸版 石头剪刀布
  • #传输# #传输数据判断#
  • $分析了六十多年间100万字的政府工作报告,我看到了这样的变迁
  • (1/2)敏捷实践指南 Agile Practice Guide ([美] Project Management institute 著)
  • (2.2w字)前端单元测试之Jest详解篇
  • (C语言)深入理解指针2之野指针与传值与传址与assert断言
  • (Matlab)基于蝙蝠算法实现电力系统经济调度
  • (附源码)springboot猪场管理系统 毕业设计 160901
  • (附源码)ssm航空客运订票系统 毕业设计 141612
  • (一)UDP基本编程步骤
  • (转)Sql Server 保留几位小数的两种做法
  • (转)创业家杂志:UCWEB天使第一步
  • (轉貼) 蒼井そら挑戰筋肉擂台 (Misc)
  • **PHP分步表单提交思路(分页表单提交)
  • *Algs4-1.5.25随机网格的倍率测试-(未读懂题)
  • .net redis定时_一场由fork引发的超时,让我们重新探讨了Redis的抖动问题
  • .Net Web项目创建比较不错的参考文章
  • .net 按比例显示图片的缩略图
  • .NET 材料检测系统崩溃分析
  • .NET 常见的偏门问题
  • .NET性能优化(文摘)
  • .py文件应该怎样打开?
  • // an array of int
  • [ vulhub漏洞复现篇 ] Hadoop-yarn-RPC 未授权访问漏洞复现