ERP俱乐部
ERP爱好者、ERP从业者互相交流、互相学习的乐园;我们的愿景是成为全球一流的中文ERP(Enterprise Resource Planning)交流平台
网站首页 论坛首页 搜索 用户列表 FAQ 注册 登录  
ERP俱乐部 -> 数据库专栏 -> Oracle开发 -> Oracle10g恢复试验方法
  Oracle10g恢复试验方法
帖子发起人: 半神   发起时间: 2011-09-19 11:09 上午   回复数: 0
? 上一主题 下一主题 ?
楼主
  2011-09-19, 11:09 上午
半神 离线,最后访问时间: 2013/6/5 18:59:05 半神

发帖数前25位

超级管理员
职务: 超级管理员
80级
等级: 80级
注册: 2008年1月6日
区域: 华南
经验: 1,267
积分: 1,131
精华: 2
发贴: 590
排名: 26
Site AdministratorsGlobal ModeratorsSite ModeratorsSite Registered Users培训学员(MM学员服务区-北京200708班) 培训学员(FI学员服务区-深圳200805班) 每日发帖之星
Oracle10g恢复试验方法
 
看了Oracle 10g的闪回数据库特性,书上说不能完成删除一个表空间并用resetlogs恢复,其实这也就是说如果改变了数据库的结构,是不能闪回的,只能闪回逻辑修改,但我还是做了一个实验。
   我删除了一个表空间,再用数据库闪回,发现不能打开数据库,打开数据库的时候提示datafile 7这个文件offline,如果resetlogs就会丢失这个文件,于是我就用RMAN进行恢复,也就是要恢复到一个以前的时间,用的是UNTIL TIME这个语法,但在RESTORE就出错了,告诉不能恢复控制文件,在那个时间点确实没有备份控制文件,但数据文件已经全部恢复了,其实就是控制文件 所记录的SCN与数据文件的SCN不一致,数据库不能打开,也就是控制文件比数据文件新,我想到两个办法,一个是重建控制文件,用resetlogs选 项,一个是再往前面恢复,恢复一个在这之前的控制文件,我RMAN的controlfile autoback为on,控制文件都有备份。我采取了第二种办法。
  第一种,重建控制文件用resetlogs选项,新的控制文件的SCN是从数据文件中读取,再recover database until cancel .
  第二种办法还是一个跨resetlogs时间点恢复,因为昨天我做实验曾今用resetlogs打开过数据库,所以,我在恢复控制文件后,还RESET DATABASE to incarnation n,进行对应物的转换,不然RMAN会报
  RMAN-20207 UNTIL TIME is before RESETLOGSS time
  Cause: UNTIL TIME cannot be less than the database creation time or RESETLOGSS time.
  Action: Check the UNTIL TIME. If the database needs to be restored to an old incarnation, use the
  RESET DATABASE TO INCARNATION command.
  最后,进行recover database 后,数据成功恢复
  记录下过程,以后好参考
  我还是该把中间结果保存下来。
  哦,还有,RMAN的controlfile autoback不仅在备份的时候会自动备份控制文件,而且在数据库结构改变时也会自动备份,这是有 SERVER PROCESS完成,具体看
   The control file is also automatically backed up after database structural changes such as adding a new tablespace, altering the state of a tablespace or datafile (for example, bringing it online), adding a new online redo log, renaming a file, adding a new redo thread, and so on. Losing this information would compromise your ability to recover the database.
  This backup is performed by the server process itself, rather than one of the RMAN channels. This type of autobackup, unlike autobackups that occur after a successful backup, is always created on disk. You can useCONFIGURECONTROLFILEAUTOBACKUPFORDEVICETYPEDISKto set the location for this disk based control file autobackup. Note that a failure of the automatic control file autobackup after a structural change never causes the associated structural change to fail. For example, if you add a datafile, and if the resulting control file autobackup fails, then the datafile addition is still successful.
开源时代的到来,对与技术人员是一个巨大的考验



QQ:876162454


分享按钮 IP 地址: 已登录   来自: 已登录    返回顶部
 第 1 页 总共 1 页 [共有 1 条记录]
ERP俱乐部 -> 数据库专栏 -> Oracle开发 -> Oracle10g恢复试验方法
(C)Copyright 2005-2020 www.erpclub.org All Rights Reserved.
Tel:+86-755-26444630
Email:webmaster@yok.com.cn