中国教育在线 中国教育网 加入收藏 设为首页

Oracle认证:Oracle10g恢复试验方法

http://itpx.eol.cn  来源:  作者:网络转载  2011-09-06    

  看了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.

推荐给好友    我要收藏    我要纠错    分享到

免责声明:

① 凡本站注明“稿件来源:中国教育在线”的所有文字、图片和音视频稿件,版权均属本网所有,任何媒体、网站或个人未经本网协议授权不得转载、链接、转贴或以其他方式复制发表。已经本站协议授权的媒体、网站,在下载使用时必须注明“稿件来源:中国教育在线”,违者本站将依法追究责任。

② 本站注明稿件来源为其他媒体的文/图等稿件均为转载稿,本站转载出于非商业性的教育和科研之目的,并不意味着赞同其观点或证实其内容的真实性。如转载稿涉及版权等问题,请作者在两周内速来电或来函联系。

内容推荐
eol.cn简介 | 联系方式 | 网站声明 | 京ICP证140769号 | 京ICP备12045350号 | 京公网安备 11010802020236号
版权所有 北京中教双元科技集团有限公司 EOL Corporation
Mail to: webmaster@eol.cn