[20171031]rman xxx Failure.txt

[20171031]rman xxx Failure.txt

--//简单测试 List Failure, Advise Failure and Repair Failure命令在11g下,也许以后工作需要.
--//虽然我自己很少使用这个命令,感觉这个有点傻瓜化.

1.环境:
SYS@book> @ &r/ver1
PORT_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 Production

RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name BOOK

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    760      SYSTEM               ***     /mnt/ramdisk/book/system01.dbf
2    940      SYSAUX               ***     /mnt/ramdisk/book/sysaux01.dbf
3    865      UNDOTBS1             ***     /mnt/ramdisk/book/undotbs01.dbf
4    128      USERS                ***     /mnt/ramdisk/book/users01.dbf
5    346      EXAMPLE              ***     /mnt/ramdisk/book/example01.dbf
6    40       TEA                  ***     /mnt/ramdisk/book/tea01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    414      TEMP                 32767       /mnt/ramdisk/book/temp01.dbf

2.建立测试环境:
--//建立备份:
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 closed
database dismounted
Oracle instance shut down

$ mv /mnt/ramdisk/book/tea01.dbf /mnt/ramdisk/book/tea01.dbf_20171031

4.启动数据库:
SYS@book> startup
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/mnt/ramdisk/book/tea01.dbf'

SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
MOUNTED

5.通过以下命令观察:

--//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 missing

RMAN> 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 unavailable

RMAN> 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 Failure
RMAN> 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 missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=41 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=54 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /mnt/ramdisk/book/tea01.dbf was unintentionally renamed or moved, restore it

Automated 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 Failure
RMAN> Repair Failure preview;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm

contents 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 loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm

contents 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)? yes
executing repair script

Starting restore at 2017-10-31 15:55:10
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

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 00006 to /mnt/ramdisk/book/tea01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_gdsidcrr_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/full_gdsidcrr_1_1 tag=TAG20171031T154706
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2017-10-31 15:55:12

Starting recover at 2017-10-31 15:55:12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

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

Finished recover at 2017-10-31 15:55:12

sql statement: alter database datafile 6 online
repair failure complete

Do you want to open the database (enter YES or NO)? YES
database opened

SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE

--//OK现在数据库正常打开了.

时间: 2024-10-02 22:35:04

[20171031]rman xxx Failure.txt的相关文章

[20171031]rman merge例子2.txt

[20171031]rman merge例子2.txt --//以前做的测试 [20170626]rman merge例子.txt --//链接 http://blog.itpub.net/267265/viewspace-2141253/ --//不断应用日志,常用的方式如下: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER --------------------------

[20171031]rman备份压缩模式.txt

[20171031]rman备份压缩模式.txt --//测试rman备份压缩模式,那种效果好,我记忆里选择medium在备份时间和备份文件大小综合考虑最佳. --//还是通过脚本测试: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- ---------------------------

[20171130]关于rman备份疑问.txt

[20171130]关于rman备份疑问.txt --//前面测试太乱,重新做一些rman as copy相关测试. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- --------------------------------------------------------------

[20171206]rman与truncate.txt

[20171206]rman与truncate.txt --//昨天下班在回家的路上,突然想起以前遇到的问题,就是truncate表后,rman做备份时会备份多少truncate表的信息, --//当时在itpub上,还存在讨论,就是rman会备份空block吗?参考链接:http://www.itpub.net/thread-2050864-9-1.html --//zergduan兄还开了SR,答复如下: 终于有回复了 经过dump的确认,unused block compression 特

[20171101]rman to destination.txt

[20171101]rman to destination.txt --//国庆放假,看了一些rman方面的书,看到一个不常用的参数to destination,测试看看. 1.环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- ------------------------------------

[20170626]rman merge例子.txt

[20170626]rman merge例子.txt 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- -------------------------------------------------------------------------------- x86_64/Linux

[20171208]rman与truncate3.txt

[20171208]rman与truncate3.txt --//前几天测试truncate表依旧备份一部分信息,测试几次确定备份8extent.当时的测试几个extents是相邻的. --//今天补充测试如果数据分布是离散的,情况是否一样? 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ --------------

[20130803]ORACLE 12C RMAN 功能增强.txt

[20130803]ORACLE 12C RMAN 功能增强.txt 在oracle 12c rman中可以直接输入sql语句,缺点就是仅仅输出最大仅仅80列,不知道如何调整. d:\tmp>rman target sys/xxxx@test01p Recovery Manager: Release 12.1.0.1.0 - Production on Fri Aug 2 22:53:49 2013 Copyright (c) 1982, 2013, Oracle and/or its affi

[20130412]rman备份文件大小.txt

[20130412]rman备份文件大小.txt 记得以前看rman的书,rman仅仅备份已经格式话的块,如果这样一个表被truncate后,即使空间回收了.但是在rman备份时,备份大小不会变化太多,这些前面使用的块一定会备份.实际的测试情况是,备份文件会变小. 测试的链接:http://space.itpub.net/267265/viewspace-750049 如果是索引删除的情况呢?自己不能凭想象,还是做测试来看看. 1.测试环境: SQL> @verBANNER-----------