Topic: Oracle10g恢复试验方法

ERP俱乐部

第 1 页 总共 1 页 [共有 1 条记录]


Posted by 半神 on 2011-09-19 11:09 上午
看了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.