[20171031]rman xxx Failure.txt

简介: [20171031]rman xxx Failure.txt --//简单测试 List Failure, Advise Failure and Repair Failure命令在11g下,也许以后工作需要.

[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现在数据库正常打开了.

目录
相关文章
|
关系型数据库 MySQL
mysqlbinlog: File ‘mysql-bin.000001;‘ not found (Errcode: 2 - No such file or directory)
mysqlbinlog: File ‘mysql-bin.000001;‘ not found (Errcode: 2 - No such file or directory)
494 0
|
存储
rman备份失败:ORA-00245: control file backup failed; target is likely on a local file system
rman备份失败:ORA-00245: control file backup failed; target is likely on a local file system
152 0
error: ac_nonexistent.h: No such file or directory
error: ac_nonexistent.h: No such file or directory
554 0
|
Unix Linux
Symantec Backup Exec 报"Access denied to directory xxx" Error Code E0008488
使用Symantec Backup Exec将几台Linux服务器上的RMAN备份收带时,偶尔会遇到作业备份失败的情况,检查Job History,就会发现有“Access denied to directory u05/backup/backupsets" 这类错误,当然实际路径为/u05/backup/backupsets.
2577 0
|
SQL 监控
backup log is terminating abnormally because for write on file failed: 112(error not found)
昨天遇到一个案例,YourSQLDba做事务日志备份时失败,检查YourSQLDba输出的错误信息如下:   yMaint.backups backup log [gewem] to disk = 'M:\DB_BACKUP\LOG_BACKUP\xxxx_[2016-11-22_01h11m05_Tue]_logs.
1237 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
1011 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1225 0
|
Oracle 关系型数据库 数据库
[20170512]ora-00600[2662]错误3.txt
[20170512]ora-00600[2662]错误3.txt --//前一阵子的测试:链接http://blog.itpub.net/267265/viewspace-2137424/ --//本想测试修改一些重要的信息块,结果提升了scn的结果,但是如果异常关闭,就没有这样的结果.
1097 0
|
监控 Oracle 关系型数据库
[20170315]ORA-19656错误.txt
[20170315]ORA-19656错误.txt --//上午删除测试数据库的归档日志,遇到ORA-19656,做一个记录. 1.环境: SYS@book> @ &r/ver BANNER ----------------------------...
828 0