advise failure没有执行脚本-----归档有问题

删除日志与users表,利用恢复目录 恢复(#####问题###advise failure没有执行脚本###归档有问题####)
闪回需要关闭
SYS@PROD1> startup
ORACLE instance started.

Total System Global Area 471830528 bytes
Fixed Size 2254344 bytes
Variable Size 209717752 bytes
Database Buffers 251658240 bytes
Redo Buffers 8200192 bytes
Database mounted.
**ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: ‘/u01/app/oracle/oradata/PROD1/users01.dbf’**
[oracle@openlab1 scripts]$ rman target sys/oracle@PROD1 catalog rc_admin/rc_admin@PROD2

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jul 9 12:17:27 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD1 (DBID=2202243540, not open)
connected to recovery catalog database

RMAN> list failure;

**List of Database Failures
=========================**

Failure ID Priority Status Time Detected Summary


482 CRITICAL OPEN 09-JUL-18 Redo log group 2 is unavailable
488 HIGH OPEN 09-JUL-18 One or more non-system datafiles are missing
485 HIGH OPEN 09-JUL-18 Redo log file /u01/app/oracle/oradata/PROD1/redo02.log is missing

RMAN> advise failure;

**List of Database Failures
=========================**

Failure ID Priority Status Time Detected Summary


482 CRITICAL OPEN 09-JUL-18 Redo log group 2 is unavailable
488 HIGH OPEN 09-JUL-18 One or more non-system datafiles are missing
485 HIGH OPEN 09-JUL-18 Redo log file /u01/app/oracle/oradata/PROD1/redo02.log is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=79 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=232 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=156 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=6 device type=DISK
analyzing automatic repair options complete

Not all specified failures can currently be repaired.
The following failures must be repaired before advise for others can be given.

Failure ID Priority Status Time Detected Summary


482 CRITICAL OPEN 09-JUL-18 Redo log group 2 is unavailable
485 HIGH OPEN 09-JUL-18 Redo log file /u01/app/oracle/oradata/PROD1/redo02.log is missing

**Mandatory Manual Actions
========================**
1. If file /u01/app/oracle/oradata/PROD1/redo02.log was unintentionally renamed or moved, restore it
2. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair

**Optional Manual Actions
=======================**
no manual actions available

**Automated Repair Options
========================**
no automatic repair options available
没有可执行修复的脚本

解决方法
恢复数据库
[oracle@openlab1 ~]$ rman target sys/oracle@PROD1 catalog rc_admin/rc_admin@PROD2

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jul 9 12:29:36 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD1 (DBID=2202243540, not open)
connected to recovery catalog database

RMAN> restore datafile 4;

Starting restore at 09-JUL-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=80 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=155 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=233 device type=DISK

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 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98z3_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98z3_.bkp tag=TAG20180709T083238
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 09-JUL-18

RMAN> exit

RMAN> rman target /

RMAN> recover database;

Starting recover at 09-JUL-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/oradata/PROD1/redo03.log
archived log for thread 1 with sequence 13 is already on disk as file /home/oracle/flash/PROD1/archivelog/2018_07_09/o1_mf_1_13_fn5qgqnp_.arc
archived log file name=/u01/app/oracle/oradata/PROD1/redo03.log thread=1 sequence=12
archived log file name=/home/oracle/flash/PROD1/archivelog/2018_07_09/o1_mf_1_13_fn5qgqnp_.arc thread=1 sequence=13
unable to find archived log
archived log thread=1 sequence=14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/09/2018 12:32:04
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 14 and starting SCN of 1431261

RMAN> restore database until scn 1431261;

Starting restore at 09-JUL-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

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 00003 to /u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/PROD1/index01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/PROD1/oltp
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c9cmg_.bkp
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00002 to /u01/app/oracle/oradata/PROD1/sysaux01.dbf
channel ORA_DISK_2: restoring datafile 00005 to /u01/app/oracle/oradata/PROD1/example01.dbf
channel ORA_DISK_2: restoring datafile 00006 to /u01/app/oracle/oradata/PROD1/test.dbf
channel ORA_DISK_2: reading from backup piece /u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98jl_.bkp
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00001 to /u01/app/oracle/oradata/PROD1/system01.dbf
channel ORA_DISK_3: restoring datafile 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_3: restoring datafile 00008 to /u01/app/oracle/oradata/PROD1/tools01.dbf
channel ORA_DISK_3: reading from backup piece /u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98z3_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c9cmg_.bkp tag=TAG20180709T083238
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
channel ORA_DISK_2: piece handle=/u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98jl_.bkp tag=TAG20180709T083238
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:01:06
channel ORA_DISK_3: piece handle=/u01/app/oracle/archive_dest/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T083238_fn5c98z3_.bkp tag=TAG20180709T083238
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:01:26
Finished restore at 09-JUL-18

RMAN> recover database until scn 1431261;

Starting recover at 09-JUL-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/oradata/PROD1/redo03.log
archived log for thread 1 with sequence 13 is already on disk as file /home/oracle/flash/PROD1/archivelog/2018_07_09/o1_mf_1_13_fn5qgqnp_.arc
archived log file name=/u01/app/oracle/oradata/PROD1/redo03.log thread=1 sequence=12
archived log file name=/home/oracle/flash/PROD1/archivelog/2018_07_09/o1_mf_1_13_fn5qgqnp_.arc thread=1 sequence=13
media recovery complete, elapsed time: 00:00:09
Finished recover at 09-JUL-18

RMAN> sql ‘alter database open resetlogs’;

sql statement: alter database open resetlogs
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> exit

Recovery Manager complete.

SYS@PROD1> select name,open_mode from v$database;

NAME OPEN_MODE


PROD1 READ WRITE

SYS@PROD1> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@openlab1 ~]$ rman target sys/oracle@PROD1 catalog rc_admin/rc_admin@PROD2

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jul 9 12:39:08 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD1 (DBID=2202243540)
connected to recovery catalog database

RMAN> backup database;

Starting backup at 09-JUL-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=14 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=233 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=16 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=89 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD1/test.dbf
channel ORA_DISK_1: starting piece 1 at 09-JUL-18
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/PROD1/tools01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_2: starting piece 1 at 09-JUL-18
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/PROD1/oltp
input datafile file number=00007 name=/u01/app/oracle/oradata/PROD1/index01.dbf
channel ORA_DISK_3: starting piece 1 at 09-JUL-18
channel ORA_DISK_3: finished piece 1 at 09-JUL-18
piece handle=/home/oracle/flash/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T123926_fn5sr584_.bkp tag=TAG20180709T123926 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:29
channel ORA_DISK_2: finished piece 1 at 09-JUL-18
piece handle=/home/oracle/flash/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T123926_fn5sr57y_.bkp tag=TAG20180709T123926 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:39
channel ORA_DISK_1: finished piece 1 at 09-JUL-18
piece handle=/home/oracle/flash/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T123926_fn5sr5b9_.bkp tag=TAG20180709T123926 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:50
Finished backup at 09-JUL-18

Starting Control File and SPFILE Autobackup at 09-JUL-18
piece handle=/home/oracle/flash/PROD1/autobackup/2018_07_09/o1_mf_s_981031219_fn5ssn13_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 09-JUL-18

正常情况下:删除日志与users表,利用恢复目录 恢复
[oracle@openlab1 ~]$ s

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jul 15 21:43:07 2018

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@PROD1> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SYS@PROD1> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SYS@PROD1> startup
ORACLE instance started.

Total System Global Area 471830528 bytes
Fixed Size 2254344 bytes
Variable Size 209717752 bytes
Database Buffers 251658240 bytes
Redo Buffers 8200192 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: ‘/u01/app/oracle/oradata/PROD1/users01.dbf’

SYS@PROD1> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@openlab1 ~] [ o r a c l e @ o p e n l a b 1   ]
[oracle@openlab1 ~]$ rman target sys/oracle@PROD1 catalog rc_admin/rc_admin@PROD2

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 15 21:44:41 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD1 (DBID=2202243540, not open)
connected to recovery catalog database

RMAN> list failure
2> ;

**List of Database Failures
=========================**

Failure ID Priority Status Time Detected Summary


488 HIGH OPEN 15-JUL-18 One or more non-system datafiles are missing

RMAN> advise failure;

**List of Database Failures
=========================**

Failure ID Priority Status Time Detected Summary


488 HIGH OPEN 15-JUL-18 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=5 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=79 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=156 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=232 device type=DISK
analyzing automatic repair options complete

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

**Optional Manual Actions
=======================**
1. If file /u01/app/oracle/oradata/PROD1/users01.dbf was unintentionally renamed or moved, restore it

**Automated Repair Options
========================**
Option Repair Description


1 Restore and recover datafile 4
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/product/11.2.0/db_1/diag/rdbms/prod1/PROD1/hm/reco_1926305595.hm

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/product/11.2.0/db_1/diag/rdbms/prod1/PROD1/hm/reco_1926305595.hm

contents of repair script:
# restore and recover datafile
restore datafile 4;
recover datafile 4;
sql ‘alter database datafile 4 online’;

Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script

Starting restore at 15-JUL-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

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 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/flash/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T123926_fn5sr57y_.bkp
channel ORA_DISK_1: piece handle=/home/oracle/flash/PROD1/backupset/2018_07_09/o1_mf_nnndf_TAG20180709T123926_fn5sr57y_.bkp tag=TAG20180709T123926
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
Finished restore at 15-JUL-18

Starting recover at 15-JUL-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

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

Finished recover at 15-JUL-18

sql statement: alter database datafile 4 online
repair failure complete

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

猜你喜欢

转载自blog.csdn.net/weixin_42859372/article/details/81660407