[20171031]rman xxx Failure.txt
--//简单测试 List Failure, Advise Failure and Repair Failure命令在11g下,也许以后工作需要.--//虽然我自己很少使用这个命令,感觉这个有点傻瓜化.1.环境:SYS@book> @ &r/ver1PORT_STRING VERSION BANNER------------------------------ -------------- --------------------------------------------------------------------------------x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionRMAN> report schema;using target database control file instead of recovery catalogReport of database schema for database with db_unique_name BOOKList of Permanent Datafiles===========================File Size(MB) Tablespace RB segs Datafile Name---- -------- -------------------- ------- ------------------------1 760 SYSTEM *** /mnt/ramdisk/book/system01.dbf2 940 SYSAUX *** /mnt/ramdisk/book/sysaux01.dbf3 865 UNDOTBS1 *** /mnt/ramdisk/book/undotbs01.dbf4 128 USERS *** /mnt/ramdisk/book/users01.dbf5 346 EXAMPLE *** /mnt/ramdisk/book/example01.dbf6 40 TEA *** /mnt/ramdisk/book/tea01.dbfList of Temporary Files=======================File Size(MB) Tablespace Maxsize(MB) Tempfile Name---- -------- -------------------- ----------- --------------------1 414 TEMP 32767 /mnt/ramdisk/book/temp01.dbf2.建立测试环境:--//建立备份:delete archivelog all;backup database format '/home/oracle/backup/full_%U';backup archivelog all format '/home/oracle/backup/archive_%U';--//过程略.3.关闭数据库,删除一个数据文件:RMAN> shutdown immediate ;database closeddatabase dismountedOracle instance shut down$ mv /mnt/ramdisk/book/tea01.dbf /mnt/ramdisk/book/tea01.dbf_201710314.启动数据库:SYS@book> startupORACLE instance started.Total System Global Area 634732544 bytesFixed Size 2255792 bytesVariable Size 197133392 bytesDatabase Buffers 427819008 bytesRedo Buffers 7524352 bytesDatabase mounted.ORA-01157: cannot identify/lock data file 6 - see DBWR trace fileORA-01110: data file 6: '/mnt/ramdisk/book/tea01.dbf'SYS@book> select open_mode from v$database ;OPEN_MODE--------------------MOUNTED5.通过以下命令观察:--//List Failure;RMAN> List Failure;List of Database Failures=========================Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------------- -------71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missingRMAN> List Failure detail;List of Database Failures=========================Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------------- -------71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing Impact: See impact for individual child failures List of child failures for parent failure ID 71648 Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------------- ------- 71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing Impact: Some objects in tablespace TEA might be unavailableRMAN> List Failure 71651;List of Database Failures=========================Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------------- -------71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing Impact: Some objects in tablespace TEA might be unavailable--//Advise FailureRMAN> Advise Failure;List of Database Failures=========================Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------------- -------71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missinganalyzing automatic repair options; this may take some timeallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=28 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=41 device type=DISKallocated channel: ORA_DISK_3channel ORA_DISK_3: SID=54 device type=DISKanalyzing automatic repair options completeMandatory Manual Actions========================no manual actions availableOptional Manual Actions=======================1. If file /mnt/ramdisk/book/tea01.dbf was unintentionally renamed or moved, restore itAutomated Repair Options========================Option Repair Description------ ------------------1 Restore and recover datafile 6 Strategy: The repair includes complete media recovery with no data loss Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm$ cat /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm # restore and recover datafile restore datafile 6; recover datafile 6; sql 'alter database datafile 6 online';--//可以发现修复脚本.再次执行Advise Failure ;还是在目录/u01/app/oracle/diag/rdbms/book/book/hm/生产不同的文件.--//Repair FailureRMAN> Repair Failure preview;Strategy: The repair includes complete media recovery with no data lossRepair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hmcontents of repair script: # restore and recover datafile restore datafile 6; recover datafile 6; sql 'alter database datafile 6 online';RMAN> Repair Failure ;Strategy: The repair includes complete media recovery with no data lossRepair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hmcontents of repair script: # restore and recover datafile restore datafile 6; recover datafile 6; sql 'alter database datafile 6 online';Do you really want to execute the above repair (enter YES or NO)? yesexecuting repair scriptStarting restore at 2017-10-31 15:55:10using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00006 to /mnt/ramdisk/book/tea01.dbfchannel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_gdsidcrr_1_1channel ORA_DISK_1: piece handle=/home/oracle/backup/full_gdsidcrr_1_1 tag=TAG20171031T154706channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 2017-10-31 15:55:12Starting recover at 2017-10-31 15:55:12using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3starting media recoverymedia recovery complete, elapsed time: 00:00:00Finished recover at 2017-10-31 15:55:12sql statement: alter database datafile 6 onlinerepair failure completeDo you want to open the database (enter YES or NO)? YESdatabase openedSYS@book> select open_mode from v$database ;OPEN_MODE--------------------READ WRITE--//OK现在数据库正常打开了.